Sign in to follow this  
Followers 0
Tuurngait

Sequencing keys confused

12 posts in this topic

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?

Share this post


Link to post
Share on other sites



also i forgot to mention, it'd need a trigger as well say everytime you pressed the right mouse key (not held :S)

Share this post


Link to post
Share on other sites

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

well it's more just for entertainment than using an actually app to support it. so i don't mind if it's really really messy

Share this post


Link to post
Share on other sites

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

i got the first bit (because it's easy) but the trigger bit, i struggle on. i can't find a functino that grants the same as "ispressed" :s

Share this post


Link to post
Share on other sites

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


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

because that would be embarrasing

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

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

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

i managed to make it a hotkey script with the line "hotkeyset("{esc}",togglepause") but iw as struggling into turning it into a click

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

  • Similar Content

    • nacerbaaziz
      By nacerbaaziz
      Hello
      How are you
      I have a question, please.
      I've created a window and i need
      when i run the script if it detect an other copy from the same script was runing
       the script close the first copy Automatically and run a new copy
      I want an example to understand it
    • Nareshm
      By Nareshm
      Please Somebody Help me i am trying to create new script but, i don't know how to create it.

      I am Creating script like this :
      ; My script here [First Script]
      Check the internet connection, if internet connected then
      ; My Script here [Second Script]
      If internet not connected, wait for connect, after connected run my second script
      If Control id/windows/title matched do nothing and end/exit autoit script
      If Control id/windows/title not matched repeat my first and second script again until control id/windows/tittle not matched

      match with :
      >>>> Window <<<<
      Title:    PS :: Version - 2.8.0.0  - [PS Bill]
      Class:    WindowsForm734a
      Position:    -8, -8
      Size:    1382, 744
      Style:    0x17CD0000
      ExStyle:    0x00050100
      Handle:    0x0000000000130572
      >>>> Control <<<<
      Class:    WindowsForm734a
      Instance:    15
      ClassnameNN:    WindowsForm34a15
      Name:    BillPrint
      Advanced (Class):    [NAME:BillPrint]
      ID:    7875
      Text:    
      Position:    39, 310
      Size:    1221, 306
      ControlClick Coords:    745, 20
      Style:    0x56010000
      ExStyle:    0x00000000
      Handle:    0x00000000000C0468
       
    • JustinZandee
      By JustinZandee
      I need a random string generator which creates 15 letters/numbers.
      How can I make that?
    • nacerbaaziz
      By nacerbaaziz
      Hi dears
      How are you?
      I have a question, to you please.
      How do I create an edit box for numbers only and does not accept letters? using autoit
      greetings to all
      I hope you help ME
      Thanks to all in advance
    • StudioMaker
      By StudioMaker
      Hey anyone knows how i can have a inputbox that is connected to an HotKeySet? Like if u put in like "a" in the inputbox it sets the hotkey to "a"?