Results 1 to 1 of 1

Thread: [VB6] 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] Gormball Autoplayer

    My second Neopets program. May be a little sloppy though. It uses Glurak's Wrapper but can easily be converted to RipperWrapper.

    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"
    'grabs a unique code that is sent in the POST data
    'may cause a bug after a few games which causes the program not to work
    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)
    'the number of moves also needs to be sent
    lbllastmove.Caption = Val(lbllastmove.Caption) + 1
    MSToWait (Rand(txtwait1.Text, txtwait2.Text))
    If InStr(1, strHTML, "Your Move") Then
    lbllastchar.Caption = ("You")
    'waits 1 second to throw the ball every time
    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
    'I don't know if the bored check really works
    'I just put that in there in good hopes that it does work :P
    If InStr(1, strHTML, "Bored") Then
    StopProgram = True
    lststatus.AddItem ("Pet bored. Stopping.")
    End If
    Loop Until StopProgram = True
    End Sub

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

    5252 (01-08-2012),Evelsaint (01-29-2012),Miguel (12-26-2011)

Posting Permissions

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