Try this:
Code:score = Val(lblPointsToNPS) * Val(txtGainNPS) lblTest = score Score5 = lblScore5 lblScore52 = Score5 time = txtWait If Val(lblTest) > Val(lblScore52) Then mMod = 40 Else mMod = txtMod End If
Hi all,
This one is bothering me beyond belief at the moment. I have an if Statement in my current program (Score Sender List Maker) and its working for most games, but then, on the odd game and its a particular game like Escape from Meridell Castle and Meerca Chase II it just goes wrong, wrong wrong!
So in the case of Escape from Meridell the lblTest = 310 and the lblScore52 = 1741, now for whatever reason, the game is setting my Mod to 40 which is basically my trigger for saying hey, you can't earn 1000 nps from this game, even though the score is below the high scores :\ Its like its picking something wrong thats not wrong.Code:score = lblPointsToNPS * txtGainNPS lblTest = score Score5 = lblScore5 lblScore52 = Score5 time = txtWait If lblTest > lblScore52 Then mMod = 40 Else mMod = txtMod End If
Try this:
Code:score = Val(lblPointsToNPS) * Val(txtGainNPS) lblTest = score Score5 = lblScore5 lblScore52 = Score5 time = txtWait If Val(lblTest) > Val(lblScore52) Then mMod = 40 Else mMod = txtMod End If
(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.
------------------------
Now its throwing an error with my while loop :\ Says I have a Loop without Do but I have the Do .... and no other Do's anywhere:
I hate the fact I can't work out what the hell it is doing and why :\Code:Dim strHTML As String, score As String, time As String, Score5 As Integer Dim mMod As Integer cmdStart.Enabled = False cmdAdd.Enabled = False cmdMLoad.Enabled = False cmdRemove.Enabled = False cmdSaveID.Enabled = False cmdCreateIDList.Enabled = False cmdStop.Enabled = True Do While index <> lblCountID While lblGameName = "" strHTML = w.GetWrapper("http://www.neopets.com/games/game.phtml?game_id=" & lstID.List(index), "http://www.neopets.com/games/") lblGameName = Functions.GSB(strHTML, "og:title" & Chr(34) & " content=" & Chr(34) & "Games Room - ", Chr(34) & "/>") txtNPS = Functions.GSB(strHTML, "<div id=" & Chr(34) & "gr-ctp-neopoints-img" & Chr(34) & "></div>", "Points =") lblPointsToNPS = Functions.GSB(txtNPS, "<b>", " ") lblID = lstID.List(index) Wend While lblUser1 = "" strHTML = w.GetWrapper("http://www.neopets.com/gamescores.phtml?game_id=" & lstID.List(index), w.LastPage) lblUser1 = Functions.GSB(strHTML, "<td align=center>1</td>", "b>") lblUser1 = Functions.GSB(lblUser1, "<td align=center><a href='randomfriend.phtml?user=", "'>") lblScore1 = Functions.GSB(strHTML, lblUser1 & "</b></a></td>", "/td>") lblScore1 = Functions.GSB(lblScore1, "=center>", "<") lblUser2 = Functions.GSB(strHTML, "<td align=center>2</td>", "b>") lblUser2 = Functions.GSB(lblUser2, "<td align=center><a href='randomfriend.phtml?user=", "'>") lblScore2 = Functions.GSB(strHTML, lblUser2 & "</b></a></td>", "/td>") lblScore2 = Functions.GSB(lblScore2, "=center>", "<") lblUser3 = Functions.GSB(strHTML, "<td align=center>3</td>", "b>") lblUser3 = Functions.GSB(lblUser3, "<td align=center><a href='randomfriend.phtml?user=", "'>") lblScore3 = Functions.GSB(strHTML, lblUser3 & "</b></a></td>", "/td>") lblScore3 = Functions.GSB(lblScore3, "=center>", "<") lblUser4 = Functions.GSB(strHTML, "<td align=center>4</td>", "b>") lblUser4 = Functions.GSB(lblUser4, "<td align=center><a href='randomfriend.phtml?user=", "'>") lblScore4 = Functions.GSB(strHTML, lblUser4 & "</b></a></td>", "/td>") lblScore4 = Functions.GSB(lblScore4, "=center>", "<") lblUser5 = Functions.GSB(strHTML, "<td align=center>5</td>", "b>") lblUser5 = Functions.GSB(lblUser5, "<td align=center><a href='randomfriend.phtml?user=", "'>") lblScore5 = Functions.GSB(strHTML, lblUser5 & "</b></a></td>", "/td>") lblScore5 = Functions.GSB(lblScore5, "=center>", "<") Wend If cmdStop.Enabled = False Then strHTML = MsgBox("Successfully stopped!", vbOKOnly, "Stopped Auto List!") Exit Do Else score = Val(lblPointsToNPS) * Val(txtGainNPS) lblTest = score Score5 = lblScore5 lblScore52 = Score5 time = txtWait If Val(lblTest) > Val(lblScore52) Then mMod = 40 Else mMod = txtMod End If If optAdd1.Value = True Then lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) Else If optAdd2.Value = True Then lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) Else If optAdd3.Value = True Then lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) End If End If End If lblGameName = "" lblUser1 = "" index = index + 1 Loop
I properly indented your code and the error popped right out
Code:Dim strHTML As String, score As String, time As String, Score5 As Integer Dim mMod As Integer cmdStart.Enabled = False cmdAdd.Enabled = False cmdMLoad.Enabled = False cmdRemove.Enabled = False cmdSaveID.Enabled = False cmdCreateIDList.Enabled = False cmdStop.Enabled = True Do While index <> lblCountID While lblGameName = "" strHTML = w.GetWrapper("http://www.neopets.com/games/game.phtml?game_id=" & lstID.List(index), "http://www.neopets.com/games/") lblGameName = Functions.GSB(strHTML, "og:title" & Chr(34) & " content=" & Chr(34) & "Games Room - ", Chr(34) & "/>") txtNPS = Functions.GSB(strHTML, "<div id=" & Chr(34) & "gr-ctp-neopoints-img" & Chr(34) & "></div>", "Points =") lblPointsToNPS = Functions.GSB(txtNPS, "<b>", " ") lblID = lstID.List(index) Wend While lblUser1 = "" strHTML = w.GetWrapper("http://www.neopets.com/gamescores.phtml?game_id=" & lstID.List(index), w.LastPage) lblUser1 = Functions.GSB(strHTML, "<td align=center>1</td>", "b>") lblUser1 = Functions.GSB(lblUser1, "<td align=center><a href='randomfriend.phtml?user=", "'>") lblScore1 = Functions.GSB(strHTML, lblUser1 & "</b></a></td>", "/td>") lblScore1 = Functions.GSB(lblScore1, "=center>", "<") lblUser2 = Functions.GSB(strHTML, "<td align=center>2</td>", "b>") lblUser2 = Functions.GSB(lblUser2, "<td align=center><a href='randomfriend.phtml?user=", "'>") lblScore2 = Functions.GSB(strHTML, lblUser2 & "</b></a></td>", "/td>") lblScore2 = Functions.GSB(lblScore2, "=center>", "<") lblUser3 = Functions.GSB(strHTML, "<td align=center>3</td>", "b>") lblUser3 = Functions.GSB(lblUser3, "<td align=center><a href='randomfriend.phtml?user=", "'>") lblScore3 = Functions.GSB(strHTML, lblUser3 & "</b></a></td>", "/td>") lblScore3 = Functions.GSB(lblScore3, "=center>", "<") lblUser4 = Functions.GSB(strHTML, "<td align=center>4</td>", "b>") lblUser4 = Functions.GSB(lblUser4, "<td align=center><a href='randomfriend.phtml?user=", "'>") lblScore4 = Functions.GSB(strHTML, lblUser4 & "</b></a></td>", "/td>") lblScore4 = Functions.GSB(lblScore4, "=center>", "<") lblUser5 = Functions.GSB(strHTML, "<td align=center>5</td>", "b>") lblUser5 = Functions.GSB(lblUser5, "<td align=center><a href='randomfriend.phtml?user=", "'>") lblScore5 = Functions.GSB(strHTML, lblUser5 & "</b></a></td>", "/td>") lblScore5 = Functions.GSB(lblScore5, "=center>", "<") Wend If cmdStop.Enabled = False Then strHTML = MsgBox("Successfully stopped!", vbOKOnly, "Stopped Auto List!") Exit Do Else score = Val(lblPointsToNPS) * Val(txtGainNPS) lblTest = score Score5 = lblScore5 lblScore52 = Score5 time = txtWait If Val(lblTest) > Val(lblScore52) Then mMod = 40 Else mMod = txtMod End If If optAdd1.Value = True Then lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) ElseIf optAdd2.Value = True Then lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) ElseIf optAdd3.Value = True Then lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) lstList.AddItem ("GameID: " & lblID & " Score: " & score & " Time: " & time & " Mod: " & mMod) End If End If lblGameName = "" lblUser1 = "" index = index + 1 Loop
*sigh* The Uni Lecturer could only get indenting into my head when assignments were needed :\ I suppose I owe you a big thanks then @(you need an account to see links) !!
However, in light of all this @(you need an account to see links), I still have the issue of not being able to get it to calculate correctly, eg Gadsgads Game which was working fine earlier is now doing the same thing. I don't understand how the if statement can get it wrong if the damn values say that the statement is false and therefore it cannot do what it is doing.
Its nearly got to be with the formatting of the values stored in the labels doesn't it? The comma's must be throwing something out of whack :\
Edit:
Never mind, declaring Score5 as Long instead of Integer would of helped greatly! And reordering some stuff has fixed most of it, now to just clean it up and remove any unnecessary crap!
Last edited by Integra; 11-17-2013 at 06:12 AM.