[VB6] Icy AAer Source

Discussion in 'Code Snippets and Tutorials' started by Josh21227, Jun 17, 2010.

  1. Josh21227

    Josh21227 Level I

    Joined:
    May 23, 2009
    Messages:
    57
    Likes Received:
    10
    Always debated releasing the source since this took me awhile to do. Some of it should be done other ways, but whatever. Download at the bottom.

    frmmain -
    Code (Text):
    1. Dim strhtml As String, petname1 As String, petname2 As String, petname3 As String, petspecies1 As String, petspecies2 As String, petspecies3 As String, petcolor1 As String, petcolor2 As String, petcolor3 As String, status As String, nps As String, activepet As String, petdef1 As String, petdef2 As String, petdef3 As String, petstr1 As String, petstr2 As String, petstr3 As String, petlev1 As String, petlev2 As String, petlev3 As String, specificcolor As String, specificspecies As String
    2.  
    3.  
    4. Public Function Random(Lowerbound As Long, Upperbound As Long)
    5.     Randomize
    6.     Random = Int(Rnd * Upperbound) + Lowerbound
    7. End Function
    8.  
    9. Private Sub addcolor_Click()
    10.     lstcolor.AddItem "" & txtcolor.Text
    11.     txtcolor.Text = ""
    12. End Sub
    13.  
    14. Private Sub addpetpet_Click()
    15.     lstpetpet.AddItem "" & txtpetpet.Text
    16.     txtpetpet.Text = ""
    17. End Sub
    18.  
    19. Private Sub addspecies_Click()
    20.     lstspecies.AddItem "" & txtspecies.Text
    21.     txtspecies.Text = ""
    22. End Sub
    23.  
    24.  
    25. Private Sub addspecific_Click()
    26.         lstspecific.AddItem "" & txtspecific.Text
    27.     txtspecific.Text = ""
    28.    
    29.  
    30. End Sub
    31.  
    32. Private Sub chkstr_Click()
    33.     If chkstr.Value = 1 Then
    34.         txtinstr.Enabled = True
    35.     Else
    36.         txtinstr.Enabled = False
    37.     End If
    38. End Sub
    39.  
    40. Public Function statsaaer(petname As String, petlev As String, petdef As String, petstr As String)
    41.     If chkstats.Value = 1 Then
    42.         If chkin.Value = 1 Then
    43.             If chklev.Value = 1 Then
    44.                 If petlev >= txtinlev.Text Then
    45.                     strhtml = w.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & petname, "http://www.neopets.com/pound/adopt.phtml")
    46.                     If InStr(strhtml, "You already have four Neopets") Then
    47.                         logs.AddItem "Reached max pets"
    48.                         status = "stop"
    49.                     End If
    50.                     strhtml = w.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & txtuser.Text)
    51.                     If InStr(strhtml, petname) Then
    52.                         logs.AddItem "Adopted " & petname
    53.                     Else
    54.                         logs.AddItem "Missed " & petname
    55.                     End If
    56.                 End If
    57.             End If
    58.             If chkstr.Value = 1 Then
    59.                 If petstr >= txtinstr.Text Then
    60.                     strhtml = w.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & petname, "http://www.neopets.com/pound/adopt.phtml")
    61.                     If InStr(strhtml, "You already have four Neopets") Then
    62.                         logs.AddItem "Reached max pets"
    63.                         status = "stop"
    64.                     End If
    65.                     strhtml = w.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & txtuser.Text)
    66.                     If InStr(strhtml, petname) Then
    67.                         logs.AddItem "Adopted " & petname
    68.                     Else
    69.                         logs.AddItem "Missed " & petname
    70.                     End If
    71.                 End If
    72.             End If
    73.             If chkdef.Value = 1 Then
    74.                 If petdef >= txtindef.Text Then
    75.                     strhtml = w.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & petname, "http://www.neopets.com/pound/adopt.phtml")
    76.                     If InStr(strhtml, "You already have four Neopets") Then
    77.                         logs.AddItem "Reached max pets"
    78.                         status = "stop"
    79.                     End If
    80.                     strhtml = w.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & txtuser.Text)
    81.                     If InStr(strhtml, petname) Then
    82.                         logs.AddItem "Adopted " & petname
    83.                     Else
    84.                         logs.AddItem "Missed " & petname
    85.                     End If
    86.                 End If
    87.             End If
    88.         ElseIf chkde.Value = 1 Then
    89.             If petlev >= txtdelev.Text And petstr >= txtdestr.Text And petdef >= txtdedef.Text Then
    90.                 strhtml = w.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & petname, "http://www.neopets.com/pound/adopt.phtml")
    91.                 If InStr(strhtml, "You already have four Neopets") Then
    92.                     logs.AddItem "Reached max pets"
    93.                     status = "stop"
    94.                 End If
    95.                 strhtml = w.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & txtuser.Text)
    96.                 If InStr(strhtml, petname) Then
    97.                     logs.AddItem "Adopted " & petname
    98.                 Else
    99.                     logs.AddItem "Missed " & petname
    100.                 End If
    101.             End If
    102.         End If
    103.     End If
    104. End Function
    105.  
    106. Public Function coloraaer(petname As String, color As String)
    107.     For X = 0 To lstcolor.ListCount - 1
    108.         If LCase(lstcolor.list(X)) = LCase(color) Then
    109.             strhtml = w.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & petname, "http://www.neopets.com/pound/adopt.phtml")
    110.             If InStr(1, strhtml, "You already have four Neopets") Then
    111.                 logs.AddItem "Reached max pets"
    112.                 status = "stop"
    113.             End If
    114.             strhtml = w.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & txtuser.Text)
    115.             If InStr(1, strhtml, petname) Then
    116.                 logs.AddItem "Adopted " & petname
    117.             Else
    118.                 logs.AddItem "Missed " & petname
    119.             End If
    120.         End If
    121.     Next X
    122. End Function
    123. Public Function speciesaaer(petname As String, species As String)
    124.  
    125.     For X = 0 To lstspecies.ListCount - 1
    126.         If LCase(lstspecies.list(X)) = LCase(species) Then
    127.             strhtml = w.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & petname, "http://www.neopets.com/pound/adopt.phtml")
    128.             If InStr(1, strhtml, "You already have four Neopets") Then
    129.                 logs.AddItem "Reached max pets"
    130.                 status = "stop"
    131.             End If
    132.             strhtml = w.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & txtuser.Text)
    133.             If InStr(1, strhtml, petname) Then
    134.                 logs.AddItem "Adopted " & petname
    135.             Else
    136.                 logs.AddItem "Missed " & petname
    137.             End If
    138.         End If
    139.     Next X
    140. End Function
    141. Public Function specificaaer(petname As String, color As String, species As String)
    142.     For X = 0 To lstspecific.ListCount - 1
    143.         specificcolor = GB(lstspecific.list(X), " Color: ", "]")
    144.         specificspecies = GB(lstspecific.list(X), "[Species: ", " Color:")
    145.  
    146.         If LCase(specificcolor) = LCase(color) And LCase(specificspecies) = LCase(species) Then
    147.             strhtml = w.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & petname, "http://www.neopets.com/pound/adopt.phtml")
    148.             If InStr(1, strhtml, "You already have four Neopets") Then
    149.                 logs.AddItem "Reached max pets"
    150.                 status = "stop"
    151.             End If
    152.             strhtml = w.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & txtuser.Text)
    153.             If InStr(1, strhtml, petname) Then
    154.                 logs.AddItem "Adopted " & petname
    155.             Else
    156.                 logs.AddItem "Missed " & petname
    157.             End If
    158.         End If
    159.     Next X
    160. End Function
    161.  
    162. Public Function petpetaaer(petname As String)
    163.     Dim petpet As String
    164.     strhtml = w.GetWrapper("http://www.neopets.com/petlookup.phtml?pet=" & petname)
    165.     If chkmootix.Value = 1 Then
    166.         If InStr(strhtml, " and its Mootix") Then
    167.             strhtml = w.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & petname, "http://www.neopets.com/pound/adopt.phtml")
    168.             If InStr(strhtml, "You already have four Neopets") Then
    169.                 logs.AddItem "Reached max pets"
    170.                 status = "stop"
    171.             End If
    172.             strhtml = w.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & txtuser.Text)
    173.             If InStr(strhtml, petname) Then
    174.                 logs.AddItem "Adopted " & petname
    175.             Else
    176.                 logs.AddItem "Missed " & petname
    177.             End If
    178.         End If
    179.     End If
    180.     If InStr(strhtml, "has a Petpet!") Then
    181.         petpet = GB(strhtml, " has a Petpet!", "hours old")
    182.         petpet = GB(petpet, "</b> the ", "<")
    183.         If chklab.Value = 1 And InStr(strhtml, "Zapped by the Petpet Lab Ray") Then
    184.         Else
    185.             For X = 0 To lstpetpet.ListCount - 1
    186.                 If InStr(LCase(petpet), LCase(lstpetpet.list(X))) Then
    187.  
    188.                     strhtml = w.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & petname, "http://www.neopets.com/pound/adopt.phtml")
    189.                     If InStr(strhtml, "You already have four Neopets") Then
    190.                         logs.AddItem "Reached max pets"
    191.                         status = "stop"
    192.                     End If
    193.                     strhtml = w.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & txtuser.Text)
    194.                     If InStr(strhtml, petname) Then
    195.                         logs.AddItem "Adopted " & petname
    196.                     Else
    197.                         logs.AddItem "Missed " & petname
    198.                     End If
    199.                 End If
    200.             Next X
    201.         End If
    202.     End If
    203.  
    204. End Function
    205.  
    206. Public Function meukaaaer(petname As String)
    207.     strhtml = w.GetWrapper("http://www.neopets.com/petlookup.phtml?pet=" & petname)
    208.     If InStr(strhtml, "suffering from <b>Neoflu</b>") Or InStr(strhtml, "suffering from <b>Sneezles</b>") Then
    209.         strhtml = w.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & petname, "http://www.neopets.com/pound/adopt.phtml")
    210.         If InStr(strhtml, "You already have four Neopets") Then
    211.             logs.AddItem "Reached max pets"
    212.             status = "stop"
    213.         End If
    214.         strhtml = w.GetWrapper("http://www.neopets.com/userlookup.phtml?user=" & txtuser.Text)
    215.         If InStr(strhtml, petname1) Then
    216.             logs.AddItem "Adopted " & petname
    217.         Else
    218.             logs.AddItem "Missed " & petname
    219.         End If
    220.     End If
    221. End Function
    222.  
    223.  
    224. Private Sub chkde_Click()
    225.     If chkde.Value = 1 Then
    226.         chkin.Value = 0
    227.         chklev.Value = 0
    228.         chkdef.Value = 0
    229.         chkstr.Value = 0
    230.         txtdelev.Enabled = True
    231.         txtdedef.Enabled = True
    232.         txtdestr.Enabled = True
    233.         Label12.Enabled = True
    234.         Label15.Enabled = True
    235.         Label16.Enabled = True
    236.     Else
    237.         txtdelev.Enabled = False
    238.         txtdedef.Enabled = False
    239.         txtdestr.Enabled = False
    240.         Label12.Enabled = False
    241.         Label15.Enabled = False
    242.         Label16.Enabled = False
    243.     End If
    244. End Sub
    245.  
    246. Private Sub chkdef_Click()
    247.     If chkdef.Value = 1 Then
    248.         txtindef.Enabled = True
    249.     Else
    250.         txtindef.Enabled = False
    251.     End If
    252.  
    253. End Sub
    254.  
    255. Private Sub chkin_Click()
    256.     If chkin.Value = 1 Then
    257.         chkde.Value = 0
    258.         chklev.Enabled = True
    259.         chkstr.Enabled = True
    260.         chkdef.Enabled = True
    261.     Else
    262.         chklev.Enabled = False
    263.         chkstr.Enabled = False
    264.         chkdef.Enabled = False
    265.     End If
    266. End Sub
    267.  
    268. Private Sub chklev_Click()
    269.     If chklev.Value = 1 Then
    270.         txtinlev.Enabled = True
    271.     Else
    272.         txtinlev.Enabled = False
    273.     End If
    274. End Sub
    275.  
    276. Private Sub chkstats_Click()
    277.     If chkstats.Value = 1 Then
    278.         chkde.Enabled = True
    279.         chkin.Enabled = True
    280.     Else
    281.         chkde.Enabled = False
    282.         chkin.Enabled = False
    283.         chklev.Enabled = False
    284.         chkstr.Enabled = False
    285.         chkdef.Enabled = False
    286.         txtdelev.Enabled = False
    287.         txtdedef.Enabled = False
    288.         txtdestr.Enabled = False
    289.         Label12.Enabled = False
    290.         Label15.Enabled = False
    291.         Label16.Enabled = False
    292.     End If
    293. End Sub
    294.  
    295.  
    296.  
    297. Private Sub clearcolor_Click()
    298.     lstcolor.Clear
    299. End Sub
    300.  
    301. Private Sub clearpetpet_Click()
    302. lstpetpet.Clear
    303. End Sub
    304.  
    305. Private Sub clearspecies_Click()
    306.     lstspecies.Clear
    307. End Sub
    308.  
    309.  
    310.  
    311. Private Sub clearspecifc_Click()
    312.  
    313. End Sub
    314.  
    315. Private Sub clearspecific_Click()
    316. lstspecific.Clear
    317. End Sub
    318.  
    319. Private Sub cmdlogin_Click()
    320.     lblstatus.Caption = "Logging in, please wait"
    321.     strhtml = w.GetWrapper("http://www.neopets.com/index.phtml")
    322.     strhtml = ""
    323.     strhtml = w.PostWrapper("http://www.neopets.com/login.phtml", "username=" & txtuser.Text & "&password=" & txtpass.Text & "&destination=%2Fpetcentral.phtml", "http://www.neopets.com/hi.phtml")
    324.     If InStr(strhtml, "badpassword.phtml") Then
    325.         lblstatus.Caption = "Bad password"
    326.     ElseIf InStr(strhtml, "petcentral.phtml") Then
    327.         lblstatus.Caption = "Getting account information."
    328.         strhtml = w.GetWrapper("http://www.neopets.com/index.phtml")
    329.         lblaccount.Caption = txtuser.Text
    330.         If InStr(strhtml, "activePet") Then
    331.             lblactivepet.Caption = GB(strhtml, "/quickref.phtml" & ChrW$(34) & "><b>", "</b>")
    332.         Else
    333.             lblactivepet.Caption = "You have no pet? o.o"
    334.         End If
    335.         lblnps.Caption = GB(strhtml, "<a href=" & ChrW$(34) & "/objects.phtml?type=inventory" & ChrW$(34) & ">", "</a>")
    336.         lblstatus.Caption = "Logged in"
    337.     ElseIf InStr(strhtml, "FROZEN") Then
    338.  
    339.         lblstatus.Caption = "Your account, " & txtuser.Text & " , is frozen"
    340.  
    341.     Else
    342.         lblstatus.Caption = "Username Doesn't exist or Unknown Error"
    343.     End If
    344. End Sub
    345.  
    346.  
    347. Private Sub cmdstart_Click()
    348.     status = "go"
    349.     strhtml = w.GetWrapper("http://www.neopets.com/pound/index.phtml", "http://www.neopets.com/")
    350.     Do Until status = "stop"
    351.  
    352.         strhtml = w.GetWrapper("http://www.neopets.com/pound/adopt.phtml", "http://www.neopets.com/pound/index.phtml")
    353.         If InStr(strhtml, "pet_arr[0].name") Then
    354.             petname1 = GB(strhtml, "pet_arr[0].name = " & ChrW$(34), ChrW$(34))
    355.             petspecies1 = GB(strhtml, "pet_arr[0].species = " & ChrW$(34), ChrW$(34))
    356.             petcolor1 = GB(strhtml, "pet_arr[0].color = " & ChrW$(34), ChrW$(34))
    357.             petlev1 = GB(strhtml, "pet_arr[0].lev = " & ChrW$(34), ChrW$(34))
    358.             petstr1 = GB(strhtml, "pet_arr[0].str = " & ChrW$(34), ChrW$(34))
    359.             petdef1 = GB(strhtml, "pet_arr[0].def = " & ChrW$(34), ChrW$(34))
    360.             lblcurrent.Caption = petname1
    361.             If chkspecific = 1 Then
    362.                 specificaaer petname1, petcolor1, petspecies1
    363.             End If
    364.             If chkspecies = 1 Then
    365.                 speciesaaer petname1, petspecies1
    366.             End If
    367.             If chkstatistics = 1 Then
    368.                 statsaaer petname1, petlev1, petdef1, petstr1
    369.             End If
    370.             If chkcolor = 1 Then
    371.                 coloraaer petname1, petcolor1
    372.             End If
    373.             If chkpetpet = 1 Then
    374.                 petpetaaer petname1
    375.             End If
    376.             If chkmeuka.Value = 1 Then
    377.                 meukaaaer petname1
    378.             End If
    379.  
    380.         End If
    381.  
    382.         If InStr(strhtml, "pet_arr[1].name") Then
    383.             petname2 = GB(strhtml, "pet_arr[1].name = " & ChrW$(34), ChrW$(34))
    384.             petspecies2 = GB(strhtml, "pet_arr[1].species = " & ChrW$(34), ChrW$(34))
    385.             petcolor2 = GB(strhtml, "pet_arr[1].color = " & ChrW$(34), ChrW$(34))
    386.             petlev2 = GB(strhtml, "pet_arr[1].lev = " & ChrW$(34), ChrW$(34))
    387.             petstr2 = GB(strhtml, "pet_arr[1].str = " & ChrW$(34), ChrW$(34))
    388.             petdef2 = GB(strhtml, "pet_arr[1].def = " & ChrW$(34), ChrW$(34))
    389.             lblcurrent.Caption = petname2
    390.             If chkspecific = 1 Then
    391.                 specificaaer petname2, petcolor2, petspecies2
    392.             End If
    393.             If chkspecies = 1 Then
    394.                 speciesaaer petname2, petspecies2
    395.             End If
    396.             If chkstatistics = 1 Then
    397.                 statsaaer petname2, petlev2, petdef2, petstr2
    398.             End If
    399.             If chkcolor = 1 Then
    400.                 coloraaer petname2, petcolor2
    401.             End If
    402.             If chkpetpet = 1 Then
    403.                 petpetaaer petname2
    404.             End If
    405.             If chkmeuka.Value = 1 Then
    406.                 meukaaaer petname2
    407.             End If
    408.  
    409.         End If
    410.  
    411.         If InStr(strhtml, "pet_arr[2].name") Then
    412.             petname3 = GB(strhtml, "pet_arr[2].name = " & ChrW$(34), ChrW$(34))
    413.             petspecies3 = GB(strhtml, "pet_arr[2].species = " & ChrW$(34), ChrW$(34))
    414.             petcolor3 = GB(strhtml, "pet_arr[2].color = " & ChrW$(34), ChrW$(34))
    415.             petlev3 = GB(strhtml, "pet_arr[2].lev = " & ChrW$(34), ChrW$(34))
    416.             petstr3 = GB(strhtml, "pet_arr[2].str = " & ChrW$(34), ChrW$(34))
    417.             petdef3 = GB(strhtml, "pet_arr[2].def = " & ChrW$(34), ChrW$(34))
    418.             lblcurrent.Caption = petname3
    419.             If chkspecific = 1 Then
    420.                 specificaaer petname3, petcolor3, petspecies3
    421.             End If
    422.             If chkspecies = 1 Then
    423.                 speciesaaer petname3, petspecies3
    424.             End If
    425.             If chkstatistics = 1 Then
    426.                 statsaaer petname3, petlev3, petdef3, petstr3
    427.             End If
    428.             If chkcolor = 1 Then
    429.                 coloraaer petname3, petcolor3
    430.             End If
    431.             If chkpetpet = 1 Then
    432.                 petpetaaer petname3
    433.             End If
    434.             If chkmeuka.Value = 1 Then
    435.                 meukaaaer petname3
    436.             End If
    437.         End If
    438.     Loop
    439. End Sub
    440.  
    441. Private Sub cmdstop_Click()
    442.     status = "stop"
    443. End Sub
    444.  
    445.  
    446. Private Sub Image1_Click()
    447.     MsgBox "You found the secret button. :O  Good job."
    448. End Sub
    449.  
    450. Private Sub cmdupdate_Click()
    451.     lblstatus.Caption = "Getting account information."
    452.     Update = w.GetWrapper("http://www.neopets.com/index.phtml")
    453.     lblaccount.Caption = txtuser.Text
    454.     If InStr(Update, "activePet") Then
    455.         lblactivepet.Caption = GB(Update, "/quickref.phtml" & ChrW$(34) & "><b>", "</b>")
    456.     Else
    457.         lblactivepet.Caption = "You have no pet? o.o"
    458.     End If
    459.     lblnps.Caption = GB(Update, "<a href=" & ChrW$(34) & "/objects.phtml?type=inventory" & ChrW$(34) & ">", "</a>")
    460.     lblstatus.Caption = "Account information updated."
    461. End Sub
    462.  
    463.  
    464.  
    465. Private Sub Form_Unload(Cancel As Integer)
    466.  
    467.     Dim frmTemp As Form
    468.     For Each frmTemp In Forms
    469.         Unload frmTemp
    470.         Set frmTemp = Nothing
    471.     Next
    472.     End
    473.  
    474. End Sub
    475.  
    476. Private Sub loadcolor_Click()
    477.     Call LoadListFromFile(cmdialog1, lstcolor)
    478. End Sub
    479.  
    480. Private Sub loadpetpet_Click()
    481.     Call LoadListFromFile(cmdialog1, lstpetpet)
    482. End Sub
    483.  
    484. Private Sub loadspecies_Click()
    485.     Call LoadListFromFile(cmdialog1, lstspecies)
    486. End Sub
    487.  
    488.  
    489.  
    490. Private Sub loadspecific_Click()
    491.     Call LoadListFromFile(cmdialog1, lstspecific)
    492. End Sub
    493.  
    494. Private Sub removecolor_Click()
    495.     If lstcolor.ListIndex > -1 Then
    496.         lstcolor.RemoveItem lstcolor.ListIndex
    497.     End If
    498. End Sub
    499.  
    500. Private Sub removepetpet_Click()
    501.     If lstpetpet.ListIndex > -1 Then
    502.         lstpetpet.RemoveItem lstpetpet.ListIndex
    503.     End If
    504. End Sub
    505.  
    506. Private Sub removespecies_Click()
    507.     If lstspecies.ListIndex > -1 Then
    508.         lstspecies.RemoveItem lstspecies.ListIndex
    509.     End If
    510. End Sub
    511.  
    512. Private Sub removespecific_Click()
    513.     If lstspecific.ListIndex > -1 Then
    514.         lstspecific.RemoveItem lstspecies.ListIndex
    515.     End If
    516. End Sub
    517.  
    518. Private Sub savecolor_Click()
    519.     Call SaveListToFile(cmdialog1, lstcolor)
    520. End Sub
    521.  
    522. Private Sub savepetpet_Click()
    523.     Call SaveListToFile(cmdialog1, lstpetpet)
    524. End Sub
    525.  
    526. Private Sub savespecies_Click()
    527.     Call SaveListToFile(cmdialog1, lstspecies)
    528. End Sub
    529.  
    530. Private Sub savespecific_Click()
    531.  
    532.     Call SaveListToFile(cmdialog1, lstspecific)
    533. End Sub
    534.  
    frmquick -
    Code (Text):
    1. Dim strhtml As String, refreshed As String, status As String
    2.  
    3.  
    4. Private Sub cmdlogin_Click()
    5.     lblloginstats.Caption = "Logging in, please wait"
    6.     strhtml = w.GetWrapper("http://www.neopets.com/index.phtml")
    7.     strhtml = w.PostWrapper("http://www.neopets.com/login.phtml", "username=" & user1.Text & "&password=" & pass1.Text & "&destination=%2Fpetcentral.phtml", "http://www.neopets.com/hi.phtml")
    8.     If InStr(strhtml, "badpassword.phtml") Then
    9.         lblloginstats.Caption = "Idle"
    10.     ElseIf InStr(strhtml, "petcentral.phtml") Then
    11.         lblloginstats.Caption = "Logged in"
    12.     ElseIf InStr(strhtml, "FROZEN") Then
    13.         lblloginstats.Caption = "Account frozen"
    14.     Else
    15.         lblloginstats.Caption = "Username doesn't exist/Guessed too many times/Unknown Error"
    16.     End If
    17. End Sub
    18.  
    19.  
    20.  
    21. Private Sub cmdstart_Click()
    22.     refreshed = "0"
    23.     lblstatus.Caption = "Refreshed " & refreshed & " times"
    24.     status = "go"
    25.     Do Until status = "stop"
    26.         strhtml = w.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & txtpet.Text, "http://www.neopets.com/pound/adopt.phtml")
    27.         refreshed = refreshed + 1
    28.         lblstatus.Caption = "Refreshed " & refreshed & " times"
    29.         If InStr(strhtml, "success") Then
    30.             MsgBox "Pet Adopted"
    31.             lblstatus.Caption = "Adopted " & txtpet.Text
    32.             status = "stop"
    33.         End If
    34.  
    35.  
    36.         If InStr(strhtml, "login to") Then
    37.             strhtml = w.PostWrapper("http://www.neopets.com/login.phtml", "username=" & user1.Text & "&password=" & pass1.Text & "&destination=%2Fpetcentral.phtml", "http://www.neopets.com/hi.phtml")
    38.         End If
    39.     Loop
    40. End Sub
    41.  
    42. Private Sub cmdstop_Click()
    43.     status = "stop"
    44. End Sub
    45.  
    46.  

    frmselect -
    Code (Text):
    1. Private Sub Form_Unload(Cancel As Integer)
    2.  
    3.     Dim frmTemp As Form
    4.     For Each frmTemp In Forms
    5.         Unload frmTemp
    6.         Set frmTemp = Nothing
    7.     Next
    8.     End
    9.  
    10. End Sub
    11.  
    12. Private Sub cmdselect_Click()
    13.     If Combo1.ListIndex = -1 Then
    14.         MsgBox "Select a program"
    15.     ElseIf Combo1.ListIndex = 0 Then
    16.         Me.Hide
    17.         frmmain.Show
    18.     ElseIf Combo1.ListIndex = 1 Then
    19.         Me.Hide
    20.         frmquick.Show
    21.     ElseIf Combo1.ListIndex = 2 Then
    22.         Me.Hide
    23.         frmtransfer.Show
    24.     End If
    25. End Sub
    26.  
    27.  

    frmtransfer -
    Code (Text):
    1. Dim petname As String
    2. Dim strhtml As String
    3. Dim lastatus As String
    4.  
    5. Public Function GB(rC As String, rS As String, rF As String, Optional lgB As Long = 1) As String
    6.     lgB = InStr(lgB, rC, rS) + Len(rS): GB = Mid$(rC, lgB, InStr(lgB, rC, rF) - lgB)
    7. End Function
    8.  
    9. Private Sub cmdlogin1_Click()
    10.     Label10.Caption = "Logging in, please wait"
    11.     strhtml = w1.GetWrapper("http://www.neopets.com/index.phtml")
    12.     strhtml = ""
    13.     strhtml = w1.PostWrapper("http://www.neopets.com/login.phtml", "username=" & user1.Text & "&password=" & pass1.Text & "&destination=%2Fpetcentral.phtml", "http://www.neopets.com/hi.phtml")
    14.     If InStr(strhtml, "badpassword.phtml") Then
    15.         MsgBox "Bad password"
    16.         Label10.Caption = "Idle"
    17.     ElseIf InStr(strhtml, "petcentral.phtml") Then
    18.         MsgBox "Logged in as " & user1.Text
    19.         Label10.Caption = "Logged in"
    20.  
    21.  
    22.     ElseIf InStr(strhtml, "FROZEN") Then
    23.         MsgBox "Your account," & user1.Text & ", is frozen"
    24.         Label10.Caption = "Idle"
    25.  
    26.     Else
    27.         MsgBox "Username Doesn't exist or Unknown Error"
    28.     End If
    29. End Sub
    30.  
    31. Private Sub cmdlogin2_Click()
    32.     Label11.Caption = "Logging in, please wait"
    33.     strhtml = w2.GetWrapper("http://www.neopets.com/index.phtml")
    34.     strhtml = ""
    35.     strhtml = w2.PostWrapper("http://www.neopets.com/login.phtml", "username=" & user2.Text & "&password=" & pass2.Text & "&destination=%2Fpetcentral.phtml", "http://www.neopets.com/hi.phtml")
    36.     If InStr(strhtml, "badpassword.phtml") Then
    37.         MsgBox "Bad password"
    38.         Label11.Caption = "Idle"
    39.     ElseIf InStr(strhtml, "petcentral.phtml") Then
    40.         MsgBox "Logged in as " & user2.Text
    41.         Label11.Caption = "Logged in"
    42.     ElseIf InStr(strhtml, "FROZEN") Then
    43.         MsgBox "Your account," & user2.Text & ", is frozen"
    44.         Label11.Caption = "Idle"
    45.  
    46.     Else
    47.         MsgBox "Username Doesn't exist or Unknown Error"
    48.     End If
    49. End Sub
    50.  
    51. Private Sub transfer_Click()
    52.     lastatus = "go"
    53.     petname = thename.Text
    54.     pin = txtpin.Text
    55.     log1.AddItem "Transfering " & petname
    56.  
    57.     strhtml = w2.GetWrapper("http://www.neopets.com/pound/abandon.phtml")
    58.     confirm = GB(strhtml, "<input type='hidden' name='_ref_ck' value='", "'>")
    59.     strhtml = w2.PostWrapper("http://www.neopets.com/pound/process_abandon.phtml", "pet_name=" & petname & "&confirm=4&_ref_ck=" & confirm & "&pin=" & pin, "http://www.neopets.com/pound/abandon.phtml")
    60.     strhtml = w1.PostWrapper("http://www.neopets.com/pound/process_adopt.phtml", "pet_name=" & petname, "http://www.neopets.com/pound/adopt.phtml")
    61.     If InStr(strhtml, "success") Then
    62.         log1.AddItem "Transfer Success"
    63.  
    64.             Else
    65.              log1.AddItem "Transfer failed?"
    66.     End If
    67. End Sub
    68.  
     

    Attached Files:

    Kaito likes this.
  2. gaelle

    gaelle Level IV

    Joined:
    Dec 24, 2006
    Messages:
    796
    Likes Received:
    5
    Location:
    France
    thanks, it helps a lot =)