Jump to content

DESPERATE HELP in Coding keystroke and loop for a particular program


Recommended Posts

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!!

Link to comment
Share on other sites

  • Developers

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Developers

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

Link to comment
Share on other sites

  • Developers

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Developers

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Developers

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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