MjClarke Posted May 23, 2008 Share Posted May 23, 2008 Well, basically im I have a script to spam a key and thats it. I wanna make it hit a difference key every hour but cant seem to think how to get it to work. I need some help on this one Func Start() ; While $i <= 1000000000000000000000000000000 ControlSend("Notepad", "", "Edit2", "Hello, World!") ; Sleep(500 $i = $i + 1 WEnd EndFunc Now the way I think about this is that, if I stick it in the while, it will loop but it will hit the different key then wait and hour, go through the loop once and do it again. the basis of what I want it to do is hit the number 6 key, start typing in notepad "Hello, World!" until the hour is up on the number 6 key timer then hit 6 again and start spamming notepad. Any ideas how I can get this done? And yes, I know my loop is inneficient, but I dont care. Link to comment Share on other sites More sharing options...
covaks Posted May 23, 2008 Share Posted May 23, 2008 I'm not sure I understood. Try this for now. When you hit 6, it will start spamming notepad with "Hello World!" over and over for an hour. Assumes of course that notepad is already open. HotKeySet("6","Go") While 1 Sleep(10) WEnd Func Go() $StartTime = @MIN&@SEC Sleep(1000) Do ControlSend("Untitled - Notepad","","Edit1","Hello World{!}") Until @MIN & @SEC = $StartTime EndFunc Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 23, 2008 Share Posted May 23, 2008 That would be more like this: #include <Misc.au3> Main() Func Main() HotKeySet("{ESC}", "_Quit"); have a way to kill it HotKeySet("6", "_HitSix") While 1 Sleep(50) WEnd EndFunc ;==>Start Func _HitSix() ; clear hot key HotKeySet("6") Local $iTimer = TimerInit() Do ControlSend("Untitled - Notepad", "", "Edit1", "Hello, World!" & @CRLF, True); Raw flag set Sleep(500) Until TimerDiff($iTimer) > 60 * 60 * 1000; 1 hour ; restore hot key HotKeySet("6", "_HitSix") EndFunc Func _Quit() Exit EndFunc Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
MjClarke Posted May 23, 2008 Author Share Posted May 23, 2008 No, lol. Thats not what I was trying to do. I want to make it hit 5 constantly, never ending and only hit 6 once per hour Is that a little better? Not too good at explaining whats in my head Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now