Sign in to follow this  
Followers 0
ffxionline

Help me with script

4 posts in this topic

#1 ·  Posted (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 by ffxionline

Share this post


Link to post
Share on other sites



What pixel?

So far it would be something like:

While 1

Send("1")

Wend

Share this post


Link to post
Share on other sites

What pixel?

So far it would be something like:

While 1

Send("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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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
WEnd

That should do it.

Edited by Saunders

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0