GrillV20 Posted November 10, 2004 Share Posted November 10, 2004 How do i add a 3 minute delay at the beginning of my script ? And once the time has elapsed i want the script to do (alt+1) for a long time until I stop the script. What would this script look like? please help ! Link to comment Share on other sites More sharing options...
JSThePatriot Posted November 10, 2004 Share Posted November 10, 2004 Okay... just for starters... look at the help file. I will guide you in the direction.Search for Sleep() (make it sit for X amount of time before continuing) HotKeySet() (for exiting the script) Loops (make it do one item over and over again) and I think the last thing you need right now is Send().You might also need to check out the WinActive() and WinActivate() functions.Please note that if you are having trouble with any particular section of a script I would be more than happy to re write or optomize it to the best of my ability. I dont want to write this script for you as it wouldnt help you learn much.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
ezzetabi Posted November 10, 2004 Share Posted November 10, 2004 A simple example for helping ya. For $c = 1 to 180 Sleep(1000) Next Link to comment Share on other sites More sharing options...
Josbe Posted November 10, 2004 Share Posted November 10, 2004 Would be more easy, only... $nMins = 3 ; Minutes Sleep(60000 * $nMins) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
JSThePatriot Posted November 10, 2004 Share Posted November 10, 2004 I always do mine as follows... Dim $delay = 3;Time in minutes that it checks the date $delay = $delay * 60 * 1000 Sleep($delay) JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
ezzetabi Posted November 10, 2004 Share Posted November 10, 2004 Why not Sleep(180000) ? The point was showing also a loop. Link to comment Share on other sites More sharing options...
JSThePatriot Posted November 10, 2004 Share Posted November 10, 2004 Why notSleep(180000)?The point was showing also a loop. <{POST_SNAPBACK}>The reason being it makes it easier to change if you use a multiplier. Your method is fine. I didnt show the loop because you did a fine job of that I was just showing how I usually do the sleep() JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Josbe Posted November 10, 2004 Share Posted November 10, 2004 Why notSleep(180000)?The point was showing also a loop. <{POST_SNAPBACK}>Too. But, I did it because he says: "I'm real new..."And If he needs increase/decrease (minutes), he only must change the variable. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
GrillV20 Posted November 10, 2004 Author Share Posted November 10, 2004 (edited) This is all i got so far (first attempt at scripting anything). Sleep (180000) Could you show me what the script would look like so i can get an idea of what i'm doing. I'm really in the dark here lol. Edited November 10, 2004 by GrillV20 Link to comment Share on other sites More sharing options...
GrillV20 Posted November 11, 2004 Author Share Posted November 11, 2004 Sleep (180000) Send ("!1") Did some more work on my own , but im not sure if its right or not. If it is i need somebody to tell me how to loop the Send ("!1") Link to comment Share on other sites More sharing options...
GrillV20 Posted November 11, 2004 Author Share Posted November 11, 2004 (edited) I want it to send it every 500ms, and I want to run the script until I decide I want it turned off. What would it look like if i could do this. Edited November 11, 2004 by GrillV20 Link to comment Share on other sites More sharing options...
scriptkitty Posted November 11, 2004 Share Posted November 11, 2004 It would look like everyone wrote it for ya: hotkeyset("{pause}","stopme") Sleep(180000) For $i = 1 to 7200 Send("!1") Sleep(500) Next func stopme() exit endfunc AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
GrillV20 Posted November 11, 2004 Author Share Posted November 11, 2004 (edited) Now that I know how the script works. Can you tell me why I get an error on line 1 of the script ? Am I copying and pasting wrong or what am I doing wrong .... ?New_Text_Document__2_.txt Edited November 11, 2004 by GrillV20 Link to comment Share on other sites More sharing options...
SlimShady Posted November 11, 2004 Share Posted November 11, 2004 (edited) Don't use Microsoft Word or Wordpad to edit your scripts. Edited November 11, 2004 by SlimShady Link to comment Share on other sites More sharing options...
erebus Posted November 11, 2004 Share Posted November 11, 2004 Now that I know how the script works. Can you tell me why I get an error on line 1 of the script ? Am I copying and pasting wrong or what am I doing wrong .... ?<{POST_SNAPBACK}>It seems to work normally to me. However:; AutoIt Version: 2.xMaybe this is the problem. I know nothing about the v2 syntax but I do know that it very very different than the current. Grap the latest AutoIT copy @ http://www.autoitscript.com/autoit3/downloads.php Link to comment Share on other sites More sharing options...
GrillV20 Posted November 11, 2004 Author Share Posted November 11, 2004 Thanks alot everyone i got it working fine (wasnt using v3 lmao). One more quick question; how do i shorten the delay to were it will press alt-1 every 500ms ? Link to comment Share on other sites More sharing options...
GrillV20 Posted November 11, 2004 Author Share Posted November 11, 2004 can u explain what this line is For $i = 1 to 7200 ive already tried changing 7200 into a smaller number but just caused my script to fail. Thats the big delay right !? 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