loop until i press a key - Ask for Help - AutoHotkey Community

文章推薦指數: 80 %
投票人數:10人

i really have a problem with this... here's a example: loop { Send, text1{enter} Send, text2 Esc:break } and it only executes what's in the ... Jumptocontent SignIn CreateAccount Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate AutoHotkey Forums Members Search Advanced Searchsection: Thistopic Forums Members HelpFiles FacebookTwitter AutoHotkeyCommunity AutoHotkey AskforHelp ViewNewContent loopuntilipressakey Startedby Twinsen ,Jan24200608:28PM Pleaselogintoreply 14repliestothistopic Twinsen Guests Lastactive: Joined:-- ireallyhaveaproblemwiththis...here'saexample:loop { Send,text1{enter} Send,text2 Esc:break }anditonlyexecuteswhat'sinthelooponceiwantthelooptorepeatuntilipressEscthankyou #1 - Posted24January2006-08:28PM Backtotop Chris Administrators 10727posts Lastactive: Joined:02Mar2004 ThereisanexampleofhowtodothisintheFAQ. #2 - Posted24January2006-09:09PM Backtotop Twinsen Guests Lastactive: Joined:-- Ijustcan'tgetittowork...here'smycode:menu: Hotkey,F2,sh2 Hotkey,F1,sh1 return sh1: { Loop, { SetKeyDelay,5,5 Send,{tab}%pass% SetKeyDelay,500,80 Send,{enter}{enter}{enter} esc::break } } gotomenu sh2: { InputBox,pass,Enterpass,Enteryourpassword:,HIDE,190,120 RegWrite,REG_SZ,HKEY_CURRENT_USER,Software\AutoHotkey,,%pass% } gotomenuinthesh1'sloopiwantittostopwenipressEsc #3 - Posted25January2006-01:15PM Backtotop toralf Moderators 4035posts Lastactive:Aug20201404:23PM Joined:31Jan2005 Youhaven'thappentoreadthepartintheFAQthatChrispointedyoutoo,right? PleasereadthepartintheFAQwhichisnamed"Howcanarepeatingactionbestoppedwithoutexitingthescript?". #4 - Posted25January2006-01:31PM Ciaotoralf IusethelatestAHKversion(1.1.15+)Pleaseaskquestionsinforumonahkscript.org.Why?ForonlinereferencepleaseusetheseDocs. Backtotop polyethene Members 5519posts Lastactive:May17201506:39AM Joined:26Oct2012 HereisadirectlinktotheFAQ:Howcanarepeatingactionbestoppedwithoutexitingthescript?Thenicethingaboutthehelpdocsisthatyoucanfollowtheexamplesandworkaroundthemtogetwhatyouwant.TheexamplescriptintheFAQclearlyexplainshowyoucanachieveakindofloopthatyouwant. #5 - Posted25January2006-01:47PM Backtotop Twinsen Guests Lastactive: Joined:-- IhavereadthatsectionoftheFAQ.butiwantittostopwenipressaotherkey.AlsoIcan'tmakeitworkwithmyprogram.Here'sthemodifiedone:#MaxThreadsPerHotkey3 #z::;Win+Zhotkey. #MaxThreadsPerHotkey1 ifKeepWinZRunning=y;Thismeansanunderlyingthreadisalreadyrunningtheloopbelow. { KeepWinZRunning=;Makeitblanktosignalthatthread'slooptostop. return;Endthisthreadsothattheoneunderneathwillresumeandseethechange. } ;Otherwise: KeepWinZRunning=y Loop, { SetKeyDelay,5,52 Send,{tab}%pass% SetKeyDelay,50,80 Send,{enter}{enter}{enter} ifKeepWinZRunning=;TheusersignaledthelooptostopbypressingWin-Zagain. break;Breakoutofthisloop. } KeepWinZRunning=;Resetinpreparationforthenextpressofthishotkey. returnIpresswin+zanditstartsrepeating...butican'tstopit! #6 - Posted25January2006-03:19PM Backtotop Twinsen Guests Lastactive: Joined:-- here'sanotherwayitried...gotitfromherehttp://www.autohotke...opic.php?t=4648:Hotkey,F2,sh2 F1:: StopLoop:=False Loop, { SetKeyDelay,5,52 Send,{tab}%pass% SetKeyDelay,50,80 Send,{enter}{enter}{enter} ifStopLoop break } return Esc:: StopLoop:=True return sh2: { InputBox,pass,Lineage2Auto-Login,Enteryourpassword:,HIDE,190,120 RegWrite,REG_SZ,HKEY_CURRENT_USER,Software\AutoHotkey,,%pass% }pleasetellmewhatdididowrongbecauseican'tunderstanditstartsrepeatingandican'tstopit #7 - Posted25January2006-03:56PM Backtotop toralf Moderators 4035posts Lastactive:Aug20201404:23PM Joined:31Jan2005 F1:: StopLoop:=False Loop, { ToolTip,%A_Index% ifStopLoop break } return Esc:: StopLoop:=True return Doesthiswork? #8 - Posted25January2006-03:59PM Ciaotoralf IusethelatestAHKversion(1.1.15+)Pleaseaskquestionsinforumonahkscript.org.Why?ForonlinereferencepleaseusetheseDocs. Backtotop Twinsen Guests Lastactive: Joined:-- Yes,itworks...itseemsitdosen'tworkbecauseoftheSendcommand(inmyexamples) #9 - Posted25January2006-04:15PM Backtotop Twinsen Members 26posts Lastactive:Feb11201109:40AM Joined:25Jan2006 WhenIeliminatetheSendcommandinmyscriptstheywork. #10 - Posted25January2006-04:21PM Backtotop toralf Moderators 4035posts Lastactive:Aug20201404:23PM Joined:31Jan2005 Theremightbeaproblemwiththepass,ifitcontainscharsthatarenotsupportedbySend.ForthepassIwoulduseSendRaw,sothattheexactphraseissend. ButIwonder,whyyouneedtosendthepasssofastandsooftenaftereachother.Whatkindofsoftwareareyouworkingon? EDIT:Sendtreatsthesecharsasmodifiers:!#+^{} #11 - Posted25January2006-04:26PM Ciaotoralf IusethelatestAHKversion(1.1.15+)Pleaseaskquestionsinforumonahkscript.org.Why?ForonlinereferencepleaseusetheseDocs. Backtotop Twinsen Members 26posts Lastactive:Feb11201109:40AM Joined:25Jan2006 theproblemisnotwithpass.Ileavethescriptlikethis:F1:: StopLoop:=False Loop, { Send,{enter}{enter}{enter} ifStopLoop break } return Esc:: StopLoop:=True returnandstillitdosen'tletmestopitEDIT:isentitsofastnowsoiseehowitworks.Wheni'llfinishwiththisproblemiwilltweakitwithSetKeyDelay #12 - Posted25January2006-04:34PM Backtotop Twinsen Members 26posts Lastactive:Feb11201109:40AM Joined:25Jan2006 Comeon...whyisittakingsolong?! cansomebodytellmewhyisn'titworkingasitshould?? ithoughtiwillgetasolutionin20minutes,andafter2daysistillcan'tmakeitwork #13 - Posted26January2006-11:36AM Backtotop toralf Moderators 4035posts Lastactive:Aug20201404:23PM Joined:31Jan2005 Pleaseinserta"Sleep,10"intotheloop.ThenitworksonmyPC. #14 - Posted26January2006-11:45AM Ciaotoralf IusethelatestAHKversion(1.1.15+)Pleaseaskquestionsinforumonahkscript.org.Why?ForonlinereferencepleaseusetheseDocs. Backtotop Twinsen Members 26posts Lastactive:Feb11201109:40AM Joined:25Jan2006 Yes!!itworks.IwasusingaSetKeyDelay,200anditwasn'tworking,butnowwithsleep,200worksperfectly! Thankyou! #15 - Posted26January2006-03:22PM Backtotop BacktoAskforHelp Replytoquotedposts     Clear    AutoHotkeyCommunity →AutoHotkey →AskforHelp CommunityForumSoftwarebyIP.BoardLicensedto:AutoHotkeyFoundationLLC ChangeTheme IP.Board IP.BoardMobile Ortem English(USA) English(USA) Deutsch PrivacyPolicy Help SignIn  UseFacebook  UseTwitter Registernow! Usernameoremail: I'veforgottenmypassword ForumPassword Rememberme Thisisnotrecommendedforsharedcomputers Signinanonymously Don'taddmetotheactiveuserslist



請為這篇文章評分?