Log in

View Full Version : Developing a script



basestati0n
05-06-2012, 10:55 PM
Hi there,

I'm trying to write a script that will look for a colour on the screen and click it. Ideally, what I'd like to do is somehow write a line of code that, once a set of coordinates has been clicked, will ignore them for a given period of time.

e.g. mouse clicks at coordinates 121, 321 - I want the script then to ignore anything that happens at coordinates 121, 321 for x milliseconds

I know this should be possible, I'm just struggling with the logic!

Any help is appreciated,
Thanks in advance :)

Google
05-06-2012, 11:15 PM
For static clicking > clicking certain coords on the screen put the coords in for X,Y, then 0,0 is the random pixel shift. What are you trying to click?

Not Sure If i understood this correctly sorry if i didn't
MMouse(X,Y,0,0); SO MMouse(121, 321,15,15);

MMouse(121,321,15,15);
Wait(150 + Random(50)): // Will Move The Mouse To The Coords And Give a Small Wait
Clickmouse2(True);
Wait();//< Fill out how much time you want to wait here.

basestati0n
05-06-2012, 11:30 PM
Wow, thanks for your quick reply! The random mouse shift is quite a neat little trick (didn't know about that!).

Essentially, the script is designed a for a game where the shooter is in the centre of the screen and objects move towards the shooter - if the object gets to the shooter, game over. I've got the script that identifies the colours properly and automatically clicks the objects, which is cool.

Problem is, once the object has been clicked (it remains on the screen for a short period of time), the script keeps on clicking at the same object until it disappears (instead of moving to another object) - allowing other objects to reach the centre instead, thus ending the game!

When several objects come onto the screen at once, obviously the script has trouble keeping up as it stays clicking the (now stationary) "dead" object.

Any ideas how to get around this?