IkkabodTodd Posted January 23, 2009 Posted January 23, 2009 I am trying to make a script that will check a pixel every 2.5 seconds and if a certain color is there, it will move the mouse to that pixel and click. I am very new to this and could use a lil help if someone would be so kind PixelGetColor, color, ( 1132 , 647 ) if color = 0xEDECEC then MouseMove( 1132, 647 ) Sleep(500) MouseDown("left") MouseUp("left") endif Sleep 2500 That is what i have so far, and I really dont have much of a clue. I also need it to loop
jaberwacky Posted January 23, 2009 Posted January 23, 2009 (edited) I am trying to make a script that will check a pixel every 2.5 seconds and if a certain color is there, it will move the mouse to that pixel and click. I am very new to this and could use a lil help if someone would be so kind PixelGetColor, color, ( 1132 , 647 ) if color = 0xEDECEC then MouseMove( 1132, 647 ) Sleep(500) MouseDown("left") MouseUp("left") endif Sleep 2500That is what i have so far, and I really dont have much of a clue. I also need it to loop Look for TimerInit, TimerDiff, and While loop in the helpfile. Edited January 23, 2009 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
billthecreator Posted January 23, 2009 Posted January 23, 2009 Look for TimerInit, TimerDiff, and While loop in the helpfile. $Start = TimerInit() While 1 If TimerDiff($Start) > 2500 Then If TimerDiff($Start) < 2550 Then $coord = PixelSearch(0, 0, 20, 300, 0xEDECEC); change the rectangle box coords here If Not @error Then MouseClick("Left", $coord[0], $coord[1]) EndIf EndIf $Start = TimerInit() EndIf WEnd [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap
IkkabodTodd Posted January 23, 2009 Author Posted January 23, 2009 Thanks for the quick replies, but im afraid im still lost "$coord = PixelSearch(0, 0, 20, 300, 0xEDECEC); change the rectangle box coords here" is this the only part i need to alter? i just need to search a single pixel, 1132, 647, so would this work: (1132, 647, 1132, 647, 0xEDECEC) P.S. sorry if these questions are really stupid
billthecreator Posted January 23, 2009 Posted January 23, 2009 Thanks for the quick replies, but im afraid im still lost "$coord = PixelSearch(0, 0, 20, 300, 0xEDECEC); change the rectangle box coords here"is this the only part i need to alter? i just need to search a single pixel, 1132, 647, so would this work:(1132, 647, 1132, 647, 0xEDECEC)P.S. sorry if these questions are really stupid (1131, 646, 1133, 648, 0xEDECEC)now its a tiny rectangle. and the color should be inside. [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap
IkkabodTodd Posted January 23, 2009 Author Posted January 23, 2009 (edited) (1131, 646, 1133, 648, 0xEDECEC)now its a tiny rectangle. and the color should be inside.Aha it works! Thank you kind saviors! Edited January 23, 2009 by IkkabodTodd
billthecreator Posted January 23, 2009 Posted January 23, 2009 (edited) Aha it works! Thank you kind saviors!You're welcome. Edited January 23, 2009 by billthecreator [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap
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