Results 1 to 8 of 8

Thread: [VB6] Neopets Gormball Autoplayer

  1. #1
    Reemer's Avatar
    Joined
    Dec 2011
    Posts
    639
    Userbars
    8
    Thanks
    364
    Thanked
    446/256
    DL/UL
    39/0
    Mentioned
    203 times
    Time Online
    4d 13h 47m
    Avg. Time Online
    1m

    [VB6] Neopets Gormball Autoplayer

    My VERY first actual program. Not my best work, but it sorta works. If you can figure out why it stops APing randomly, more power to ya.

    Code:
    Private Sub cmdstart_Click()
    
    Dim strwinNP As String
    Dim strWinItem As String
    Dim strLast As String
    Dim strXCN0 As String
    Dim strxplode As String
    Dim strChar As String
    Dim strRand As String
    Dim strLastChar As String
    Dim strLastMove As String
    
    StopProgram = False
    cmdstart.Enabled = False
    cmdStop.Enabled = True
    lblstatus.Caption = "Grabbing XCN"
    strHTML = Wrapper1.GetWrapper("http://www.neopets.com/space/gormball.phtml")
    strXCN0 = GetStringBetween(strHTML, "type='hidden' name='xcn' value='", "'>")
    lblstatus.Caption = "Grabbed XCN. Starting game."
    MSToWait (Rand(txtwait1.Text, txtwait2.Text))
    lblstatus.Caption = "Playing Gormball."
    strHTML = Wrapper1.GetWrapper("http://www.neopets.com/space/gormball.phtml")
    MSToWait (Rand(txtwait1.Text, txtwait2.Text))
    strRand = Rand(1, 9)
    strHTML = Wrapper1.PostWrapper("http://www.neopets.com/space/gormball2.phtml", "xcn=" & strXCN0 & "&player_backed=" & strRand, "http://www.neopets.com/space/gormball.phtml")
    If strRand = 1 Then strChar = ("Thyassa")
    If strRand = 2 Then strChar = ("Brian")
    If strRand = 3 Then strChar = ("Gargarox")
    If strRand = 4 Then strChar = ("Farvin III")
    If strRand = 5 Then strChar = ("Ember")
    If strRand = 6 Then strChar = ("Zargrold")
    If strRand = 7 Then strChar = ("Ursula")
    If strRand = 8 Then strChar = ("Kevin")
    Do
    If Val(lblgamesplayed.Caption) >= Val(txtmaxgames.Text) Then StopProgram = True
    strLastChar = (GetStringBetween(strHTML, "name='last_character' value='", "'><input type='submit"))
    lbllastchar.Caption = (strLastChar)
    lbllastmove.Caption = Val(lbllastmove.Caption) + 1
    MSToWait (Rand(txtwait1.Text, txtwait2.Text))
    If InStr(1, strHTML, "Your Move") Then
    lbllastchar.Caption = ("You")
    strHTML = Wrapper1.PostWrapper("http://www.neopets.com/space/gormball2.phtml", "type=moveon" & "&pagecount=" & lbllastmove.Caption & "&xcn=" & strXCN0 & "&turns_waited=1" & "&last_character=You", "http://www.neopets.com/space/gormball.phtml")
    Else
    strHTML = Wrapper1.PostWrapper("http://www.neopets.com/space/gormball2.phtml", "type=moveon" & "&pagecount=" & lbllastmove.Caption & "&xcn=" & strXCN0 & "&last_character=" & (strLastChar), "http://www.neopets.com/space/gormball2.phtml")
    End If
    If InStr(1, strHTML, "<br><b>Your Prize : ") Then
    strwinNP = (GetStringBetween(strHTML, "(x4 = ", " points)</b><br>(you win that many Neopoints!)"))
    strWinItem = (GetStringBetween(strHTML, "<br><b>Your Prize : ", "</b><p><img src='http://images.neopets.com/"))
    lststatus.AddItem ("Won the game! Gained " & (strwinNP) & "NP and " & (strWinItem))
    strHTML = Wrapper1.GetWrapper("http://www.neopets.com/space/gormball.phtml", "http://www.neopets.com/space/gormball2.phtml")
    lblgamesplayed.Caption = Val(lblgamesplayed.Caption) + 1
    lbllastmove.Caption = 0
    MSToWait (Rand(txtwait1.Text, txtwait2.Text))
    strRand = Rand(1, 9)
    strHTML = Wrapper1.PostWrapper("http://www.neopets.com/space/gormball2.phtml", "xcn=" & strXCN0 & "&player_backed=" & strRand, "http://www.neopets.com/space/gormball.phtml")
    If strRand = 1 Then strChar = ("Thyassa")
    If strRand = 2 Then strChar = ("Brian")
    If strRand = 3 Then strChar = ("Gargarox")
    If strRand = 4 Then strChar = ("Farvin III")
    If strRand = 5 Then strChar = ("Ember")
    If strRand = 6 Then strChar = ("Zargrold")
    If strRand = 7 Then strChar = ("Ursula")
    If strRand = 8 Then strChar = ("Kevin")
    lblchar.Caption = (strChar)
    End If
    If InStr(1, strHTML, "The Gormball explodes") Then
    strxplode = GetStringBetween(strHTML, "The Gormball Explodes on ", "!!!")
    lststatus.AddItem ("The Gormball explodes on " & strxplode & "!!!")
    End If
    If InStr(1, strHTML, "Oh dear, you are out of the game") Then
    strwinNP = GetStringBetween(strHTML, "game :(  You scored <b>", "</b> points! (and gain")
    lststatus.AddItem ("Lost the game and gained " & strwinNP & "NP")
    lbllastmove.Caption = 0
    lblgamesplayed.Caption = Val(lblgamesplayed.Caption) + 1
    strHTML = Wrapper1.GetWrapper("http://www.neopets.com/space/gormball.phtml", "http://www.neopets.com/space/gormball2.phtml")
    MSToWait (Rand(txtwait1.Text, txtwait2.Text))
    strRand = Rand(1, 9)
    strHTML = Wrapper1.PostWrapper("http://www.neopets.com/space/gormball2.phtml", "xcn=" & strXCN0 & "&player_backed=" & strRand, "http://www.neopets.com/space/gormball.phtml")
    If strRand = 1 Then strChar = ("Thyassa")
    If strRand = 2 Then strChar = ("Brian")
    If strRand = 3 Then strChar = ("Gargarox")
    If strRand = 4 Then strChar = ("Farvin III")
    If strRand = 5 Then strChar = ("Ember")
    If strRand = 6 Then strChar = ("Zargrold")
    If strRand = 7 Then strChar = ("Ursula")
    If strRand = 8 Then strChar = ("Kevin")
    lblchar.Caption = (strChar)
    End If
    Loop Until StopProgram = True
    End Sub
    Last edited by Reemer; 09-07-2012 at 11:29 AM. Reason: fixed forever

  2. The Following 2 Users Say Thank You to Reemer For This Useful Post:

    Evelsaint (09-05-2012),musemfire (09-05-2012)

  3. #2
    Evelsaint's Avatar
    Joined
    Dec 2011
    Posts
    1,983
    Userbars
    6
    Thanks
    261
    Thanked
    345/246
    DL/UL
    89/0
    Mentioned
    201 times
    Time Online
    7h 1m
    Avg. Time Online
    N/A
    I love this program to death. Until it stops randomly. I'm so glad you would put the code out so others could try fixing it.

    @(you need an account to see links)

  4. #3
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    13,722
    Userbars
    166
    Thanks
    5,907
    Thanked
    33,078/6,609
    DL/UL
    23/36
    Mentioned
    3,867 times
    Time Online
    563d 5h 38m
    Avg. Time Online
    3h 13m
    I would debug this, add to a textbox a unique message for each time you "stopTheProgram" or whatever is triggering it to stop.
    (you need an account to see links)
    (you need an account to see links)(you need an account to see links)

    ------------------------
    [02/24/2013] Stealth CORE is made into the first standalone Neopets auto-player.
    ------------------------


  5. #4
    Zachafer's Avatar
    Joined
    Dec 2011
    Posts
    1,235
    Userbars
    11
    Thanks
    769
    Thanked
    1,466/678
    DL/UL
    98/0
    Mentioned
    512 times
    Time Online
    24d 13h 9m
    Avg. Time Online
    8m
    Code:
    If InStr(1, strHTML, "Bored") Then
    Use something more specific as the stopping trigger.

  6. The Following 2 Users Say Thank You to Zachafer For This Useful Post:

    John (09-07-2012),Reemer (09-07-2012)

  7. #5
    Reemer's Avatar
    Joined
    Dec 2011
    Posts
    639
    Userbars
    8
    Thanks
    364
    Thanked
    446/256
    DL/UL
    39/0
    Mentioned
    203 times
    Time Online
    4d 13h 47m
    Avg. Time Online
    1m
    Quote Originally Posted by Zachafer View Post
    Code:
    If InStr(1, strHTML, "Bored") Then
    Use something more specific as the stopping trigger.
    I never even expected that to work. I didn't want to play Gormball until my pet was bored. You fix it if you want.

  8. #6
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    13,722
    Userbars
    166
    Thanks
    5,907
    Thanked
    33,078/6,609
    DL/UL
    23/36
    Mentioned
    3,867 times
    Time Online
    563d 5h 38m
    Avg. Time Online
    3h 13m
    Oh wow. No wonder it randomly stopped. Your pet randomly says stuff, and sometimes it will say something like "blabla bored". Nice one @(you need an account to see links).
    (you need an account to see links)
    (you need an account to see links)(you need an account to see links)

    ------------------------
    [02/24/2013] Stealth CORE is made into the first standalone Neopets auto-player.
    ------------------------


  9. #7
    Reemer's Avatar
    Joined
    Dec 2011
    Posts
    639
    Userbars
    8
    Thanks
    364
    Thanked
    446/256
    DL/UL
    39/0
    Mentioned
    203 times
    Time Online
    4d 13h 47m
    Avg. Time Online
    1m
    All makes sense now. Garbage in, garbage out.

    ---------- Post added at 11:35 AM ---------- Previous post was at 11:15 AM ----------

    What's the proper way to check for a bored pet then?

    ---------- Post added at 11:46 AM ---------- Previous post was at 11:35 AM ----------

    Took that part out, still randomly stops. Maybe someone should just make a new one, shouldn't be that hard. I just don't have the time nowadays.

  10. #8

    Joined
    Jun 2012
    Posts
    1,699
    Thanks
    876
    Thanked
    2,881/1,142
    DL/UL
    44/1
    Mentioned
    562 times
    Time Online
    118d 6h 45m
    Avg. Time Online
    40m
    You should learn how to debug your apps with breakpoints you would of found this bug easily.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •