Go Back   Gaming Gutter > Non-Gaming > Programming > Tutorials


Tutorials - Looking for programming tutorials to increase your knowledge? 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 Price Check on these 2...
Yesterday 01:18 PM
by Liccy
Last post by Liccy
Today 04:27 AM
2 Replies, 19 Views
Go to first new post IMMA CRY
Yesterday 09:07 PM
by tealeaf
Last post by Unregenerate Passion
Today 01:20 AM
6 Replies, 71 Views
Go to first new post If you had 24 hours to...
08-11-2009 05:18 AM
by Scythe
Last post by Dr. Ogrish
Today 12:58 AM
45 Replies, 663 Views
Go to first new post Ugly face hot body.
05-05-2009 04:24 PM
by `Kari
Last post by Dr. Ogrish
Today 12:58 AM
69 Replies, 1,808 Views
Go to first new post Milestone Post Count...
01-16-2007 08:54 AM
by nomhak
Last post by Dr. Ogrish
Today 12:56 AM
545 Replies, 8,030 Views
Reply
 
LinkBack Thread Tools Display Modes

 [vb6] Having your program auto log back in
Old 08-11-2008, 01:16 PM   #1 (permalink)
Full Member

Male Violent_J is offline
 
Violent_J's Avatar
 
Join Date: Nov 2006
Location: Sacramento, California
Age: 18
Posts: 1,057
GPoints: 5,450
iTrader: 5 / 100%
Violent_J Is a Party CaptainViolent_J Is a Party CaptainViolent_J Is a Party Captain
Rep Power: 14
[vb6] Having your program auto log back in

In my new program I have this feature.

It is basically just this

Code:
Sub Login_to_neopets()
    StopProgram = False
    cmdlogin.Enabled = False


    strHTML = w.PostWrapper("http://www.neopets.com/login.phtml", "username=" & txtusername.Text & "&password=" & txtpassword.Text & "&destination=%2Findex.phtml", "http://www.neopets.com/hi.phtml")
    If InStrB(1, strHTML, "badpassword") Then
        lblstatus.Caption = "Wrong password!"
        cmdlogin.Enabled = True
    ElseIf InStrB(1, strHTML, "FROZEN") Then
        lblstatus.Caption = "Account frozen!"
        cmdlogin.Enabled = True
    ElseIf InStrB(1, strHTML, "too many times") Then
        lblstatus.Caption = "Guessed password too many times!"
        cmdlogin.Enabled = True

    ElseIf InStrB(1, strHTML, txtusername.Text) Then
        txtlog.Text = txtlog.Text & vbNewLine & Time & " : Relogged in as " & txtusername.Text
        cmdstart.Enabled = True
        cmdstart_Click
        lblstatus.Caption = "Logged in as " & txtusername.Text
        cmdlogin.Enabled = False
        Call SaveSetting("Violent_J's neopets login", "Login", "Username", txtusername.Text)
        Call SaveSetting("Violent_J's neopets login", "Login", "Password", txtpassword.Text)

    End If
End Sub

If InStrB(1, strHTML, "<a href=" & ChrW$(34) & "/loginpage.phtml" & ChrW$(34) & "><b>Login to Neopets!</b></a>") And chklogin.Value = Checked Then
            txtlog.Text = txtlog & vbNewLine & Time & " : Logged out of " & txtusername.Text & ", logging back in!"
            cmdstop_Click
            cmdstop.Enabled = False
            cmdstart.Enabled = False
            lblstatus.Caption = "Idle.."
            cmdlogin.Enabled = True
            Login_to_neopets
In this program, I used a text box as a log so you may have to edit this for a listbox.
I made the "automatically log in when logged out" a feature called "chklogin"

You may edit this if you like to fit your code etc.
This is just the basic gist of it as I am sure there is a more "proper and efficient" way of doing it.
__________________
  Reply With Quote

 
Old 01-05-2009, 09:21 AM   #2 (permalink)
Full Member

Male james310 is offline
 
james310's Avatar
 
Join Date: Jan 2009
Location: Somewhere, who knos maybe I'm behind you o.O
Posts: 121
GPoints: 1,729
iTrader: 0 / 0%
james310 Is a New Face in Town
Rep Power: 4
looks good, but how do I make it auto log back in for gaia?
srry bearly learning programin =P
  Reply With Quote

 
Old 01-05-2009, 09:27 AM   #3 (permalink)
Full Member

Male iceydefeat is offline
 
iceydefeat's Avatar
 
Join Date: Dec 2008
Location: Maryland
Age: 21
Posts: 911
GPoints: 12,316
iTrader: 6 / 100%
iceydefeat Is a Party Captainiceydefeat Is a Party Captainiceydefeat Is a Party Captain
Rep Power: 8
Please don't get angry, I'm just posting how I do it for comparision purposes.
Code:
Private Type LoginInformation
    Username As String
    Password As String
End Type

Dim User As LoginInformation

Private Sub cmdLogin_Click()
    If Login(txtUsername.Text, txtPassword.Text) Then
        SaveSetting "AutoTrainer", "Login", "Username", txtUsername
        SaveSetting "AutoTrainer", "Login", "Password", txtPassword
        
        User.Username = txtUsername.Text
        User.Password = txtPassword.Text
    End If
End Sub

Public Function IsLoggedIn(ByVal strHtml) As Boolean
IsLoggedIn = False

    Status.SimpleText = "Status: Determining if Logged In!"

    If InStr(1, strHtml, "<b>Login to Neopets!</b>") = 0 Then IsLoggedIn = True

End Function

''''''''''Main Sub Code'''''''''''''''''''''''
If Not IsLoggedIn(DPage) Then
    If Login(User.Username, User.Password) = False Then
        Status.SimpleText = "Status: Failed to relogon!"
        Status2.SimpleText = "Status: Currently Training []"
        bolStop = True
        Exit Sub
    End If
End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Btw, I like how you save your settings. Makes it more programming dependent. Neat idea!
  Reply With Quote

 
Old 01-05-2009, 09:37 AM   #4 (permalink)
Full Member

Male james310 is offline
 
james310's Avatar
 
Join Date: Jan 2009
Location: Somewhere, who knos maybe I'm behind you o.O
Posts: 121
GPoints: 1,729
iTrader: 0 / 0%
james310 Is a New Face in Town
Rep Power: 4
Quote:
Originally Posted by iceydefeat View Post
Please don't get angry, I'm just posting how I do it for comparision purposes.
Code:
Private Type LoginInformation
    Username As String
    Password As String
End Type

Dim User As LoginInformation

Private Sub cmdLogin_Click()
    If Login(txtUsername.Text, txtPassword.Text) Then
        SaveSetting "AutoTrainer", "Login", "Username", txtUsername
        SaveSetting "AutoTrainer", "Login", "Password", txtPassword
        
        User.Username = txtUsername.Text
        User.Password = txtPassword.Text
    End If
End Sub

Public Function IsLoggedIn(ByVal strHtml) As Boolean
IsLoggedIn = False

    Status.SimpleText = "Status: Determining if Logged In!"

    If InStr(1, strHtml, "<b>Login to Neopets!</b>") = 0 Then IsLoggedIn = True

End Function

''''''''''Main Sub Code'''''''''''''''''''''''
If Not IsLoggedIn(DPage) Then
    If Login(User.Username, User.Password) = False Then
        Status.SimpleText = "Status: Failed to relogon!"
        Status2.SimpleText = "Status: Currently Training []"
        bolStop = True
        Exit Sub
    End If
End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Btw, I like how you save your settings. Makes it more programming dependent. Neat idea!
So I just change a few things to this and I can make it login to gaia?
also like ur pic, I saw that family guy episode lol
  Reply With Quote

 
Old 01-05-2009, 09:39 AM   #5 (permalink)
Full Member

Male iceydefeat is offline
 
iceydefeat's Avatar
 
Join Date: Dec 2008
Location: Maryland
Age: 21
Posts: 911
GPoints: 12,316
iTrader: 6 / 100%
iceydefeat Is a Party Captainiceydefeat Is a Party Captainiceydefeat Is a Party Captain
Rep Power: 8
hmmm. Ya, but it would be a complete change, as with Violent's. I don't know gaia well enough
  Reply With Quote

 
Old 01-05-2009, 09:40 AM   #6 (permalink)
G3
I don't never troll

G3 is offline
 
G3's Avatar
 
Join Date: Jun 2009
Location: live? wut.
Posts: 6,919
GPoints: 16,936
iTrader: 0 / 0%
G3 Is MANLYYYYYYYG3 Is MANLYYYYYYYG3 Is MANLYYYYYYYG3 Is MANLYYYYYYYG3 Is MANLYYYYYYYG3 Is MANLYYYYYYYG3 Is MANLYYYYYYYG3 Is MANLYYYYYYYG3 Is MANLYYYYYYYG3 Is MANLYYYYYYY
Rep Power: 30
Quote:
Originally Posted by james310 View Post
So I just change a few things to this and I can make it login to gaia?
also like ur pic, I saw that family guy episode lol
Like using brain? [VB6] How to make a Gaia Login
  Reply With Quote

 
Old 01-05-2009, 09:42 AM   #7 (permalink)
Full Member

Male iceydefeat is offline
 
iceydefeat's Avatar
 
Join Date: Dec 2008
Location: Maryland
Age: 21
Posts: 911
GPoints: 12,316
iTrader: 6 / 100%
iceydefeat Is a Party Captainiceydefeat Is a Party Captainiceydefeat Is a Party Captain
Rep Power: 8
oooo. Nice tut G3
  Reply With Quote

 
Old 01-05-2009, 09:48 AM   #8 (permalink)
Full Member

Male james310 is offline
 
james310's Avatar
 
Join Date: Jan 2009
Location: Somewhere, who knos maybe I'm behind you o.O
Posts: 121
GPoints: 1,729
iTrader: 0 / 0%
james310 Is a New Face in Town
Rep Power: 4
I was acutally wondering something else but thx G3 the tut is really good, it'll be the first program I make =)
  Reply With Quote
Reply

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


Powered by vBadvanced CMPS v3.1.0

All times are GMT -7. The time now is 04:58 AM.


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.15073609 seconds (100.00% PHP - 0% MySQL) with 21 queries