panthersbball44 Posted June 29, 2007 Share Posted June 29, 2007 hey everyone...i made this script and it works fine...other than the fact that if the error takes place then the loop messes up... heres the script... sleep (5000) $pixel = 13816329 for $r = 1 to 5 $a = pixelsearch (841,508,850,513,$pixel,5) if @error Then mousemove (870,358) sleep (1000) mouseclick ("left") Else mousemove ($a[0],$a[1]) sleep (1000) mouseclick ("left") sleep (800) mouseclick ("left") sleep (2800) Endif next its fine if it finds the pixel...if it doesnt the error part takes place and the loop is cut short...for example if it doesnt find the color the first try the error part goes and then the rest of it continues but it only repeats 3 times...iono what to do...please help!!!! Link to comment Share on other sites More sharing options...
Generator Posted June 29, 2007 Share Posted June 29, 2007 (edited) Maybe... sleep (5000) $pixel = 13816329 for $r = 1 to 5 $a = pixelsearch (841,508,850,513,$pixel,5) if Not @error Then mousemove ($a[0],$a[1]) sleep (1000) mouseclick ("left") sleep (800) mouseclick ("left") sleep (2800) Else mousemove (870,358) sleep (1000) mouseclick ("left") Endif next Edited June 29, 2007 by Generator Link to comment Share on other sites More sharing options...
panthersbball44 Posted June 29, 2007 Author Share Posted June 29, 2007 it still didnt complete the loop....maybe a diff loop would be better? iono some1 help please Link to comment Share on other sites More sharing options...
mikehunt114 Posted June 29, 2007 Share Posted June 29, 2007 (edited) It's not clear what you want to do. A simple answer might be to replace your current If statement with:If Not IsArray($a) ThenIf you need more help, you'll need to clarify what it is you want your script to do, and why you are using the code you chose. (Why a For loop that loops 5 times? etc.)Edit: typo Edited June 29, 2007 by mikehunt114 IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
aNewLyfe Posted June 29, 2007 Share Posted June 29, 2007 do u want a macro for Darkthrone web based game or sumthin like that ? if u, i have a clear darkthrone script ~ Every Living Thing is a Code Snippet of World Application ~ 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