Zarox Posted July 2, 2007 Share Posted July 2, 2007 (edited) I am new with AutoIT $var2 = 1 $var = PixelGetColor( 600 , 450 ) Do MouseClick("left", 900, 400, 1) $var2 = $var2 - 1 Until $var2 = 0 If $var = 11645361 Then MouseClick("left", 630, 700, 1) MouseClick("left", 675, 650, 30) MouseClick("left", 900, 320, 10) ElseIf $var <> 11645361 Then MouseClick("left", 720, 700, 1) MsgBox(0,"Working!", $var) EndIf How would I make it repeat from the bottom to the top. I want this script to press one button on the screen, then check to see if 600,450 is the right color, and if so click one button, then another 30 times, then another 10 times. If not. I would like it to press A DIFFERENT button and then repeat at "If $var = 116.. etc.." Also I would ilke it to repeat from the beginning after it finishes the 10 mouse clicks. Thanks for helping a noob, Zarox Edited July 2, 2007 by Zarox Link to comment Share on other sites More sharing options...
MisterBates Posted July 2, 2007 Share Posted July 2, 2007 I want this script to press one button on the screen, then check to see if 600,450 is the right color, and if so click one button, then another 30 times, then another 10 times. If not. I would like it to press A DIFFERENT button and then repeat at "If $var = 116.. etc.." Also I would ilke it to repeat from the beginning after it finishes the 10 mouse clicks.Try this (UNTESTED): HotKeySet("{ESC}", "Terminate") do ; I would like this script to ... MouseClick("left", 900, 400, 1) ; ... press one button on the screen ... $var = PixelGetColor( 600 , 450 ); ... then check to see if 600,450 is the right color ... while True If $var = 11645361 Then; ... and if so ... MouseClick("left", 630, 700, 1); ... click one button ... MouseClick("left", 675, 650, 30); ... then another 30 times ... MouseClick("left", 900, 320, 10); ... then another 10 times ... Else; ... If not ... MouseClick("left", 720, 700, 1); ... I would like it to press A DIFFERENT button ... MsgBox(0,"Working!", $var) EndIf $var = PixelGetColor( 600 , 450 ) wend; ... and then repeat at "If $var = 116 ... until False; ... Also I would ilke it to repeat from the beginning after it finishes the 10 mouse clicks. Func Terminate() Exit 0 EndFunc Wasn't sure whether the repeat from beginning was correct, since I didn't fully understand "the 10 mouse clicks" - what 10 mouse clicks? [u]MisterBates[/u]_____________________________________________________Suspend/Resume Windows ScreensaverWatchWindows - Window watcher/loggerUDF: Click systray menu/submenu itemsUDF: Outlook Express Folder/Message handling (+ example code)HowTo: Multiple icons in one compiled script Link to comment Share on other sites More sharing options...
Raffle Posted July 2, 2007 Share Posted July 2, 2007 welcome to the fourms! What's this script supposed to be doing? Link to comment Share on other sites More sharing options...
Zarox Posted July 2, 2007 Author Share Posted July 2, 2007 (edited) the 10 click are MouseClick("left", 900, 320, 10,) let me test it Edited July 2, 2007 by Zarox Link to comment Share on other sites More sharing options...
Zarox Posted July 2, 2007 Author Share Posted July 2, 2007 (edited) HotKeySet("{ESC}", "Terminate") do ; I would like this script to ... MouseClick("left", 900, 400, 1); ... press one button on the screen ... MouseClick("left", 725, 700, 1) $var = PixelGetColor( 600 , 450 ); ... then check to see if 600,450 is the right color ... while True If $var = 11645361 Then; ... and if so ... MouseClick("left", 630, 730, 1); ... click one button ... MouseClick("left", 675, 650, 30); ... then another 30 times ... MouseClick("left", 900, 320, 10); ... then another 10 times ... Else; ... If not ... MouseClick("left", 720, 730, 1); ... I would like it to press A DIFFERENT button ... Sleep(1000) EndIf $var = PixelGetColor( 600 , 450 ) wend; ... and then repeat at "If $var = 116 ... until False; ... Also I would ilke it to repeat from the beginning after it finishes the 10 mouse clicks. Func Terminate() Exit 0 EndFunc I have gotten it all to work, except making the program start from the beginning after running: MouseClick("left", 630, 730, 1); ... click one button ... MouseClick("left", 675, 650, 30); ... then another 30 times ... MouseClick("left", 900, 320, 10); ... then another 10 times ... Edited July 2, 2007 by Zarox Link to comment Share on other sites More sharing options...
MisterBates Posted July 2, 2007 Share Posted July 2, 2007 I have gotten it all to work, except making the program start from the beginning after running: MouseClick("left", 630, 730, 1); ... click one button ... MouseClick("left", 675, 650, 30); ... then another 30 times ... MouseClick("left", 900, 320, 10); ... then another 10 times ...You seem to have two loops, one repeating from beginning if the above mouseclicks happen, the other repeating from If $var = 11645361 Then if not. Try this (UNTESTED): HotKeySet("{ESC}", "Terminate") $PressButton1 = True; Makes initial clicks happen While True if $PressButton1 then MouseClick("left", 900, 400, 1) MouseClick("left", 725, 700, 1) $PressButton1 = False; ensures that initial clicks only happen once pixel of right color is detected endif $var = PixelGetColor( 600 , 450 ) If $var = 11645361 Then MouseClick("left", 630, 730, 1) MouseClick("left", 675, 650, 30) MouseClick("left", 900, 320, 10) $PressButton1 = True; pixel was detected - run from "beginning" Else MouseClick("left", 720, 730, 1) Sleep(1000) EndIf wend Func Terminate() Exit 0 EndFunc [u]MisterBates[/u]_____________________________________________________Suspend/Resume Windows ScreensaverWatchWindows - Window watcher/loggerUDF: Click systray menu/submenu itemsUDF: Outlook Express Folder/Message handling (+ example code)HowTo: Multiple icons in one compiled script Link to comment Share on other sites More sharing options...
Zarox Posted July 2, 2007 Author Share Posted July 2, 2007 That script works, thanks alot guys for all your help and understanding.. as the first post was really early in the morning 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