Sign in to follow this  
Followers 0
Orgins

I can't send the number 6? in a func?

3 posts in this topic

#1 ·  Posted (edited)

So is it just me or can no one send it in a func?

HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("6", "Six")

$value = 6

While 1
    Sleep(100)
WEnd



Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc



Func Terminate()
    Exit 0
EndFunc



Func Six()
    $i = 0
Do
    Send($value)
    $i = $i + 1
Until $i = 100
EndFunc
Edited by Orgins

I'm a newbie.Sorry if I don't reposed to your replays very fast.

Share this post


Link to post
Share on other sites



Send(6) triggers the hotkey again ! As mentioned in the helpfile...

To Send() a key combination which will trigger a HotKeySet() event, either use ControlSend() or unregister

the HotKeySet() event, otherwise, the Send() event may trigger an infinite loop.

HotKeySet("6", "Send6")
Send6()

Func Send6()
    HotKeySet("6")
    Send(6)
    HotKeySet("6", "Send6")
EndFunc

Share this post


Link to post
Share on other sites

oooooo. Didn't think about that. My bad


I'm a newbie.Sorry if I don't reposed to your replays very fast.

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