J0ker Posted December 27, 2006 Share Posted December 27, 2006 (edited) expandcollapse popup$Class = 2 ;Section 1 If $Class = 1 Then Do $Color1 = Pixelgetcolor(506,392) $Color2 = Pixelgetcolor(871,561) $Color3 = Pixelgetcolor(286,537) If $Color3 = "527368" Then MouseClick ( "left" , 167, 472 , 1 , 1 ) If $Color1 = "0" Then MouseClick ( "left" , 649, 424 , 1 , 1 ) Until $Color2 = "0" Sleep(500) MouseClick ( "left" , 510, 408 , 1 , 1 ) If $Stack < 5 then Do $ColorEnd = Pixelgetcolor(249,140) sleep(100) Until $ColorEnd = "0" $Stack = $Stack + 1 Else If $Stack = 5 then $Stack = 0 sleep(2000) ; End of Section 1 Else ; Problem HERE ; Section 2 If $Class = 2 Then Do $Color1 = Pixelgetcolor(506,392) $Color2 = Pixelgetcolor(871,561) $Color3 = Pixelgetcolor(286,537) $Color4 = Pixelgetcolor(606,440) If $Color3 = "527368" Then MouseClick ( "left" , 167, 472 , 1 , 1 ) If $Color4 = "0" Then MouseClick ( "left" , 608, 425 , 1 , 1 ) If $Color1 = "0" Then MouseClick ( "left" , 503, 420 , 1 , 1 ) Until $Color2 = "0" Sleep(500) MouseClick ( "left" , 510, 408 , 1 , 1 ) If $Stack < 5 then Do $ColorEnd = Pixelgetcolor(249,140) sleep(100) Until $ColorEnd = "0" $Stack = $Stack + 1 Else If $Stack = 5 then $Stack = 0 sleep(2000) ; End of Section 2 EndIf EndIf EndIf EndIf EndIf EndIf Exit Ok here's the problem. The script pass over the section 2 because the first If is not linked to the Else between the 2 sections. If $Class = 2 then the script Exit straight away, he dont do the section 2. There's alot of If,Else,Do,Until in there so I dont know where the problem come from. Edited December 27, 2006 by J0ker Link to comment Share on other sites More sharing options...
Valuater Posted December 27, 2006 Share Posted December 27, 2006 You have and extra "Endif" in your script. If you use the syntax checking in SciTE, you would see the error expandcollapse popup$Class = 2 $Stack = 0 ;Section 1 If $Class = 1 Then Do $Color1 = PixelGetColor(506, 392) $Color2 = PixelGetColor(871, 561) $Color3 = PixelGetColor(286, 537) If $Color3 = "527368" Then MouseClick("left", 167, 472, 1, 1) If $Color1 = "0" Then MouseClick("left", 649, 424, 1, 1) Until $Color2 = "0" Sleep(500) MouseClick("left", 510, 408, 1, 1) If $Stack < 5 Then Do $ColorEnd = PixelGetColor(249, 140) Sleep(100) Until $ColorEnd = "0" $Stack = $Stack + 1 Else If $Stack = 5 Then $Stack = 0 Sleep(2000) ; End of Section 1 Else ; Problem HERE ; Section 2 If $Class = 2 Then Do $Color1 = PixelGetColor(506, 392) $Color2 = PixelGetColor(871, 561) $Color3 = PixelGetColor(286, 537) $Color4 = PixelGetColor(606, 440) If $Color3 = "527368" Then MouseClick("left", 167, 472, 1, 1) If $Color4 = "0" Then MouseClick("left", 608, 425, 1, 1) If $Color1 = "0" Then MouseClick("left", 503, 420, 1, 1) Until $Color2 = "0" Sleep(500) MouseClick("left", 510, 408, 1, 1) If $Stack < 5 Then Do $ColorEnd = PixelGetColor(249, 140) Sleep(100) Until $ColorEnd = "0" $Stack = $Stack + 1 Else If $Stack = 5 Then $Stack = 0 Sleep(2000) ; End of Section 2 EndIf EndIf EndIf EndIf EndIf EndIf Exit 8) Link to comment Share on other sites More sharing options...
J0ker Posted December 27, 2006 Author Share Posted December 27, 2006 (edited) Sorry the extra EndIf was coming from another part of my script so I should not have posted it here. What you just posted is my actual script. expandcollapse popup$Class = 2 $Stack = 0 ;Section 1 If $Class = 1 Then Do $Color1 = PixelGetColor(506, 392) $Color2 = PixelGetColor(871, 561) $Color3 = PixelGetColor(286, 537) If $Color3 = "527368" Then MouseClick("left", 167, 472, 1, 1) If $Color1 = "0" Then MouseClick("left", 649, 424, 1, 1) Until $Color2 = "0" Sleep(500) MouseClick("left", 510, 408, 1, 1) If $Stack < 5 Then Do $ColorEnd = PixelGetColor(249, 140) Sleep(100) Until $ColorEnd = "0" $Stack = $Stack + 1 Else If $Stack = 5 Then $Stack = 0 Sleep(2000) ; End of Section 1 Else ; Problem HERE ; Section 2 If $Class = 2 Then Do $Color1 = PixelGetColor(506, 392) $Color2 = PixelGetColor(871, 561) $Color3 = PixelGetColor(286, 537) $Color4 = PixelGetColor(606, 440) If $Color3 = "527368" Then MouseClick("left", 167, 472, 1, 1) If $Color4 = "0" Then MouseClick("left", 608, 425, 1, 1) If $Color1 = "0" Then MouseClick("left", 503, 420, 1, 1) Until $Color2 = "0" Sleep(500) MouseClick("left", 510, 408, 1, 1) If $Stack < 5 Then Do $ColorEnd = PixelGetColor(249, 140) Sleep(100) Until $ColorEnd = "0" $Stack = $Stack + 1 Else If $Stack = 5 Then $Stack = 0 Sleep(2000) ; End of Section 2 EndIf EndIf EndIf EndIf EndIf EndIf Exit It's still skipping the section 2. Anyone know why? Edited December 27, 2006 by J0ker Link to comment Share on other sites More sharing options...
Valuater Posted December 27, 2006 Share Posted December 27, 2006 (edited) it is the "corrected" script i pasted .... also per helpPixelGetColor ( x , y )Parameters x x coordinate of pixel. y y coordinate of pixel. Return Value Success: Returns decimal value of pixel's color. Failure: Returns -1 if invalid coordinates.Until $Color... = "0" you wont get a "0"8) BTW... if invalid coordinates.. ??? ( not quite sure what that means ) Edited December 27, 2006 by Valuater Link to comment Share on other sites More sharing options...
J0ker Posted December 27, 2006 Author Share Posted December 27, 2006 (edited) it is the "corrected" script i pastedYes this script dont get any errors if I run the syntax checker but it's still skip the section 2. There's something not working in my Else/If. $Color... = "0"This is working I'm 100% sure, 0 = Black. I tried it. If I put $Class = 1, it work perfectly.My pixelgetcolor variables are working, there's no problem with them. My script is based on that and I have 500 lines ++ of script. Only this part of my script isnt working because it skip the section 2. Edited December 27, 2006 by J0ker Link to comment Share on other sites More sharing options...
Valuater Posted December 27, 2006 Share Posted December 27, 2006 if that is the case then maybe... expandcollapse popup$Class = 2 ;Section 1 If $Class = 1 Then Do $Color1 = PixelGetColor(506, 392) $Color2 = PixelGetColor(871, 561) $Color3 = PixelGetColor(286, 537) If $Color3 = "527368" Then MouseClick("left", 167, 472, 1, 1) If $Color1 = "0" Then MouseClick("left", 649, 424, 1, 1) Until $Color2 = "0" Sleep(500) MouseClick("left", 510, 408, 1, 1) If $Stack < 5 Then Do $ColorEnd = PixelGetColor(249, 140) Sleep(100) Until $ColorEnd = "0" $Stack = $Stack + 1 Else If $Stack = 5 Then $Stack = 0 Sleep(2000) ; End of Section 1 EndIf ; Problem HERE EndIf EndIf ; Section 2 If $Class = 2 Then Do $Color1 = PixelGetColor(506, 392) $Color2 = PixelGetColor(871, 561) $Color3 = PixelGetColor(286, 537) $Color4 = PixelGetColor(606, 440) If $Color3 = "527368" Then MouseClick("left", 167, 472, 1, 1) If $Color4 = "0" Then MouseClick("left", 608, 425, 1, 1) If $Color1 = "0" Then MouseClick("left", 503, 420, 1, 1) Until $Color2 = "0" Sleep(500) MouseClick("left", 510, 408, 1, 1) If $Stack < 5 Then Do $ColorEnd = PixelGetColor(249, 140) Sleep(100) Until $ColorEnd = "0" $Stack = $Stack + 1 Else If $Stack = 5 Then $Stack = 0 Sleep(2000) ; End of Section 2 EndIf EndIf EndIf Exit Link to comment Share on other sites More sharing options...
Outshynd Posted December 27, 2006 Share Posted December 27, 2006 Your problem is that you have an If $Class = 2 inside an If $Class = 1. $Class will never be 2 inside that particular if..then statement. Try reformatting your if..then statements a little. Link to comment Share on other sites More sharing options...
J0ker Posted December 27, 2006 Author Share Posted December 27, 2006 (edited) if that is the case then maybe... expandcollapse popup$Class = 2 ;Section 1 If $Class = 1 Then Do $Color1 = PixelGetColor(506, 392) $Color2 = PixelGetColor(871, 561) $Color3 = PixelGetColor(286, 537) If $Color3 = "527368" Then MouseClick("left", 167, 472, 1, 1) If $Color1 = "0" Then MouseClick("left", 649, 424, 1, 1) Until $Color2 = "0" Sleep(500) MouseClick("left", 510, 408, 1, 1) If $Stack < 5 Then Do $ColorEnd = PixelGetColor(249, 140) Sleep(100) Until $ColorEnd = "0" $Stack = $Stack + 1 Else If $Stack = 5 Then $Stack = 0 Sleep(2000) ; End of Section 1 EndIf ; Problem HERE EndIf EndIf ; Section 2 If $Class = 2 Then Do $Color1 = PixelGetColor(506, 392) $Color2 = PixelGetColor(871, 561) $Color3 = PixelGetColor(286, 537) $Color4 = PixelGetColor(606, 440) If $Color3 = "527368" Then MouseClick("left", 167, 472, 1, 1) If $Color4 = "0" Then MouseClick("left", 608, 425, 1, 1) If $Color1 = "0" Then MouseClick("left", 503, 420, 1, 1) Until $Color2 = "0" Sleep(500) MouseClick("left", 510, 408, 1, 1) If $Stack < 5 Then Do $ColorEnd = PixelGetColor(249, 140) Sleep(100) Until $ColorEnd = "0" $Stack = $Stack + 1 Else If $Stack = 5 Then $Stack = 0 Sleep(2000) ; End of Section 2 EndIf EndIf EndIf Exit It work ! Thanks Valuater Edited December 27, 2006 by J0ker Link to comment Share on other sites More sharing options...
Valuater Posted December 27, 2006 Share Posted December 27, 2006 Welcome 8) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now