Go Back   Gaming Gutter > Non-Gaming > Programming > Source Code


Source Code - Have a source code/project files you want to post? Do so here.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» GG Stuff

Follow us on Twitter!

Get the GG toolbar today (for firefox only)
» Recent Threads
Go to first new post Share your Phobia's and...
11-02-2009 07:56 PM
Last post by Jaydin
Today 09:30 PM
50 Replies, 385 Views
Go to first new post Journaling
11-17-2009 06:53 PM
by Cody!
Last post by Axed
Today 08:38 PM
4 Replies, 45 Views
Go to first new post How Long Do You Shower...
10-19-2009 08:25 PM
by dsi
Last post by vegeta23
Today 08:36 PM
60 Replies, 509 Views
Go to first new post SO GOOD
Today 08:27 PM
by nomhak
Last post by Axed
Today 08:33 PM
7 Replies, 29 Views
why is everyone here so...
11-17-2009 12:31 AM
Last post by vegeta23
Today 08:30 PM
16 Replies, 283 Views
Closed Thread
 
LinkBack Thread Tools Display Modes

 [VB6] Ultimate auto refresher
Old 09-18-2006, 09:10 AM   #1 (permalink)
Sub
THE Not-So-Super Moderator

Male Sub is offline
 
Sub's Avatar
 
Join Date: Sep 2006
Location: England
Age: 17
Posts: 1,220
GPoints: 412
iTrader: 0 / 0%
Sub Is a New Face in Town
Rep Power: 11
[VB6] Ultimate auto refresher

Another old source, but maybe you could learn something from it.

