Rauchster Posted July 17, 2006 Posted July 17, 2006 Is there anyway to include a Sleep command the same line as another command? Example: I want to create a very long script that constantly inputs data into a program, but I need a delay between data sends or else program gets overflow error and script shuts down. I need something that I can just add on to the end of the line instead of having to insert over 1000 Sleep commands manually(since that'd take REALLY long amounts of time that I dont have ), because since all the input command end with the same thing I can do a find / replace all. Send ("XXXXX{Enter}") Sleep (250) Send ("YYYYY{Enter}") Sleep (250) Send ("ZZZZZ{Enter}") Sleep (250) I want to have something like this (Using example of commands from ACTool Keys=Send / | = is quick command for sleep) Keys (XXXXX{Enter}) | 250 Keys (YYYYY{Enter}) | 250 Keys (ZZZZZ{Enter}) | 250 If nothing exists currently, how would I go about creating a custom (user-defined) quick command to do just that?
MHz Posted July 17, 2006 Posted July 17, 2006 A small User Defined Function may suit. ; Call the UDF Keys('XXXXX{Enter}', 500) ; Use default 250 ms sleep Keys('XXXXX{Enter}') Func Keys($text, $time = 250) Send($text) Sleep($time) EndFunc
Rauchster Posted July 17, 2006 Author Posted July 17, 2006 A small User Defined Function may suit. ; Call the UDF Keys('XXXXX{Enter}', 500) ; Use default 250 ms sleep Keys('XXXXX{Enter}') Func Keys($text, $time = 250) Send($text) Sleep($time) EndFunc Amazing what a name change for a command can do. I was looking and looking for Custom Command which was what it was called. UDF huh? I'll give it a shot. Thanks
MHz Posted July 17, 2006 Posted July 17, 2006 Yes, have a look at Language Reference -> Functions in the helpfile
Rauchster Posted July 17, 2006 Author Posted July 17, 2006 Ok - I tried to create a UDF - and Im getting an error message about too many parameters in Call Function. Here is a sample my code. (The game is WordWhomp on Pogo.com, It's a word jumble game, hence the large amount of data to be inputted.) $WWTimeDelay = 75 ;--------------------------------------------------------- Func WordWhomp($WWText,$WWTimeDelay) Send ($WWText) Sleep ($WWTimeDelay) EndFunc ;--------------------------------------------------------- Call (WordWhomp ("abide{enter}{bs}{bs}{bs}{bs}{bs}{bs}"), ) The Call Function keeps erroring. I've tried all the following Call WordWhomp ("abed{enter}{bs}{bs}{bs}{bs}{bs}{bs}") Call (WordWhomp ("abed{enter}{bs}{bs}{bs}{bs}{bs}{bs}")) Call (WordWhomp ("abed{enter}{bs}{bs}{bs}{bs}{bs}{bs}"), 75) Not sure what parameters I'm missing/have extra What have I done wrong???
Xenobiologist Posted July 17, 2006 Posted July 17, 2006 HI, try $WWTimeDelay = 75 ;--------------------------------------------------------- Func WordWhomp($WWText, $WWTimeDelay) Send($WWText) Sleep($WWTimeDelay) EndFunc ;==>WordWhomp ;--------------------------------------------------------- WordWhomp("abide{enter}{bs}{bs}{bs}{bs}{bs}{bs}", $WWTimeDelay) So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
Rauchster Posted July 17, 2006 Author Posted July 17, 2006 tried it word for word letter for letter - didn't work. Something's weird here....
GaryFrost Posted July 17, 2006 Posted July 17, 2006 give this a try, set it so you could see it happen, the original went pretty fast, if you blinked you would miss it. Run("Notepad") WinWait("Untitled") $WWTimeDelay = 75 WordWhomp("abide{enter}", $WWTimeDelay) Sleep(3000) WordWhomp("{bs}{bs}{bs}{bs}{bs}{bs}", $WWTimeDelay) ;--------------------------------------------------------- Func WordWhomp($WWText, $WWTimeDelay) Send($WWText) Sleep($WWTimeDelay) EndFunc ;==>WordWhomp ;--------------------------------------------------------- SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Richard Robertson Posted July 17, 2006 Posted July 17, 2006 Call is for calling by string name. Call("WordWhomp", "abide{enter}{bs}{bs}{bs}{bs}{bs}{bs}")oÝ÷ Ø&¥+¢¼!z|¨¹ªÞq©exw)Ú'ºw-ð'!¬yØ}êÞÛ.r¬jëh×6Call($functionname, $param1, $param2)oÝ÷ ج¶ëjëh×6WordWhomp("abide{enter}{bs}{bs}{bs}{bs}{bs}{bs}")
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