Jump to content

Help With Script.


Recommended Posts

Ok I have been trying to write a script but for some reason it ignores all of the Sleep commands and just runs intself right through without stopping. Also I cant get it to hit {ALT} and {1} on the upper left hand corner at the same time, it has to be the number 1 by the letters. I understand how to get text into the screen and get it to press a button but other than that, I cant get it to loop or wait long enough.

Basically I need it to look like this.

Sleep for 40 seconds.

I need it to hit ALT and 1 at the same time.

Sleep 20 Seconds.

Then I need it to run the ALT-1 and sleep for 20 about 10 times or more.

Then I need it to say /heal and press enter (I know how to do this).

Sleep 2 minutes

/heal again and press enter

Then I need it to just run the whole program over again without stopping.

I tried making the script from an old one i had but i cant get it to work.

Thanks for any help

Link to comment
Share on other sites

  • Developers

did you use:

Sleep, 40
or
Sleep, 40000

???????

And.... when you want to send ALT+1 you code it like "!1" not "{ALT}1"

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

Here is my code so far.

enhance()

Func enhance()

AutoItSetOption("SendKeyDelay", 25)

Sleep (30000)

AutoItSetOption("SendKeyDelay", 25)

Send ("{ALT}{1}")

Sleep (25000)

Send ("/heal {ENTER}")

Sleep (50000)

Send ("/heal {ENTER}")

EndFunc

I took C++ in highschool but that was a very long time ago lol. I know I know... very poor script but I'm trying hehe.

Link to comment
Share on other sites

I edited it a little bit to try and fix what you guys showed me, I still cant remember how to write a non ending loop :/ I used the function command b/c it was the only way i could figure out how to get it to work at the moment.

enhance()

Func enhance()

AutoItSetOption("SendKeyDelay", 25)

Sleep, (30000)

AutoItSetOption("SendKeyDelay", 25)

Send ("{ALT}!1")

Sleep, (25000)

Send ("/heal {ENTER}")

Sleep, (50000)

Send ("/heal {ENTER}")

EndFunc

Link to comment
Share on other sites

  • Developers

Removed the {alt} because "!1" already sends ALT+1 and a While 1...Wend never ending loop.

You also had a comma behind the sleep commands but thats V2 syntax.

So heres the modified version:

AutoItSetOption("SendKeyDelay", 25)
While 1
   enhance()
Wend

Func enhance()
   Sleep(30000)
   Send("!1")
   Sleep(25000)
   Send("/heal {ENTER}")
   Sleep(50000)
   Send("/heal {ENTER}")
EndFunc

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

:/ Its still not hitting alt and 1 at the same time.

The way the macros work in the game you have to hold down alt then press a number to run them, ALT 1 is my macro for what I want to use.

Is there a command to hold ALT down then press a number while its held down and release it?

Edited by Stormsedge75
Link to comment
Share on other sites

Another quesiton. If I want to write a script that recognizes text, Like when someone says something it will play a macro. Can and how do I do that. Basically I want to make it so that if my partner says >>Bob: Heal me. I'll play a macro and cure him. I know how to play my macros now thanks to your help ^^; but I dont know if or how I can do this part.

Link to comment
Share on other sites

  • Developers

Basically I want to make it so that if my partner says >>Bob: Heal me.  I'll play a macro and cure him.

:whistle: Don't know what "Games" you play... but i guess I don't want to know ..... B)

Can you read any of it with AU3_Spy.exe ?

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

 Share

  • Recently Browsing   0 members

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