Jump to content

Start and stop hot keys


Recommended Posts

Ok, I read the help files and saw how to set them but Its like reading russian in the dark to me. I don't know what it means.

My script is this

While 1

sleep(250)

mouseclick()

Wend

this was kindly posted by another user on this forum, who kindly told me I should be posting here.

I just want to add a start and stop key to the script.

can anyone help me?

Link to comment
Share on other sites

HotKeySet("{Home}","_MClick")
HotKeySet("{End}","_StopLoop")
HotKeySet("{ESC}","_Exit")

While 1
    Sleep (10)
Wend

Func _Exit()
    Exit
EndFunc

Func _StopLoop()
    $Loop = 0
EndFunc

Func _MClick()
    $Loop = 1
    While $Loop
        sleep(250)
        mouseclick()
    Wend
EndFunc

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

HotKeySet("{Home}","_MClick")
HotKeySet("{End}","_StopLoop")
HotKeySet("{ESC}","_Exit")

While 1
    Sleep (10)
Wend

Func _Exit()
    Exit
EndFunc

Func _StopLoop()
    $Loop = 0
EndFunc

Func _MClick()
    $Loop = 1
    While $Loop
        sleep(250)
        mouseclick()
    Wend
EndFunc

<{POST_SNAPBACK}>

You are a King among men, my friend. Thank you

Link to comment
Share on other sites

It starts paused, And Home or anyother key does not unpause it.

I trying to make a macro where a left mouse is clicking about 4-5 times per second with a loop and hot keys. Dont know if What I have is right.

THis is what I have

HotKeySet("{Home}","_MClick")

HotKeySet("{End}","_StopLoop")

HotKeySet("{ESC}","_Exit")

While 1

Sleep (10)

Wend

Func _Exit()

Exit

EndFunc

Func _StopLoop()

$Loop = 0

EndFunc

Func _MClick()

$Loop = 1

While $Loop

sleep(250)

mouseclick()

Wend

EndFunc

It sends an error also saying no paremiter in mouseclick ()

Edited by spiderous
Link to comment
Share on other sites

i dont know if this would work, because ive never used it, but you could try creating a while loop, then in the while loop have it clickin and in there with it have an adlib linking to a clicking function, sense you can set how fast the adlib runs you can make it as fast as you need it.

Link to comment
Share on other sites

Now start with it running.

End Key to stop mouse clicks

Home Key to start mouse clicks

Esc key to exit script

HotKeySet("{Home}","_MClick")
HotKeySet("{End}","_StopLoop")
HotKeySet("{ESC}","_Exit")

$Loop = 1
_MClick()

While 1
    Sleep (10)
Wend

Func _Exit()
    Exit
EndFunc

Func _StopLoop()
    $Loop = 0
EndFunc

Func _MClick()
    $Loop = 1
    While $Loop
        sleep(250)
        mouseclick("left")
    Wend
EndFunc

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

$unpause = 0
Hotkeyset("{F1}", "PAUSE")
Hotkeyset("{F2}", "UNPAUSE")

func PAUSE()
while 1
if $unpause = 1 then 
exitloop
endif
sleep(10)
wend
endfunc

func UNPAUSE()
$unpause = 1
endfunc

I think that will work.

:D

Never made a pause script before. :)

ok well a pause scipt to stop hotkeys would be

hotkeyset("somekey", "somefunc")
hotkeyset("somekey", "somefunc")
hotkeyset("somekey", "somefunc")
hotkeyset("somekey", "somefunc")
hotkeyset("{F1}", "PAUSE")
hotkeyset("{F2}", "UNPAUSE")

func PAUSE()
hotkeyset("somekey")
hotkeyset("somekey")
hotkeyset("somekey")
hotkeyset("somekey")
endfunc

func UNPAUSE()
hotkeyset("somekey", "somefunc")
hotkeyset("somekey", "somefunc")
hotkeyset("somekey", "somefunc")
hotkeyset("somekey", "somefunc")
endfunc

That would pause they hotkeys. :D

just replace the somekeys and somefunc. :evil:

Edited by WHRobin566
Witch Hunter Robin
Link to comment
Share on other sites

Just to slightly improve on WHRobin's code so that you only need to define the hotkeys once:

hotkeySet("{F1}", "pause")
hotkeySet("{F2}", "unpause")
unpause()

func pause()
    hotkeySet("someKey")
    hotkeySet("someKey")
    hotkeySet("someKey")
    hotkeySet("someKey")
endFunc

func unpause()
    hotkeySet("someKey", "someFunc")
    hotkeySet("someKey", "someFunc")
    hotkeySet("someKey", "someFunc")
    hotkeySet("someKey", "someFunc")
endFunc
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...