Nicocohayek Posted May 17, 2010 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!!
Developers Jos Posted May 17, 2010 Developers 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.
kaotkbliss Posted May 17, 2010 Posted May 17, 2010 read the help file on Run While Wend Send (or ControlSend) and Sleep 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
Nicocohayek Posted May 17, 2010 Author 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
Developers Jos Posted May 17, 2010 Developers 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.
Nicocohayek Posted May 17, 2010 Author 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
Developers Jos Posted May 17, 2010 Developers 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.
Nicocohayek Posted May 17, 2010 Author 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
Developers Jos Posted May 17, 2010 Developers 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.
junkew Posted May 17, 2010 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
Nicocohayek Posted May 17, 2010 Author 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.
Nicocohayek Posted May 17, 2010 Author 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
Developers Jos Posted May 17, 2010 Developers 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.
Fainth Posted May 17, 2010 Posted May 17, 2010 Why is everyone so tense about scripts beeing used for games?
Nicocohayek Posted May 17, 2010 Author 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
Nicocohayek Posted May 17, 2010 Author 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
Developers Jos Posted May 17, 2010 Developers 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.
Fainth Posted May 17, 2010 Posted May 17, 2010 Have fun reading and don't bring up this subject again.Back on topic.I see, too much bad Influence.
Nicocohayek Posted May 17, 2010 Author 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
Fainth Posted May 17, 2010 Posted May 17, 2010 ??? how to open x.exe? you can run about anything with run('wherever\whatever.exe')
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