Jump to content

Recommended Posts

Okay, I'm guessing after a while my posts are becoming annoying so I'll try to make this my last question. I've been trying to guess how to make a sequence of actions in a timed difference for example "(action of num key 1) 0.5 second delay from (action of num key 2)" again to try to simplify 1, (0.5 secs) 2 (1.0 secs) 3 (1.5 secs) [1,2,3 being the keys on the keyboard]. so basically i have no idea how to do this but it'd be interesting to mess about with and fiddle with so, anyone know?

Link to comment
Share on other sites

  • Moderators

Hi, Tuurngait. What application specifically are you trying to send commands to? Sending keystrokes is often messy, but your application may support using ControlClick or ControlSend.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

Then I would suggest looking in the Helpfile for Send and Sleep. Something like this:

Send("A")
Sleep(250)
Send("B")
Sleep(250)

For triggering it, look in the help file under HotKeySet and _IsPressed.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

Once again, Tuurngait. The help file is your friend. What about _IsPressed is not working for you. How about you try posting some code for a change :D

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

"Hotkeyset("{Mouse2}" "Ispressed")

While 1

Sleep(10)

func ispressed()

if {mouse2}

Then

send ("1")

sleep (250)

send ("2")

sleep (250)

send ("3")

sleep (250)

send ("4")

WEnd

" is what i got which is completely wrong and i know that because it keeps telling me xD

Link to comment
Share on other sites

  • Moderators

Try this to get an idea of how to code it yourself. Open Notepad first.

#include <Misc.au3>
Local $hDLL = DllOpen("user32.dll")
While 1
If _IsPressed("02", $hDLL) Then
Sleep(250)
WinActivate("[CLASS:Notepad]")
Sleep(250)
Send("a")
Sleep(250)
Send("b")
Sleep(250)
Send("c")
EndIf
WEnd
DllClose($hDLL)

Edit: This is almost exactly the example script in the help file under _IsPressed

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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

×
×
  • Create New...