Jump to content

Recommended Posts

Posted

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
Posted

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.
  :)

Posted

Not a great way to start here.

What have you done thus far and what isn't working?

Jos

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 NOTEPAD

  • Developers
Posted

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 NOTEPAD

What 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.
  :)

Posted

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
Posted

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

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?

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.
  :)

Posted

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

Posted

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.

Posted

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
Posted (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 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.
  :)

Posted

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
Posted

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

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...