Nicocohayek 0 Posted May 17, 2010 hey everyone. i joined this forum hoping for some help. i need to run a program in AutoIt to do the following: Launch notepad; Press "enter" for infinite times with 1 second pause between each one; I tried using batch coding but i'm new into coding so C++ and VBS are not within my domain. Please help me out!! Thanks!! Share this post Link to post Share on other sites
Jos 2,208 Posted May 17, 2010 hey everyone. i joined this forum hoping for some help. i need to run a program in AutoIt to do the following:Launch notepad;Press "enter" for infinite times with 1 second pause between each one;I tried using batch coding but i'm new into coding so C++ and VBS are not within my domain. Please help me out!! Thanks!!Not a great way to start here. What have you done thus far and what isn't working?Jos 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. Share this post Link to post Share on other sites
kaotkbliss 146 Posted May 17, 2010 read the help file on Run While Wend Send (or ControlSend) and Sleep 010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueekWe're gonna need another Timmy! Share this post Link to post Share on other sites
Nicocohayek 0 Posted May 17, 2010 Not a great way to start here. What have you done thus far and what isn't working?JosI have tried batch processing and discovered a couple of stings but couldn't create the correct syntax. I even tried RemoteKeys 8.7.3 and wrote this code which only opened the program and pressed enter once. here's the code:{/APP.OPEN Notepad}{KEY.ENTER}{/BTCH.DELAY.1}{KEY.ENTER}{/BTCH.LOOP.START.VAL.9}{KEY.ENTER}I deleted the other batch strings i tried since they all failed, and got back to square one: START /MAX NOTEPAD Share this post Link to post Share on other sites
Jos 2,208 Posted May 17, 2010 I have tried batch processing and discovered a couple of stings but couldn't create the correct syntax. I even tried RemoteKeys 8.7.3 and wrote this code which only opened the program and pressed enter once. here's the code:{/APP.OPEN Notepad}{KEY.ENTER}{/BTCH.DELAY.1}{KEY.ENTER}{/BTCH.LOOP.START.VAL.9}{KEY.ENTER}I deleted the other batch strings i tried since they all failed, and got back to square one: START /MAX NOTEPADWhat have you tried to create with AutoIt3 ? 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. Share this post Link to post Share on other sites
Nicocohayek 0 Posted May 17, 2010 What have you tried to create with AutoIt3 ?i tried to make use of the examples that come with the program but nothing came up ... i found it very difficult to start from scratch so i decided to call for help Share this post Link to post Share on other sites
Jos 2,208 Posted May 17, 2010 i tried to make use of the examples that come with the program but nothing came up ... i found it very difficult to start from scratch so i decided to call for helpYou are being very vague here and this doesn't help much.Which example did you try that didn't work launching Notepad and sending Enters? 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. Share this post Link to post Share on other sites
Nicocohayek 0 Posted May 17, 2010 You are being very vague here and this doesn't help much.Which example did you try that didn't work launching Notepad and sending Enters?Here's what i wrote: Run("notepad.exe")WinWaitActive("Untitled - Notepad")Send("{ENTER}")Loop()I didn't know how to put the timer to press enter ever 1 second, and practically that's how far i've gotten so far Share this post Link to post Share on other sites
Jos 2,208 Posted May 17, 2010 Look at While..Wend and Sleep() in the Helpfile for a resolution to that question. 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. Share this post Link to post Share on other sites
junkew 406 Posted May 17, 2010 copy paste from the help file you should read Run(@WindowsDir & "\Notepad.exe", "", @SW_MAXIMIZE) FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Share this post Link to post Share on other sites
Nicocohayek 0 Posted May 17, 2010 Look at While..Wend and Sleep() in the Helpfile for a resolution to that question.Thanks alot!! The Sleep function solves my delay needs in theory. i am still, though, lost in knowing how to write the While..Wend function. Share this post Link to post Share on other sites
Nicocohayek 0 Posted May 17, 2010 That's what i managed to write so far but it keeps giving me syntax error: Run("Notepad") WinWaitActive("Unitled" While Send("{ENTER}") Sleep(1000) Send("{ENTER}") WEnd Share this post Link to post Share on other sites
Jos 2,208 Posted May 17, 2010 (edited) That's what i managed to write so far but it keeps giving me syntax error: Run("Notepad") WinWaitActive("Unitled" While Send("{ENTER}") Sleep(1000) Send("{ENTER}") WEnd Spelling and syntax is important. Make that: Run("Notepad") WinWaitActive("Untitled") While 1 Send("{ENTER}") Sleep(1000) WEnd So now you are off to test if it also works on your game...right? Edited May 17, 2010 by Jos 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. Share this post Link to post Share on other sites
Fainth 0 Posted May 17, 2010 Why is everyone so tense about scripts beeing used for games? Share this post Link to post Share on other sites
Nicocohayek 0 Posted May 17, 2010 Spelling and syntax is important. Make that: Run("Notepad") WinWaitActive("Untitled") While 1 Send("{ENTER}") Sleep(1000) WEnd So now you are off to test if it also works on your game...right? Most of my problems are syntax-related. Now i'm searching the help files to know how to change destinations to my own program Share this post Link to post Share on other sites
Nicocohayek 0 Posted May 17, 2010 Why is everyone so tense about scripts beeing used for games?they give you an edge on condition you stay within legal and ethical values of the game...at least that's what i believe Share this post Link to post Share on other sites
Jos 2,208 Posted May 17, 2010 Why is everyone so tense about scripts beeing used for games?Have fun reading and don't bring up this subject again.Back on topic. 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. Share this post Link to post Share on other sites
Fainth 0 Posted May 17, 2010 Have fun reading and don't bring up this subject again.Back on topic.I see, too much bad Influence. Share this post Link to post Share on other sites
Nicocohayek 0 Posted May 17, 2010 Spelling and syntax is important. Make that: Run("Notepad") WinWaitActive("Untitled") While 1 Send("{ENTER}") Sleep(1000) WEnd So now you are off to test if it also works on your game...right? i checked the help files and there's no way i could find out how to open X.exe if it's on my desktop and my directory is C:\Users\''\Desktop\ChemicalX.exe Share this post Link to post Share on other sites
Fainth 0 Posted May 17, 2010 ??? how to open x.exe? you can run about anything with run('wherever\whatever.exe') Share this post Link to post Share on other sites