Jump to content

loop until keystroke


Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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


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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...