Sign in to follow this  
Followers 0
mnemonic

help a newbie with a simple script?

5 posts in this topic

Hi. :lmao:

trying to make a script that loops sending some keystrokes like every 30 sec or so.

to be specific I want the script to send the following keys and mouseclicks.

a 5 followed by a right mouse click

pause for 20 secs and then repeat

preferably I would like this so I can toggle the script on and off with a hotkey and maybe also that it can be incorporated in a scripf file along with other future similar macros.

Btw, I have been struggling myself with the help files etc to do this but Im not a coder. I can get it to work sortof but the loop is malfunctiong...........

Help a poor new member. Thanks :P

Share this post


Link to post
Share on other sites



Try This:

Hotkeyset("{HOME}","start")
Hotkeyset("{END}","stop")

Func start()
$start = 0
DO
Send("{5}")
MouseClick("right")
Sleep(20000)
Until $start = 1
EndFunc

Func stop()
if $start = 0 Then
$start = 1
Else
$start = 0
Endif
EndFunc

[size=20]My File Upload[/size]Register at my site and upload.

Share this post


Link to post
Share on other sites

altho I cant get it to work............. am I an idiot or does anyone see any errors in the script?

Try This:

Hotkeyset("{HOME}","start")
Hotkeyset("{END}","stop")

Func start()
$start = 0
DO
Send("{5}")
MouseClick("right")
Sleep(20000)
Until $start = 1
EndFunc

Func stop()
if $start = 0 Then
$start = 1
Else
$start = 0
Endif
EndFunc

Share this post


Link to post
Share on other sites

Try

Hotkeyset("{HOME}","start")
Hotkeyset("{END}","stop")
dim $start
while 1
    sleep(100)
    WEnd
Func start()
$start = 0
DO
Send("{5}")
MouseClick("right")
Sleep(20000)
Until $start = 1
EndFunc

Func stop()
if $start = 0 Then
$start = 1
Else
$start = 0
Endif
EndFunc

You need the loop to keep the script alive.



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  
Followers 0