Results 1 to 13 of 13
  1. #1
    sockopen's Avatar
    Join Date
    Jan 2006
    Posts
    14
    Reputation
    10
    Thanks
    0

    Neopets - NeoQuest II Trainer

    This uses an HTTPWrapper, similarly to the one I posted. All of this was written by myself.

    Code:
    Option Explicit
    
    Private Type typHealthArray
        strHealth As String
        strMHealth As String
    End Type
    
    Dim Dpage As String, DBpage As String, varMisc As String, nxActor As String, i As Integer, theTarget As Integer
    Dim StopTheProgram As Boolean, RohaneDied As Boolean, usedPotion As Boolean, actPotion As Integer, actCharacter As String
    Dim HealthMissing As Integer, MHealthMissing As Integer, THealthMissing As Integer, VHealthMissing As Integer
    
    Public Function NQFight()
        Status.Caption = "Starting Fight!"
        Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "start=1", "https://neopets.com/games/nq2/nq2.phtml")
        Do
            UpdateHealth
            If InStrB(1, UCase(Dpage), UCase("https://images.neopets.com/nq2/x/com_atk.gif")) <> 0 Then
                For i = 5 To 8
                    If InStrB(1, Dpage, "<A href=" & Chr(34) & "javascript:;" & Chr(34) & " onClick=" & Chr(34) & "settarget(" & i) <> 0 Then
                        theTarget = i
                        Exit For
                    End If
                Next i
                UpdateHealth
                If InStrB(1, Dpage, "<FONT color=" & Chr(34) & "red" & Chr(34) & ">Rohane</FONT><BR>") <> 0 Then
                    Potions "R", HealthMissing
                    If usedPotion = False Then
                        Status.Caption = "Rohane attacks the opponent!"
                        Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=" & theTarget & "&fact=3&parm=&use_id=-1&nxactor=1", "https://neopets.com/games/nq2/nq2.phtml")
                    End If
                ElseIf InStrB(1, Dpage, "<FONT color=" & Chr(34) & "red" & Chr(34) & ">Mipsy</FONT><BR>") <> 0 Then
                    Potions "M", MHealthMissing
                    If usedPotion = False Then
                        Status.Caption = "Mipsy uses Direct Damage!"
                        Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=" & theTarget & "&fact=9201&parm=&use_id=-1&nxactor=2", "https://neopets.com/games/nq2/nq2.phtml")
                    End If
                ElseIf InStrB(1, Dpage, "<FONT color=" & Chr(34) & "red" & Chr(34) & ">Talinia</FONT><BR>") <> 0 Then
                    Potions "T", THealthMissing
                    If usedPotion = False Then
                        Status.Caption = "Talinia sprays arrows!"
                        Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=" & theTarget & "&fact=9302&parm=&use_id=-1&nxactor=3", "https://neopets.com/games/nq2/nq2.phtml")
                        If InStrB(1, UCase(Dpage), UCase("you must wait a few more seconds before using")) <> 0 Then
                            Status.Caption = "Talinia attacks the opponent!"
                            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=" & theTarget & "&fact=3&parm=&use_id=-1&nxactor=3", "https://neopets.com/games/nq2/nq2.phtml")
                        End If
                    End If
                ElseIf InStrB(1, Dpage, "<FONT color=" & Chr(34) & "red" & Chr(34) & ">Velm</FONT><BR>") <> 0 Then
                    Status.Caption = "Velm Group Heals!"
                    Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=9402&parm=&use_id=-1&nxactor=4", "https://neopets.com/games/nq2/nq2.phtml")
                End If
                If InStrB(1, UCase(Dpage), UCase("https://images.neopets.com/nq2/x/com_end.gif")) <> 0 Then Exit Do
                UpdateHealth
            ElseIf InStrB(1, UCase(Dpage), UCase("https://images.neopets.com/nq2/x/com_next.gif")) <> 0 Then
                UpdateHealth
                Status.Caption = "Opponent(s) attacks back!"
                If InStrB(1, Dpage, Chr(34) & "nxactor" & Chr(34) & " value=") <> 0 Then nxActor = GetBetween(Dpage, Chr(34) & "nxactor" & Chr(34) & " value=" & Chr(34), Chr(34))
                Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=1&parm=&use_id=-1&nxactor=" & nxActor, "https://neopets.com/games/nq2/nq2.phtml")
                If InStrB(1, UCase(Dpage), UCase("https://images.neopets.com/nq2/x/com_end.gif")) <> 0 Then Exit Do
                UpdateHealth
            ElseIf InStrB(1, UCase(Dpage), UCase("https://images.neopets.com/nq2/x/com_end.gif")) <> 0 Then Exit Do
            Else
                Status.Caption = "Reloading Page..."
                Dpage = HTTPWrapper.GetWrapper("https://neopets.com/games/nq2/nq2.phtml?", "https://neopets.com/games/nq2/nq2.phtml")
                UpdateHealth
            End If
            If InStrB(1, UCase(Dpage), UCase("https://images.neopets.com/nq2/x/com_end.gif")) <> 0 Then Exit Do
        Loop
        Status.Caption = "Finishing Fight..."
        Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=2&parm=&use_id=-1&nxactor=1", "https://neopets.com/games/nq2/nq2.phtml")
        If InStrB(1, Dpage, "You lost the fight") <> 0 Then ' "You lost"
            RohaneDied = True
            Status.Caption = "Lost the Fight"
        End If
        Status.Caption = "Won the Fight"
        Dpage = HTTPWrapper.GetWrapper("https://neopets.com/games/nq2/nq2.phtml?finish=1", "https://neopets.com/games/nq2/nq2.phtml")
    End Function
    
    Private Sub cmdStop_Click()
        StopTheProgram = True
    End Sub
    
    Private Sub Form_Terminate()
        End
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        End
    End Sub
    
    Private Sub StartNQ2_Click()
    Dpage = HTTPWrapper.GetWrapper("https://neopets.com/games/nq2/nq2.phtml", HTTPWrapper.LastPage)
    
    If InStrB(1, Dpage, "You are in the village ") <> 0 Then
        Status.Caption = "Leave the Village First"
    Else
        fraStart.Visible = False
        fraStop.Visible = True
        Status.Caption = "Starting Game Up..."
        HTTPWrapper.GetWrapper "https://www.neopets.com/games/nq2/nq2.phtml", "https://www.neopets.com/games/nq2/nq2.phtml"
        HTTPWrapper.GetWrapper "https://www.neopets.com/games/nq2/nq2.phtml?startgame=1", HTTPWrapper.LastPage
        Status.Caption = "Changing to Hunting Mode..."
        Dpage = HTTPWrapper.PostWrapper("https://www.neopets.com/games/nq2/nq2.phtml", "act=travel&mode=2", "https://www.neopets.com/games/nq2/nq2.phtml")
        Dpage = HTTPWrapper.GetWrapper("https://www.neopets.com/games/nq2/nq2.phtml", "https://www.neopets.com/games/nq2/nq2.phtml")
        If InStrB(1, Dpage, "Rohane") <> 0 Then
            Training
        Else
            Status.Caption = "Couldn't Start Game... Try Again"
            fraStart.Visible = True
            fraStop.Visible = False
        End If
    End If
    End Sub
    
    Public Function Training()
        StopTheProgram = False
        RohaneDied = False
        Do Until StopTheProgram = True Or RohaneDied = True
            Status.Caption = "Searching for Opponents"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "act=move&dir=3", "https://neopets.com/games/nq2/nq2.phtml")
            If InStrB(1, UCase(Dpage), UCase("You are attacked")) <> 0 Then
                NQFight
            End If
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "act=move&dir=4", "https://neopets.com/games/nq2/nq2.phtml")
            If InStrB(1, UCase(Dpage), UCase("You are attacked")) <> 0 Then
                NQFight
            End If
        Loop
        If StopTheProgram = True Then
            Status.Caption = "Training has Stopped"
        ElseIf RohaneDied = True Then
            Status.Caption = "You have been Defeated"
            RHealth.Text = RMHealth.Text
            MHealth.Text = MMHealth.Text
            THealth.Text = TMHealth.Text
            VHealth.Text = VMHealth.Text
        End If
        fraStart.Visible = True
        fraStop.Visible = False
    End Function
    
    Public Function UpdateHealth()
    DBpage = Dpage
    Dim tempHealth As typHealthArray
        tempHealth = CheckHealth("Rohane")
        If Len(tempHealth.strHealth) > 0 And Len(tempHealth.strMHealth) > 0 Then
            RHealth.Text = tempHealth.strHealth
            RMHealth.Text = tempHealth.strMHealth
            HealthMissing = Val(RMHealth.Text) - Val(RHealth.Text)
        End If
        tempHealth = CheckHealth("Mipsy")
        If Len(tempHealth.strHealth) > 0 And Len(tempHealth.strMHealth) > 0 Then
            MHealth.Text = tempHealth.strHealth
            MMHealth.Text = tempHealth.strMHealth
            MHealthMissing = Val(MMHealth.Text) - Val(MHealth.Text)
        End If
        tempHealth = CheckHealth("Talinia")
        If Len(tempHealth.strHealth) > 0 And Len(tempHealth.strMHealth) > 0 Then
            THealth.Text = tempHealth.strHealth
            TMHealth.Text = tempHealth.strMHealth
            THealthMissing = Val(TMHealth.Text) - Val(THealth.Text)
        End If
        tempHealth = CheckHealth("Velm")
        If Len(tempHealth.strHealth) > 0 And Len(tempHealth.strMHealth) > 0 Then
            VHealth.Text = tempHealth.strHealth
            VMHealth.Text = tempHealth.strMHealth
            VHealthMissing = Val(VMHealth.Text) - Val(VHealth.Text)
        End If
    End Function
    
    Private Function CheckHealth(ByVal strPlayer As String) As typHealthArray
    Dim arrColour(1 To 3) As String, intColourCount As Integer
        arrColour(1) = "green"
        arrColour(2) = "#d0d000"
        arrColour(3) = "red"
        varMisc = ""
        CheckHealth.strHealth = 0
        CheckHealth.strMHealth = 0
        For intColourCount = LBound(arrColour) To UBound(arrColour)
            If InStrB(1, DBpage, strPlayer) <> 0 Then
                If InStrB(1, DBpage, strPlayer & "<BR><TABLE><TR><TD><FONT color=" & Chr(34) & arrColour(intColourCount) & Chr(34) & ">") <> 0 Then
                    varMisc = "-" & GetBetween(DBpage, strPlayer & "<BR><TABLE><TR><TD><FONT color=" & Chr(34) & arrColour(intColourCount) & Chr(34) & ">", "</FONT>") & "+"
                    Exit For
                ElseIf InStrB(1, DBpage, strPlayer & "</B></FONT><BR><TABLE><TR><TD><FONT color=" & Chr(34) & arrColour(intColourCount) & Chr(34) & ">") <> 0 Then
                    varMisc = "-" & GetBetween(DBpage, strPlayer & "</B></FONT><BR><TABLE><TR><TD><FONT color=" & Chr(34) & arrColour(intColourCount) & Chr(34) & ">", "</FONT>") & "+"
                    Exit For
                End If
            Else
                Exit For
            End If
        Next intColourCount
        If Len(varMisc) > 0 Then
            If InStrB(1, varMisc, "<") = 0 Then
                CheckHealth.strHealth = GetBetween(varMisc, "-", "/")
                CheckHealth.strMHealth = GetBetween(varMisc, "/", "+")
            End If
            DBpage = GetBetween(DBpage, CheckHealth.strHealth & "/" & CheckHealth.strMHealth, "</html") & "</html"
        End If
    End Function
    
    Public Function Potions(inChar As String, inMissing As Integer)
        usedPotion = True
        If inChar = "R" Then
            actPotion = 1
            actCharacter = "Rohane"
        ElseIf inChar = "M" Then
            actPotion = 2
            actCharacter = "Mipsy"
        ElseIf inChar = "T" Then
            actPotion = 3
            actCharacter = "Talinia"
        End If
        If inMissing >= 130 And InStrB(1, Dpage, ">Stamina Potion<") <> 0 Then
            Status.Caption = actCharacter & " uses a Stamina Potion"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30042&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        ElseIf inMissing >= 120 And InStrB(1, Dpage, ">Vitality Potion<") <> 0 Then
            Status.Caption = actCharacter & " uses a Vitality Potion"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30041&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        ElseIf inMissing >= 110 And InStrB(1, Dpage, ">Potion of Abundant Health<") <> 0 Then
            Status.Caption = actCharacter & " uses a Potion of Abundant Health"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30033&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        ElseIf inMissing >= 100 And InStrB(1, Dpage, ">Potion of Greater Health<") <> 0 Then
            Status.Caption = actCharacter & " uses a Potion of Greater Health"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30032&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        ElseIf inMissing >= 90 And InStrB(1, Dpage, ">Potion of Potent Health<") <> 0 Then
            Status.Caption = actCharacter & " uses a Potion of Potent Health"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30031&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        ElseIf inMissing >= 80 And InStrB(1, Dpage, ">Potion of Growth<") <> 0 Then
            Status.Caption = actCharacter & " uses a Potion of Growth"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30023&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        ElseIf inMissing >= 70 And InStrB(1, Dpage, ">Potion of Fortitude<") <> 0 Then
            Status.Caption = actCharacter & " uses a Potion of Fortitude"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30022&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        ElseIf inMissing >= 60 And InStrB(1, Dpage, ">Potion of Regeneration<") <> 0 Then
            Status.Caption = actCharacter & " uses a Potion of Regeneration"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30021&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        ElseIf inMissing >= 50 And InStrB(1, Dpage, ">Healing Bottle<") <> 0 Then
            Status.Caption = actCharacter & " uses a Healing Bottle"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30014&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        ElseIf inMissing >= 35 And InStrB(1, Dpage, ">Healing Potion<") <> 0 Then
            Status.Caption = actCharacter & " uses a Healing Potion"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30013&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        ElseIf inMissing >= 25 And InStrB(1, Dpage, ">Healing Flask<") <> 0 Then
            Status.Caption = actCharacter & " uses a Healing Flask"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30012&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        ElseIf inMissing >= 15 And InStrB(1, Dpage, ">Healing Vial<") <> 0 Then
            Status.Caption = actCharacter & " uses a Healing Vial"
            Dpage = HTTPWrapper.PostWrapper("https://neopets.com/games/nq2/nq2.phtml", "target=-1&fact=5&parm=&use_id=30011&nxactor=" & actPotion, "https://neopets.com/games/nq2/nq2.phtml")
        Else
            usedPotion = False
        End If
    End Function

  2. #2
    Beer_Hunter's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Location
    The Beer Kingdom
    Posts
    1,797
    Reputation
    60
    Thanks
    218
    what does it do exactly?
    HAVE YOU FORGOTTEN THE 25th??? WE HAVEN'T!
    Quote Originally Posted by arunforce View Post
    Timebeast wanted perma since he can't flame anymore.
    LMAO...
    [IMG]https://i76.photobucke*****m/albums/j2/The_Enigma_photos/geistHunter.gif[/IMG]
    [IMG]https://i10.photobucke*****m/albums/a141/popsumbong/BEERHUNTER.gif[/IMG]
    Teh Beer Seeker


    Obviously the best impersonation of David Hasselhoff.

  3. #3
    EleMentX's Avatar
    Join Date
    Jan 2006
    Location
    de_dust2
    Posts
    3,451
    Reputation
    12
    Thanks
    591
    iunno helps neopets which is lame lol
    its not quite our thing haha (we need GunZ stuff lol)

  4. #4
    ClapBangKiss's Avatar
    Join Date
    Feb 2006
    Gender
    male
    Posts
    2,119
    Reputation
    3
    Thanks
    722
    My Mood
    Asleep
    Lol's Noobs will ask what the fuck is this?

  5. #5
    Duagang's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Posts
    72
    Reputation
    10
    Thanks
    32
    err... no link?

  6. #6
    EleMentX's Avatar
    Join Date
    Jan 2006
    Location
    de_dust2
    Posts
    3,451
    Reputation
    12
    Thanks
    591
    1. wot it do
    2. where u put the stuff
    3. wot it do
    4. annd is it cool
    5. lolz
    6. smelly poo
    7. im EleMentX RUUN FOR URR FRIGGEN LIVES (its gunna rape u)
    8. KAIOKEIOJAKIJAKIYABAYABA

  7. #7
    Skurdz's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Posts
    162
    Reputation
    10
    Thanks
    22
    My Mood
    Bored
    no1 wants to reply from after what u said :O :O :O



  8. #8
    EleMentX's Avatar
    Join Date
    Jan 2006
    Location
    de_dust2
    Posts
    3,451
    Reputation
    12
    Thanks
    591
    rofl good!!

  9. #9
    SadisticGrin's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Location
    Behind you.
    Posts
    1,428
    Reputation
    10
    Thanks
    125
    I Love Neopets! *vomits rainbows*
    [CENTER]
    The Grin is in.
    [IMG]https://i33.photobucke*****m/albums/d74/sadisticgrin/The-grincopy.png[/IMG]
    I AM the Influence.

  10. #10
    Bull3t's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Location
    England
    Posts
    1,527
    Reputation
    5
    Thanks
    162
    Neopets is the game of the future...





  11. #11
    Jackal's Avatar
    Join Date
    Feb 2006
    Location
    The Rooftops
    Posts
    1,096
    Reputation
    14
    Thanks
    135
    and What a bleak, dark future it is.

  12. #12
    Ephemera's Avatar
    Join Date
    Jun 2007
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    0
    It's only for the intelligent people... I guess I'm stupid

  13. #13
    MS Word's Avatar
    Join Date
    Jun 2007
    Gender
    male
    Posts
    483
    Reputation
    11
    Thanks
    2
    omg stop wrapping those old threads!