Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: [VB6] NP on hand.. Nothing happens

  1. #1

    Joined
    Dec 2011
    Posts
    843
    Pronouns
    she/her
    Userbars
    3
    Thanks
    313
    Thanked
    346/213
    DL/UL
    34/2
    Mentioned
    179 times
    Time Online
    1d 19h 11m
    Avg. Time Online
    N/A

    [VB6] NP on hand.. Nothing happens

    Code:
    Private Sub Command2_Click()
    
    Strhtml = Neopets1.Wrapper1.GetWrapper("http://neopets.com/index")
    
    Dim html As String
    
    Hand.Caption = GetStringBetween(html, "NP: <a id='npanchor' href=""/objects.phtml?type=inventory"">", "</a>")
    
    End Sub
    Nothing happens, it goes through it, and my caption does not change!

  2. #2

    Joined
    Dec 2011
    Posts
    488
    Thanks
    303
    Thanked
    559/263
    DL/UL
    13/4
    Mentioned
    34 times
    Time Online
    1h 58m
    Avg. Time Online
    N/A
    Err...

    First, Strhtml hasn't been initialized (from what I can see), so your wrapper is throwing what it gets right into the trash. We'll leave it for now, and initialize strhtml instead above it.

    Code:
    Private Sub Command2_Click()
    
    Dim Strhtml As String
    Strhtml = Neopets1.Wrapper1.GetWrapper("http://neopets.com/index")
    
    Dim html As String
    
    Hand.Caption = GetStringBetween(html, "NP: <a id='npanchor' href=""/objects.phtml?type=inventory"">", "</a>")
    
    End Sub
    Next, I'm not sure what wrapper you're using (it looks like gluraks), so I'm not sure why you are calling Neopets1.Wrapper1.GetWrapper (unless you're using some sort of specialized control). If it IS just a wrapper, just leave it at Wrapper1.GetWrapper() (or whatever you named it). Also, /index on Neopets gives a 404. You want index.phtml.

    Code:
    Private Sub Command2_Click()
    
    Dim Strhtml As String
    Strhtml = Wrapper1.GetWrapper("http://neopets.com/index.phtml")
    
    Dim html As String
    
    Hand.Caption = GetStringBetween(html, "NP: <a id='npanchor' href=""/objects.phtml?type=inventory"">", "</a>")
    
    End Sub
    Next, afterwards you are initializing html as a string. Nothing wrong there, except when you use your GSB, you're searching in html, but html has nothing in it! Lets just get rid of html, and switch the searched string to strhtml.

    Code:
    Private Sub Command2_Click()
    
    Dim Strhtml As String
    Strhtml = Wrapper1.GetWrapper("http://neopets.com/index.phtml")
    
    Hand.Caption = GetStringBetween(Strhtml, "NP: <a id='npanchor' href=""/objects.phtml?type=inventory"">", "</a>")
    
    End Sub
    Now, this should work (provided that you have logged in first, this could also be an issue that you have not logged in!)

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

    Ashleys165 (12-29-2011),j03 (12-30-2011)

  4. #3

    Joined
    Dec 2011
    Posts
    151
    Userbars
    2
    Thanks
    4
    Thanked
    165/45
    DL/UL
    14/9
    Mentioned
    68 times
    Time Online
    6d 17h 26m
    Avg. Time Online
    2m
    I am sorry without actually seeing the rest of the code, you are assuming quite alot. Ashleys165 could have declared Strhtml As as a string in a global variable.

    Neopets1.Wrapper1.GetWrapper would be used if you have multiple forms and the wrapper you are calling is on a different form (form name would be Neopets1).

    Could you please post the project; the easist way to determine what is wrong, would be to see what the code is actually doing. From what I see in the code you have posted, the missing phtml that ./m mentioned is most likely the issue.

  5. #4
    Josh's Avatar
    Joined
    Dec 2011
    Posts
    415
    Userbars
    2
    Thanks
    25
    Thanked
    378/143
    DL/UL
    82/6
    Mentioned
    120 times
    Time Online
    17d 9h 48m
    Avg. Time Online
    5m
    Quote Originally Posted by Soredavide View Post
    I am sorry without actually seeing the rest of the code, you are assuming quite alot. Ashleys165 could have declared Strhtml As as a string in a global variable.

    Neopets1.Wrapper1.GetWrapper would be used if you have multiple forms and the wrapper you are calling is on a different form (form name would be Neopets1).

    Could you please post the project; the easist way to determine what is wrong, would be to see what the code is actually doing. From what I see in the code you have posted, the missing phtml that ./m mentioned is most likely the issue.
    ...All they are doing is checking the neopoints on hand. Posting the entire project isnt needed.

    Even when missing the .phtml, it should still work. It still shows the nps on hand on that page. The problem was just that they checked the string html instead of strhtml.

  6. #5

    Joined
    Dec 2011
    Posts
    843
    Pronouns
    she/her
    Userbars
    3
    Thanks
    313
    Thanked
    346/213
    DL/UL
    34/2
    Mentioned
    179 times
    Time Online
    1d 19h 11m
    Avg. Time Online
    N/A
    ^ I'm not so sure... I decided to add the code to my log in... and I had the same thing, my caption turned into NOTHING, absolutely nothing! Sooo, I have checked the code many times.... And found (whats the word?) nothing... sooo, I want it to be checked over by professionals...

    Code:
    Private Sub neo_Click()
    
    Dim Strhtml As String
    
    Strhtml = Wrapper1.GetWrapper("http://www.neopets.com/login/")
    Strhtml = Wrapper1.PostWrapper("http://www.neopets.com/login.phtml", "destination=&username=" & User & "&password=" & pass, "http://www.neopets.com/login/")
    
    If InStr(1, Strhtml, "badpassword") Then
    MsgBox "Bad Password Or Username, Try Again."
    ElseIf InStr(1, Strhtml, "index") Then
    MsgBox ("You succesfully logged in as " & User.Text & ".  Have fun cheating!")
    
    
    Strhtml = Wrapper1.GetWrapper("http://neopets.com/index.phtml")
    
    NPOH.Caption = GetStringBetween(Strhtml, "NP: <a id='npanchor' href=""/objects.phtml?type=inventory"">", "</a>")
    
    Else
    MsgBox "You Might Be Frozen, Or There Is An Unknown Error!"
    End If
    
    End Sub

  7. #6
    deadfolx's Avatar
    Joined
    Dec 2011
    Posts
    465
    Userbars
    2
    Thanks
    19
    Thanked
    42/30
    DL/UL
    22/2
    Mentioned
    14 times
    Time Online
    52m
    Avg. Time Online
    N/A
    far from a pro, but i dont think the strhtml between ur MsgBox and NPOH is really needed since u just added to ur login sub. u can just read whats already there, instead of getting again? maybe thats worth a shot?

    also, set a breakpoint towards the bottom of the Sub, or step through, and see whats going on. See if u can view the strhtml string. Should give u better clues.
    [FONT=Arial Narrow]"Chuck Norris methods doesn

  8. #7

    Joined
    Dec 2011
    Posts
    488
    Thanks
    303
    Thanked
    559/263
    DL/UL
    13/4
    Mentioned
    34 times
    Time Online
    1h 58m
    Avg. Time Online
    N/A
    What deadfolx said. Try making a multiline textbox and before your GSB put your strhtml into it. Because now it seems to be more of a logic issue than anything

  9. #8
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    13,722
    Userbars
    166
    Thanks
    5,906
    Thanked
    33,077/6,608
    DL/UL
    23/36
    Mentioned
    3,867 times
    Time Online
    563d 5h 25m
    Avg. Time Online
    3h 13m
    Always use msgbox's to debug. use them to see if you logged in (have a popup saying "hi" or something if you did) or even have it display the response (msgbox strHTML), so if it's not displaying the NP, then something is not right.
    (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.
    ------------------------


  10. #9

    Joined
    Dec 2011
    Posts
    843
    Pronouns
    she/her
    Userbars
    3
    Thanks
    313
    Thanked
    346/213
    DL/UL
    34/2
    Mentioned
    179 times
    Time Online
    1d 19h 11m
    Avg. Time Online
    N/A
    Code:
    ElseIf InStr(1, Strhtml, "index") Then
    MsgBox ("You succesfully logged in as " & User.Text & ".  Have fun cheating!")
    I have it here... And I am taking a brake from coding atm, but I will go back to it soon to figure out all this stuff.

  11. #10
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    13,722
    Userbars
    166
    Thanks
    5,906
    Thanked
    33,077/6,608
    DL/UL
    23/36
    Mentioned
    3,867 times
    Time Online
    563d 5h 25m
    Avg. Time Online
    3h 13m
    Quote Originally Posted by Ashleys165 View Post
    Code:
    ElseIf InStr(1, Strhtml, "index") Then
    MsgBox ("You succesfully logged in as " & User.Text & ".  Have fun cheating!")
    I have it here... And I am taking a brake from coding atm, but I will go back to it soon to figure out all this stuff.
    Well I hate to see anyone struggle with stuff like this when others find it quite simple. If you want some help with anything, PM me for my MSN or Skype.
    (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.
    ------------------------


Posting Permissions

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