Chinasmoker Posted January 26, 2007 Posted January 26, 2007 Hello ,every one ,I 'm a fan of autoit in China,and I was writing a script these days, some problems have arisen, This script is used for game,It simulates pressing key,so if I wanna press A (letter) all the time in the game , The code ,How to effectuate? eg. ------------------------------------- run ("notepad.exe") winwaitactive("NoTitle - note") Send ("{a down}") --------------------------------------- test result: The notepad just appeared a "A' , I almost fall in a faint..... One is never too old to learn
Chinasmoker Posted January 26, 2007 Author Posted January 26, 2007 help me ,Thank you One is never too old to learn
improbability_paradox Posted January 26, 2007 Posted January 26, 2007 I'm sorry, but I'm not really sure what you want. Do you want it to repeatedly send the letter 'A'? If so, then you will need to use a loop of some kind. Look up Do-Until, While-Wend, or For-Next loops. An example could be While 1 Send("A") sleep(50) Wend Good luck!
Immensee Posted January 26, 2007 Posted January 26, 2007 (edited) Hello ,every one ,I 'm a fan of autoit in China,and I was writing a script these days, some problems have arisen, This script is used for game,It simulates pressing key,so if I wanna press A (letter) all the time in the game , The code ,How to effectuate? eg. ------------------------------------- run ("notepad.exe") winwaitactive("NoTitle - note") Send ("{a down}") --------------------------------------- test result: The notepad just appeared a "A' , I almost fall in a faint..... how must the program press for you? like: constantly A or holding the A down for the WHOLE game? $title = "title of your game" WinActivate($title) WinSetOnTop($title) $x=0 do Send("A", 1);;just the A-key, if you write {down} it will send the DOWNARROW key until $x=29 in this code, it makes an infinity loop and constantly presses the A button. -------- Edit: wait, hmm, strange, your code is correct... $title = "title of the game" WinActivate($title) WinSetOnTop($title) send("{A DOWN}", 0) i think that will work, just try, p.s im chinese to ^^ - me Edited January 26, 2007 by Immense
Chinasmoker Posted January 26, 2007 Author Posted January 26, 2007 I ve a question also Has a script got some "while...end"? such as : while 1 ..... ....... wend while 1 ..... ....... wend Thank you ,About first question of this topic ,I will test tomorrow,I am busy now ,at that time ,I will give test result to you ,Thanks! One is never too old to learn
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