Code:
Public Function rand(ByVal Min As Double, _ ByVal Max As Double) As Double ' A good random function ' Dim r As Double If Not bolAfterFirstCall Then Randomize bolAfterFirstCall = True End If rand = Int(Rnd * (Max - Min + 1)) + Min End Function Private Sub Command10_Click() Timer1.Enabled = True Label1.Caption = "Refreshing.." End Sub Private Sub Command11_Click() Timer1.Enabled = False End Sub Private Sub Command12_Click() Timer2.Enabled = True End Sub Private Sub Command13_Click() Timer2.Enabled = False End Sub Private Sub Command14_Click() Timer3.Enabled = True End Sub Private Sub Command15_Click() Timer3.Enabled = False End Sub Private Sub Command2_Click() List1.Clear End Sub Private Sub Command4_Click() List2.Clear End Sub Private Sub Command6_Click() List3.Clear End Sub Private Sub Command7_Click() List1.AddItem Text1.Text Text1.Text = "" End Sub Private Sub Command8_Click() List2.AddItem Text2.Text Text2.Text = "" End Sub Private Sub Command9_Click() List3.AddItem Text3.Text Text3.Text = "" End Sub Private Sub Text4_KeyPress(KeyAscii As Integer) If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0 End Sub Private Sub Text5_KeyPress(KeyAscii As Integer) If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0 End Sub Private Sub Form_Load() txtUser = GetSetting(App.EXEName, "Login", "Username") txtPass = GetSetting(App.EXEName, "Login", "Password") End Sub Private Sub cmdLogin_Click() Label13.Caption = "" If ((txtUser = Empty Or txtPass = Empty)) Then Label1.Caption = "Please enter a user/pass combination." Else Select Case Combo1.Text Case "Netscape 8" Agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20050519 Netscape/8.0.1" Case "Netscape 7.2" Agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)" Case "Netscape 6.1" Agent = "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1" Case "AOL browser" Agent = "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.0.2) Gecko/20020924 AOL/7.0" Case "IE 6#" Agent = "MMozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" Case "Konqueror 3.4.3" Agent = "Mozilla/5.0 (compatible; Konqueror/3.4; FreeBSD) KHTML/3.4.3 (like Gecko)" Case "Opera 7.x" Agent = "Opera/7.x (Windows NT 5.1; U) [en]" Case "Safari 2.0" Agent = "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/412 (KHTML, like Gecko) Safari/412" Case "Firefox 1.6" Agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20051102 Firefox/1.6a1" Case Else Agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" End Select SaveSetting App.EXEName, "Login", "Username", txtUser.Text SaveSetting App.EXEName, "Login", "Password", txtPass.Text Label1.Caption = "Logging in..." DPage = Wrapper1.PostWrapper("http://www.neopets.com/login.phtml", "username=" & txtUser & "&password=" & txtPass & "&destination=/petcentral.phtml", "http://www.neopets.com/hi.phtml") If (InStrB(1, DPage, "Location: /petcentral.phtml")) Then Label1.Caption = "Successful login" DPage = Wrapper1.GetWrapper("http://www.neopets.com/quickref.phtml", Wrapper1.LastPage) CheckMyPet 'Logged in, do whatever you want now 'Me.Hide 'frmProgram.Show ElseIf (InStrB(1, DPage, "FROZEN")) Then Label1.Caption = "FROZEN :'(" ElseIf (InStrB(1, DPage, "badpassword")) Then Label1.Caption = "Invalid password" End If End If End Sub Private Sub CheckMyPet() Dim lngStart As Long Dim lngEnd As Long Dim Pet As String lngStart = InStr(1, DPage, "Pet : <a class=tl href=/quickref.phtml>") If lngStart = 0 Then: Exit Sub lngStart = lngStart + Len("Pet : <a class=tl href=/quickref.phtml>") lngEnd = InStr(lngStart, DPage, "</a>") If lngEnd = 0 Then: Exit Sub Pet = Mid(DPage, lngStart, lngEnd - lngStart) Label13.Caption = "Active Neopet: " & Pet End Sub Private Sub Text4_Change() Timer1.Interval = Text4.Text Timer2.Interval = Text4.Text Timer3.Interval = Text4.Text End Sub Private Sub Timer1_Timer() Dim RandNum As Integer RandNum = rand(0, List1.ListCount) Text6.Text = List1.List(RandNum) Label10.Caption = Label10.Caption + 1 Text9 = Inet1.OpenURL(Text6.Text) If InStr(Text9, "Something Has") Then Label12.Caption = Label12.Caption + 1 End If End Sub Private Sub Timer2_Timer() Dim RandNum As Integer RandNum = rand(0, List2.ListCount) Text7.Text = List2.List(RandNum) Label10.Caption = Label10.Caption + 1 Text10 = Inet2.OpenURL(Text7.Text) If InStr(Text10, "Something Has") Then Label12.Caption = Label12.Caption + 1 End If End Sub Private Sub Timer3_Timer() Dim RandNum As Integer RandNum = rand(0, List3.ListCount) Text8.Text = List3.List(RandNum) Label10.Caption = Label10.Caption + 1 Text11 = Inet3.OpenURL(Text8.Text) If InStr(Text11, "Something Has") Then Label12.Caption = Label12.Caption + 1 End If End Sub Private Sub txtPass_GotFocus() txtPass.SelStart = 0 txtPass.SelLength = Len(txtPass) End Sub Private Sub txtUser_GotFocus() txtUser.SelStart = 0 txtUser.SelLength = Len(txtUser) End Sub
 

 
Old 09-18-2006, 04:28 PM   #2 (permalink)
imported_rcadble
Guest

 
Posts: n/a
GPoints: 0 [Check]
iTrader: / %
Rep Power:
Not horrible, fairly nice, but the controls should really be named properly.
 

 
Old 06-27-2007, 08:23 PM   #3 (permalink)
Full Member

Ricardandroy is offline
 
Ricardandroy's Avatar
 
Join Date: Jun 2007
Posts: 110
GPoints: 5
iTrader: 0 / 0%
Ricardandroy Is a New Face in Town
Rep Power: 8
cool, you are great

i like your source to public, it may be useful to who need it

Last edited by Jax; 06-30-2007 at 02:03 AM.. Reason: Double post
 

 
Old 06-28-2007, 11:19 AM   #4 (permalink)
Banned

Male Zetin is offline
 
Join Date: May 2007
Location: South-West Pacific
Posts: 482
GPoints: 55
iTrader: 0 / 50%
Zetin Is a New Face in Town
Rep Power: 0
i´ll try it when i get home
 

 
Old 06-29-2007, 04:57 AM   #5 (permalink)
Full Member

cliche_dreams is offline
 
cliche_dreams's Avatar
 
Join Date: Jun 2007
Posts: 42
GPoints: 21
iTrader: 0 / 0%
cliche_dreams Is a New Face in Town
Rep Power: 8
yay cool! Is it still useable?
 
Closed Thread

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ultimate MS Guide PieM4ster Maplestory Guides 38 12-02-2006 10:22 PM
Simple Refresher Code The_Hitman Source Code 8 11-21-2006 09:46 PM
neopets awesome refresher and other bots flame0505635 Neopets 5 10-29-2006 12:09 AM
Kanes Auto-Refresher second2none Programming 2 10-19-2006 03:50 PM

Powered by vBadvanced CMPS v3.1.0

All times are GMT -7. The time now is 09:46 PM.


vBulletin skin developed by: eXtremepixels
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.25371599 seconds (100.00% PHP - 0% MySQL) with 22 queries