Sign in to follow this  
Followers 0
Nihilum

Script Request, an easy one.

7 posts in this topic

I'm searching for a easy script that:

Sleep 10s and then:

Shift key pressing every 100ms (SendKeyDelay= 100), and pressed for 10ms (SendKeyDownDelay=10). It ends when I Press ESC.

I'm asking for it because I can't make HotKeySet to work -.-

I know I'm very newbie.

Thanks in advance

Share this post


Link to post
Share on other sites



Shift key pressing every 100ms (SendKeyDelay= 100), and pressed for 10ms (SendKeyDownDelay=10). It ends when I Press ESC.

I'm asking for it because I can't make HotKeySet to work with ESC and another question:

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

Do

Opt ("SendKeyDelay", 1000)

Opt ("SendKeyDownDelay", 500)

Send ("+", 1)

until what i have to write here if i want it to be repeated until I press ESC?

Func MyExit()

Exit

EndFunc

Thanks in advance

Cannot edit

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

HotKeySet("{ESC}", "MyExit")
AdlibEnable ( "Press",100)
While 1
WEnd

Func Press()
    ;Opt("SendKeyDelay", 1000)
    Opt("SendKeyDownDelay", 500)
    ;Send("{LSHIFT}", 1)
    Send("K", 1)
EndFunc

Func MyExit()
    Exit
EndFunc   ;==>MyExit

You may get different results by uncommenting ;Opt("SendKeyDelay", 1000)

Edited by weaponx

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I'm searching for a easy script that:

Sleep 10s and then:

Shift key pressing every 100ms (SendKeyDelay= 100), and pressed for 10ms (SendKeyDownDelay=10). It ends when I Press ESC.

I'm asking for it because I can't make HotKeySet to work -.-

I know I'm very newbie.

Thanks in advance

What did you need HotKeySet for? To check for the ESC? I'm not too good with Autoit either, but maybe I can help.

#include <Misc.au3>;This library is needed for the IsPressed function
Opt("SendKeyDownDelay",10)

Sleep(10000)
While 1;infinite loop
    if _IsPressed("1B") Then;This checks to see if a key is pressed, 1B is the hex code for the ESC key
        ExitLoop;       
    EndIf
    Sleep(100)
    Send("{LSHIFT}");presses the left shift key
WEnd

I hope that helps. Note that I didn't use the sendkeydowndelay option.

edit: Snap. I took so long replying that someone beat me to it <_<

Edited by Nevin

Share this post


Link to post
Share on other sites

Nevin what is the purpose of Sleep(10000)?

Share this post


Link to post
Share on other sites

thanks alot mates you've helped me so much you both

Share this post


Link to post
Share on other sites

Nevin what is the purpose of Sleep(10000)?

In the first post he said he wanted the script to "Sleep 10s" first.

thanks alot mates you've helped me so much you both

Glad to be of help.

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