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

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

  1. #1

    Join Date
    Dec 2011
    Posts
    832
    Pronoun(s)
    she/her
    Userbars
    3
    Thanks
    313
    Thanked 341 Times in 208 Posts
    Downloads
    34
    Uploads
    2
    Mentioned
    179 Post(s)
    Time Online
    1 d 19 h 8 m
    Avg. Time Online
    N/A
    Rep Power
    11

    [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

    Join Date
    Dec 2011
    Posts
    489
    Userbars
    0
    Thanks
    303
    Thanked 555 Times in 260 Posts
    Downloads
    13
    Uploads
    4
    Mentioned
    34 Post(s)
    Time Online
    1 h 58 m
    Avg. Time Online
    N/A
    Rep Power
    0
    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

    Join Date
    Dec 2011
    Posts
    151
    Userbars
    2
    Thanks
    4
    Thanked 165 Times in 45 Posts
    Downloads
    14
    Uploads
    9
    Mentioned
    68 Post(s)
    Time Online
    6 d 17 h 26 m
    Avg. Time Online
    2 m
    Rep Power
    11
    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
    Join Date
    Dec 2011
    Posts
    415
    Userbars
    2
    Thanks
    25
    Thanked 378 Times in 143 Posts
    Downloads
    82
    Uploads
    6
    Mentioned
    120 Post(s)
    Time Online
    17 d 9 h 48 m
    Avg. Time Online
    7 m
    Rep Power
    10
    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

    Join Date
    Dec 2011
    Posts
    832
    Pronoun(s)
    she/her
    Userbars
    3
    Thanks
    313
    Thanked 341 Times in 208 Posts
    Downloads
    34
    Uploads
    2
    Mentioned
    179 Post(s)
    Time Online
    1 d 19 h 8 m
    Avg. Time Online
    N/A
    Rep Power
    11
    ^ 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
    Join Date
    Dec 2011
    Posts
    463
    Userbars
    2
    Thanks
    19
    Thanked 29 Times in 18 Posts
    Downloads
    22
    Uploads
    2
    Mentioned
    14 Post(s)
    Time Online
    52 m
    Avg. Time Online
    N/A
    Rep Power
    10
    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

    Join Date
    Dec 2011
    Posts
    489
    Userbars
    0
    Thanks
    303
    Thanked 555 Times in 260 Posts
    Downloads
    13
    Uploads
    4
    Mentioned
    34 Post(s)
    Time Online
    1 h 58 m
    Avg. Time Online
    N/A
    Rep Power
    0
    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
    Join Date
    Dec 2011
    Posts
    12,281
    Userbars
    115
    Thanks
    4,829
    Thanked 26,077 Times in 5,680 Posts
    Downloads
    23
    Uploads
    36
    Mentioned
    3503 Post(s)
    Time Online
    467 d 13 h 6 m
    Avg. Time Online
    3 h 22 m
    Rep Power
    25
    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.
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ][Only registered and activated users can see links. ]


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


  10. #9

    Join Date
    Dec 2011
    Posts
    832
    Pronoun(s)
    she/her
    Userbars
    3
    Thanks
    313
    Thanked 341 Times in 208 Posts
    Downloads
    34
    Uploads
    2
    Mentioned
    179 Post(s)
    Time Online
    1 d 19 h 8 m
    Avg. Time Online
    N/A
    Rep Power
    11
    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
    Join Date
    Dec 2011
    Posts
    12,281
    Userbars
    115
    Thanks
    4,829
    Thanked 26,077 Times in 5,680 Posts
    Downloads
    23
    Uploads
    36
    Mentioned
    3503 Post(s)
    Time Online
    467 d 13 h 6 m
    Avg. Time Online
    3 h 22 m
    Rep Power
    25
    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.
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ][Only registered and activated users can 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
  •