ffxionline Posted December 3, 2004 Share Posted December 3, 2004 (edited) I am want to write a script that will loop infinetly over and over again. I want it too first press 1. Then search the whole screen for a certain pixel in a 1024x768 resolution area. When it finds the pixel I want it to right click on the pixel. Then I want it to left click a few seconds after. Then loop again by pressing 1 to repeat itself infinetly. It also needs to be really accurate in detecting the pixel color. Thank you! Edited December 3, 2004 by ffxionline Link to comment Share on other sites More sharing options...
Guest Py7|-|[]/\/ Posted December 3, 2004 Share Posted December 3, 2004 What pixel? So far it would be something like: While 1 Send("1") Wend Link to comment Share on other sites More sharing options...
ffxionline Posted December 3, 2004 Author Share Posted December 3, 2004 What pixel?So far it would be something like:While 1Send("1")Wend<{POST_SNAPBACK}>Well im going to take a screenshot ingame and then use the autoitspy to get the pixel color so maybe whoever helps me can just leave that part blank. Thanks alot. Link to comment Share on other sites More sharing options...
therks Posted December 3, 2004 Share Posted December 3, 2004 (edited) You realize that searching every individual pixel in a 1024x768 area (786432 pixels!) is likely to take a long time.Actually I just tested, and on my system it took about 7 seconds to search a 1024x768 area for a pixel that didn't exist, that's not bad, especially considering that if it does find a pixel it ends a lot sooner than that.Also, what are the odds that in that many pixels, there's only going to be ONE pixel that has the specific colour you're looking for.Not trying to crap on you, just wanted to make sure you understood the potential complications in the script you're asking for.But since you want a script, it's really quite simple. So far, taking what you asked for word for word, this is what I have:$pixelColor = 0x0000ff; Color of the pixel you want to find. Adjust accordingly. $timeDelay = 3; Delay, in seconds, between the right click and the left click. Adjust accordingly. While 1 Send("1"); $pixel = PixelSearch(0, 0, 1024, 768, $pixelColor); If Not @error Then MouseClick("right", $pixel[0], $pixel[1], 1, 0); Sleep(1000*$timeDelay); MouseClick("left", $pixel[0], $pixel[1], 1, 0); EndIf WEndThat should do it. Edited December 3, 2004 by Saunders My AutoIt Stuff | My Github 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