Jump to content
Sign in to follow this  
theboydave

loop until keystroke

Recommended Posts

theboydave

I'm trying to make an autoclicker script that stops when the user presses a key. what I have right now is this:

CODE
#include <misc.au3>

Do

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 490, 325, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 365, 230, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 514, 405, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 255, 136, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 648, 327, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 433, 402, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 652, 416, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 487, 479, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 477, 508, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 490, 325, 1, 0)

MouseClick("left", 523, 118, 1, 0)

For $i = 0 to 255

if (key=0) Then

Int key = _IsPressed(Hex($i))

EndIf

Next

Until key

I don't know if that's right or not, and I am new at using AutoIt. Can somebody tell me if this will work, and if not how I can change it?

Share this post


Link to post
Share on other sites
theboydave

After some editing I have this:

CODE
#include <misc.au3>

Do

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 490, 325, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 365, 230, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 514, 405, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 255, 136, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 648, 327, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 433, 402, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 652, 416, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 487, 479, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 477, 508, 1, 0)

MouseClick("left", 523, 118, 1, 0)

MouseClick("left", 490, 325, 1, 0)

MouseClick("left", 523, 118, 1, 0)

Sleep(10000)

For $i = 0 to 255

If $key=0 Then

$key = _IsPressed(Hex($i))

EndIf

Next

Until key

but it still doesn't work :P

Share this post


Link to post
Share on other sites
BigDod

Why not just use HotKeySet, you will find it in the help file.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.