 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Rotti Guest
|
Posted: Tue Nov 03, 2009 4:30 pm Post subject: macro help needed |
|
|
Not sure if this is possible but i have been trying to figure out a macro that can do the following keystrokes
3 every 15 seconds
5 every 10 seconds
4 every 12 seconds
contine to hit 0 if none of the timers are up
Does anyone know if this is possible |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
Posted: Tue Nov 03, 2009 5:20 pm Post subject: |
|
|
Try: | Code: | #Persistent
SetTimer, Send0,100
SetTimer, Send3, 15000
SetTimer, Send5, 10000
SetTimer, Send4, 12000
Return
Send0:
Send3:
Send4:
Send5:
Thread,NoTimers
;SendInput % "{" . SubStr(A_ThisLabel,0) . "}"
ToolTip % "Sending " . SubStr(_ .= SubStr(A_ThisLabel,0),-100)
Return
Escape::ExitApp |
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
rotti Guest
|
Posted: Tue Nov 03, 2009 6:42 pm Post subject: |
|
|
That seems to be very close
Im not sure what this does
Thread,NoTimers
;SendInput % "{" . SubStr(A_ThisLabel,0) . "}"
ToolTip % "Sending " . SubStr(_ .= SubStr(A_ThisLabel,0),-100)
Return
i just need it to send the key strokes in whatever program i am in
notepad for example |
|
| Back to top |
|
 |
Carcophan
Joined: 24 Dec 2008 Posts: 768 Location: :noitacoL
|
Posted: Tue Nov 03, 2009 6:50 pm Post subject: |
|
|
| rotti wrote: |
Thread,NoTimers
WinActivate, your_window_name_here (use WindpwSpy)
SendInput % "{" . SubStr(A_ThisLabel,0) . "}" ;uncomment this
;ToolTip % "Sending " . SubStr(_ .= SubStr(A_ThisLabel,0),-100) ;comment this out
Return
i just need it to send the key strokes in whatever program i am in
notepad for example |
Tell it to activate your window, and use the 'send input' as opposed to the 'tool tip' in the example which was a test/demonstration. _________________ "Unfortunately a "COM for Dummies" book would be a little like "Neurosurgery for Dummies," in the end you're just gonna have to learn" ~Tank |
|
| Back to top |
|
 |
rotti Guest
|
Posted: Tue Nov 03, 2009 7:15 pm Post subject: |
|
|
Tried this using 2 as my hotkey but doesn't seem to work
2::
while GetKeyState("2", "P")
SetTimer, Send0,100
SetTimer, Send3, 15000
SetTimer, Send5, 10000
SetTimer, Send4, 12000
Return
Send0:
Send3:
Send4:
Send5:
Thread,NoTimers
WinActivate, New Text Document.txt - Notepad,
Return
Escape::ExitApp |
|
| Back to top |
|
 |
rtcvb32
Joined: 17 Feb 2008 Posts: 125
|
Posted: Tue Nov 03, 2009 7:54 pm Post subject: |
|
|
I suggest you surround your code in blocks.
First, your while doesn't have brackets {} so the surrounding code isn't blocked together, rather the line IMMEDIATELY following will be looped, not the whole thing. I think where you placed your while block is probably wrong.
Second, if it were to include the whole thing, it only activates the Notepad, nothing else. Tooltip was a good idea as it would let you see the timing
Why does WinActivate have an comma at the end?
Lastly i suggest you read from the helpfile what the commands do, it's very well documented. We can assist if you don't understand.
The first posted suggestion looks great in my opinion, uncomment the sendinput and add a IfWinActive check. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|