Jump to content

How Can I Press "1", "2", "3" with the delay of seconds per press?


 Share

Recommended Posts

Dude you need to put forth a little effort. Next time post your code. If someone tells you a command (send and sleep) go and look at the help files. They have examples on how to use them. They are probably the most helpful help files I have ever seen. Here is the code you want. This doesnt help you any when someone just gives you the answer.

HotKeySet("{=}", "_First")
HotKeySet("{ESC}", "_Quit")

; Run Notepad
Run("notepad.exe")

; Wait for the Notepad become active - it is titled "Untitled - Notepad" on English systems
WinWaitActive("Untitled - Notepad")

While 1
Sleep(10)
WEnd

Func _First()
    Send(1)
    Sleep(1500)
    Send(2)
    Sleep(1000)
    Send(3)
EndFunc

Func _Quit()
    Exit
EndFunc
Link to comment
Share on other sites

Dude you need to put forth a little effort. Next time post your code. If someone tells you a command (send and sleep) go and look at the help files. They have examples on how to use them. They are probably the most helpful help files I have ever seen.

look up processexists

Giggity

Link to comment
Share on other sites

HotKeySet("{=}", "_First")

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

WinWaitActive("Untitled - Notepad")

While 1

Sleep(10)

WEnd

Func _First()

Send("{1}")

Sleep(1500)

Send("{2}")

Sleep(1000)

Send("{3}")

EndFunc

Func _Quit()

Exit

EndFunc

Is My script Right?

Link to comment
Share on other sites

You dont need WinWaitActive("Untitled - Notepad"). That code will send 1,2,3 anytime = is pressed. You can be in word, or notepad and it will send 123. You just have to have the window you want to use set to active (meaning on top).

Link to comment
Share on other sites

Is it right for mouse to move in that position then press Mouse 2?

MouseClick("right",304,278,1,5)
(Sleep 6500)
MouseClick("right",304,278,1,5)
(Sleep 6000)
MouseClick("right",304,278,1,5)
(Sleep 4000)
MouseClick("right",304,278,1,5)
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...