Jump to content

help a newbie with a simple script?


mnemonic
 Share

Recommended Posts

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

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


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...