Arkbound Posted July 14, 2007 Share Posted July 14, 2007 Hi im new here, and new to AutoIT programming. i know a bit of programming with Turing if that helps. I'm currently trying to make a program that will initiate/pause/stop when a certain button is pushed. When initiated, i want the program to be able to press a key with a configurable delay, and press another key at another configurable delay. For Example. loop 1. Press Tab (delay 1 minute until next click) 2. Press "4" 14 times with 4 second delay between each one 3. Press Tab (delay 10 seconds) end loop so it keeps going and goin doing that script until i turn it off. What commands would i need to do this? If someone is willing, can someone make a script of this loop? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 14, 2007 Developers Share Posted July 14, 2007 Hi im new here, and new to AutoIT programming. i know a bit of programming with Turing if that helps.I'm currently trying to make a program that will initiate/pause/stop when a certain button is pushed. When initiated, i want the program to be able to press a key with a configurable delay, and press another key at another configurable delay. For Example.loop1. Press Tab (delay 1 minute until next click)2. Press "4" 14 times with 4 second delay between each one3. Press Tab (delay 10 seconds)end loopso it keeps going and goin doing that script until i turn it off. What commands would i need to do this? If someone is willing, can someone make a script of this loop?Welcome What have you tried/done yourself to get it done ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Arkbound Posted July 14, 2007 Author Share Posted July 14, 2007 Welcome What have you tried/done yourself to get it done ?i've looked in the help file for similar Turing commands. But since they are different languages, its hard to find matches. I know there are no "loop" commands, is it a "while" command now?Well all i've done so far is search through the help file. I've found mouse clicks but i dont think that'll work with what im trying to do Link to comment Share on other sites More sharing options...
MHz Posted July 14, 2007 Share Posted July 14, 2007 i've looked in the help file for similar Turing commands. But since they are different languages, its hard to find matches. I know there are no "loop" commands, is it a "while" command now?Well all i've done so far is search through the help file. I've found mouse clicks but i dont think that'll work with what im trying to doWelcome,You seem very new indeed to AutoIt. How about trying Valuator's AutoIt 1-2-3 tutorial to get you up to speed a little. You may enjoy the experience and also learn through using it. Link to comment Share on other sites More sharing options...
Zedna Posted July 14, 2007 Share Posted July 14, 2007 (edited) Look into helpfile at these commands and examples: While Send() Sleep() Edited July 14, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Arkbound Posted July 14, 2007 Author Share Posted July 14, 2007 Welcome,You seem very new indeed to AutoIt. How about trying Valuator's AutoIt 1-2-3 tutorial to get you up to speed a little. You may enjoy the experience and also learn through using it.Well i just looked through it, it seems to have alot of GUI lessons, and im not really that far yet T.TAlso the AutoIT 123, i got stuck on a survey thing. i filled everything and still the next button doesnt pop. Link to comment Share on other sites More sharing options...
Arkbound Posted July 14, 2007 Author Share Posted July 14, 2007 (edited) New Problem While 1 if _IsPressed("23") Then While 1 $loop = 0 Send("TAB",1) While $loop <= 11 Send("4",1) sleep(500) $loop = $loop + 1 Wend Send ("TAB",1) sleep (1000) Wend endif WEnd Im trying to put in a stop button, when i try to insert 'if _IsPressed("24") Then Exit Endif" statements like this: While 1 if _IsPressed("23") Then While 1 if _IsPressed("24") Then Exit Endif $loop = 0 Send("TAB",1) While $loop <= 11 if _IsPressed("24") Then Exit Endif Send("4",1) sleep(500) $loop = $loop + 1 Wend Send ("TAB",1) sleep (1000) if _IsPressed("24") Then Exit Endif Wend endif WEnd It then doesnt work, saying im missing "WEnd" Also how do i convert it into an exe file? Edited July 14, 2007 by Arkbound Link to comment Share on other sites More sharing options...
Arkbound Posted July 14, 2007 Author Share Posted July 14, 2007 bump Link to comment Share on other sites More sharing options...
Generator Posted July 14, 2007 Share Posted July 14, 2007 Maybe try this... #include<misc.au3> Do Send("{TAB}") Sleep(60000) For $i=1 to 14 Send("4") Sleep(4000) Next Send("{TAB}") Sleep(10000) Until _IsPressed("24") Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 15, 2007 Share Posted July 15, 2007 New Problem While 1 if _IsPressed("23") Then While 1 $loop = 0 Send("TAB",1) While $loop <= 11 Send("4",1) sleep(500) $loop = $loop + 1 Wend Send ("TAB",1) sleep (1000) Wend endif WEnd Im trying to put in a stop button, when i try to insert 'if _IsPressed("24") Then Exit Endif" statements like this: While 1 if _IsPressed("23") Then While 1 if _IsPressed("24") Then Exit Endif $loop = 0 Send("TAB",1) While $loop <= 11 if _IsPressed("24") Then Exit Endif Send("4",1) sleep(500) $loop = $loop + 1 Wend Send ("TAB",1) sleep (1000) if _IsPressed("24") Then Exit Endif Wend endif WEnd It then doesnt work, saying im missing "WEnd" Also how do i convert it into an exe file? The easiest way to edit AutoIt scripts, check them, run them, and compile them... is from SciTE. SciTE is a Scintilla based editor that has be customized for AutoIt. Almost everyone on this forum is using SciTE to edit their scripts. Copy/Paste of your script above into SciTE, followed by Ctrl-t to run "Tidy", and some of your basic mistakes become very clear. The first big one you need to correct is the syntax of your 'If' commands. AutoIt will take it two ways: on a single line, or multi-line. If your conditional action is a single line, then the whole thing can go on one line AND THERE IS NO ENDIF. For instance: if _IsPressed("24") Then ExitoÝ÷ Ù8Z¶X§zÈhºWaj÷§ IÝ!öµêâµ·j붢wb¶*'jV¶*'ßÑ1ÝýÁ«"ÉnuçhØ^±©)Þ|g²¢èZ½é®Ø©ç(Øì~éܶ*'²Ú)z·è®j+ü¨º;¬¶X¤zØ^³)ík޶׫¦ëg¢ØbµêííýN§ßÛ-jצz{ZÛ¬{DÒßÛhªä¶ÚßÒßÖ®¶sfbô5&W76VBgV÷C³#BgV÷C²FVâ¢W@¤VæD` ¦bô5&W76VBgV÷C³#2gV÷C²FVâ¢×6t&÷cBÂgV÷C´FöæRgV÷C²ÂgV÷C´b33¶ÒFöæRæ÷râgV÷C²¢W@¤VæD` 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...
Arkbound Posted July 15, 2007 Author Share Posted July 15, 2007 Hm i got another problem now. you know how its Send ("{TAB}",1), it actually types out {TAB} and not press the tab button. how do i make it press the tab button Link to comment Share on other sites More sharing options...
RazerM Posted July 15, 2007 Share Posted July 15, 2007 (edited) By using 1 as the second parameter you are telling AutoIt to send {TAB} rather than press tab key. use Send("{TAB}") instead Edited July 15, 2007 by RazerM My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. 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