Unsigned Posted October 2, 2011 Share Posted October 2, 2011 Edited/simplified the code. Hopefully you learn from it and don't just blindly copy/paste. . Link to comment Share on other sites More sharing options...
Dgameman1 Posted October 2, 2011 Author Share Posted October 2, 2011 (edited) Edited/simplified the code. Hopefully you learn from it and don't just blindly copy/paste. Ok so if i understand right, I use isArray(function) If im looking to see if there's an error when im passed a line right after the function? So $coord75 = PixelSearch( 25, 150, 766, 534, 0x13D926, 0 , 1, "[TITLE:windowlawl]" ) if not @error then MouseClick("left", $coord75[0] + 15, $coord75[1] + 5, 1 , 0) msgbox(32, "hi" , "hi") endif and $coord75 = PixelSearch( 25, 150, 766, 534, 0x13D926, 0 , 1, "[TITLE:windowlawl]" ) MouseClick("left", $coord75[0] + 15, $coord75[1] + 5, 1 , 0) if not isArray($coord75) then msgbox(32, "hi" , "hi") endif Correct? Edited October 2, 2011 by Dgameman1 Link to comment Share on other sites More sharing options...
Unsigned Posted October 2, 2011 Share Posted October 2, 2011 No. Your second example is wrong. Because you are using an array subscript $coord75[0] and $coord75[1] in the MouseClick() call, BEFORE you check. So if PixelSearch() does not return an array, you're screwed, and will get the "Variable subscript array blah blah" error. Data integrity checks come BEFORE you use the data. . Link to comment Share on other sites More sharing options...
Dgameman1 Posted October 2, 2011 Author Share Posted October 2, 2011 (edited) Why am I having such a difficult time understanding this =[ Would this be correct? $coord75 = PixelSearch( 25, 150, 766, 534, 0x13D926, 0 , 1, "[TITLE:windowlawl]" ) if not isArray($coord75) then MouseClick("left", $coord75[0] + 15, $coord75[1] + 5, 1 , 0) msgbox(32, "hi" , "hi") endif Because it's now checking before it calls mouseclick? Edited October 2, 2011 by Dgameman1 Link to comment Share on other sites More sharing options...
JohnOne Posted October 2, 2011 Share Posted October 2, 2011 Whenever you are writing code, always look at the helpfile and read about what you are writing, even the loops and other keywords. The reason your Do Until loop failed is because it performs the operations in it and then checks the condition, the while wend loop performs the operations in it only if the condition is met. Dgameman1 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Unsigned Posted October 3, 2011 Share Posted October 3, 2011 Checking for what? Look at your code. . 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