Jump to content

Recommended Posts

Posted

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

Example:

I would like to press "1" then after 1.5 seconds ill press "2" and after 1 second ill press "3"

Can anybody help me?

Posted

Have your program open note pad, then set = as a hot key. If the numbers are automatically inserted then you can just set If = key send 6 (assuming your adding)

Giggity

Posted

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
Posted

I personally didn't attempt to come to the forum until I had completed all the tutorials and tried doing things I wanted by going through the help file. The very first tutorial will tell you how to start your script.

Giggity

Posted

thanks Smiley for the help..

i really appreciate it..

but 1 thing again, what if I was already running may Notepad? Is there a way that after I press "=" the script will run

Posted

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

Posted

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?

Posted

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).

Posted

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)

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
×
×
  • Create New...