YaBoy Posted May 26, 2007 Share Posted May 26, 2007 I forget how to use AutoIt again.. but if you can help me I would appreciate it. First I want to press D. Then I want to hold A and hold the Down Key for about 10-12 secs. Then I want to press D. Then I want to hit the up arrow key and then Press A. After that I want to press the Right arrow key twice. Then Press down. Then I would like that looped like 5 times. It sounds real simple but I re-downloaded AutoIt and it didnt come with a recorder. So if anyone can help, that be great. Link to comment Share on other sites More sharing options...
Generator Posted May 26, 2007 Share Posted May 26, 2007 For $i = 1 to 5 Step 1 Send("D") Send("A"&"DOWN") Sleep(10000) Send("D") Send("{UP}") Send("A") Send("2{RIGHT}") Send("{DOWN}") Next Not tested but you should get the general idea and correct it Link to comment Share on other sites More sharing options...
YaBoy Posted May 26, 2007 Author Share Posted May 26, 2007 It didnt work... Im sorry but I really forget how to script again in AutoIt... Dont I need like the window info.. the window is: TGraalWindow Well thats the class... can anyone help plz Link to comment Share on other sites More sharing options...
Generator Posted May 26, 2007 Share Posted May 26, 2007 It didnt work... Im sorry but I really forget how to script again in AutoIt...Dont I need like the window info.. the window is: TGraalWindowWell thats the class...can anyone help plzJust look in the help file, also this needs the window to be in focus. Link to comment Share on other sites More sharing options...
YaBoy Posted May 26, 2007 Author Share Posted May 26, 2007 how do I make the window be in focus? sorry I just really want this done and its such an easy task. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 26, 2007 Moderators Share Posted May 26, 2007 how do I make the window be in focus? sorry I just really want this done and its such an easy task.These are silly questions... open the manual and read it (Polite way of RTFM). You'd be amazed at what you would find if you looked at the Win* functions (particularly your answer). If you don't want to take the time to learn, then go take up some outdoor activities for the summer, this is a support forum, not a holding hands forum. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
FreeFry Posted May 26, 2007 Share Posted May 26, 2007 (edited) For $i = 1 to 5 Step 1 Send("D") Send("A"&"DOWN") Sleep(10000) Send("D") Send("{UP}") Send("A") Send("2{RIGHT}") Send("{DOWN}") Next And to make windows in focus, have a look @ the WinActivate() function And like smokey said, please read the manual before asking questions. Edit: whops ;p Edited May 26, 2007 by FreeFry Link to comment Share on other sites More sharing options...
YaBoy Posted May 26, 2007 Author Share Posted May 26, 2007 yea its not working and this is what I got so far: Sleep(2000) Send("{D down}") Sleep(200) Send("{a down}") Sleep(100) Send("{LEFT down}") Sleep(10000) Send("{LEFT up}") Sleep(200) Send("{a up}") Sleep(200) Send("{D down}") Sleep(200) Send("{RIGHT}") Sleep(200) Send("{a down}") Sleep(200) Send("{DOWN 2}") Sleep(200) Send("{LEFT}") Sleep(200) Next The Reason I have the 200's because I thought it would help.. not sure if it does. Anyway, it doesnt release the A. A turns it on.. and you have to hold it to keep it running. Then when you release it, it stops. But it doesnt release. Or it does and then it skips evereything else. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 26, 2007 Moderators Share Posted May 26, 2007 yea its not working and this is what I got so far:Sleep(2000)Send("{D down}")Sleep(200)Send("{a down}")Sleep(100)Send("{LEFT down}")Sleep(10000)Send("{LEFT up}")Sleep(200)Send("{a up}")Sleep(200)Send("{D down}")Sleep(200)Send("{RIGHT}")Sleep(200)Send("{a down}")Sleep(200)Send("{DOWN 2}")Sleep(200)Send("{LEFT}")Sleep(200)NextThe Reason I have the 200's because I thought it would help.. not sure if it does.Anyway, it doesnt release the A.A turns it on.. and you have to hold it to keep it running. Then when you release it, it stops. But it doesnt release.Or it does and then it skips evereything else.Do you have to keep it down? If not Send("a") will be fine.... common sense would say here that if I'm using {a DOWN} that I'm probably going to need to use {a UP} ... No? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
YaBoy Posted May 26, 2007 Author Share Posted May 26, 2007 Yeah sorry, let me be clear. The 2ND {A down} is just a one click.. so i changed it to this: Sleep(2000) Send("{D down}") Sleep(200) Send("{a down}") Sleep(100) Send("{LEFT down}") Sleep(10000) Send("{LEFT up}") Sleep(200) Send("{a up}") Sleep(200) Send("{D down}") Sleep(200) Send("{RIGHT}") Send("a") Sleep(200) Send("{DOWN 2}") Sleep(200) Send("{LEFT}") Sleep(200) Next But im still having trouble. After it hits {a down} and {LEFT down} it skips everything else and goes back to the beginning. Link to comment Share on other sites More sharing options...
YaBoy Posted May 26, 2007 Author Share Posted May 26, 2007 Ok so I got this:Sleep(2000)Send("{D down}")Sleep(200)Send("{a down}")Sleep(100)Send("{LEFT down}")Sleep(10000)Send("{LEFT up}")Sleep(200)Send("{a up}")Sleep(200)Send("{D up}")Send("{D down}")Sleep(200)Send("{RIGHT}")Send("a")Sleep(200)Send("{DOWN 2}")Sleep(200)Send("{LEFT}")Sleep(200)NextSo now.. I fixed the D part... it was already holding the D down.. so how could it do it again? So I fixed that.But now.. I just want it to click RIGHT ONCE.. and NOT hold it down. Then hit A. Then go down 2. Then hit left. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 26, 2007 Moderators Share Posted May 26, 2007 Use code tags [ code] ... your code ... [ /code] without the spaces I just explained this to you... Send("{D up}") Send("{D down}") Is redundant... all you need is:Send("D") You used the word "Click", are you wanting to "Mouse Click"? If so look at MouseClick() in the help file for "Right"/"Left" usage. Send({RIGHT}) is for the arrows... and that shows it's only doing it once. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
YaBoy Posted May 26, 2007 Author Share Posted May 26, 2007 I did use Send ("D") and it just didnt work... No, no mouse clicks... I just want one RIGHT arrow HIT... but its not working. Right now im up to the Right arrow part... which isnt working. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 26, 2007 Moderators Share Posted May 26, 2007 I did use Send ("D") and it just didnt work...No, no mouse clicks... I just want one RIGHT arrow HIT... but its not working.Right now im up to the Right arrow part... which isnt working.If you are sending it to a window, look at ControlSend()GL Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Generator Posted May 26, 2007 Share Posted May 26, 2007 I did use Send ("D") and it just didnt work...No, no mouse clicks... I just want one RIGHT arrow HIT... but its not working.Right now im up to the Right arrow part... which isnt working.What window are you trying to send those key to Link to comment Share on other sites More sharing options...
YaBoy Posted May 26, 2007 Author Share Posted May 26, 2007 its to a game... but since ive said this now you guys will be like, No help for you. Link to comment Share on other sites More sharing options...
Generator Posted May 26, 2007 Share Posted May 26, 2007 You should've stated at first this is a game, some game have protection that doesn't allow software sitmulated keys being input to the game. Link to comment Share on other sites More sharing options...
FreeFry Posted May 26, 2007 Share Posted May 26, 2007 I think that should be For $i = 1 To 5 Send("D") Send("{down down}") Sleep(10000) Send("D") Send("{UP}") Send("A") Send("{RIGHT 2}") Send("{DOWN}") Next oÝ÷ Ø Ý¶ì"Ú0²)ߡˬ«ÞjZ(Ø^Z)Àrدj׺w-ÀÙbë&¢G²±¨¦W±êÞiÛazf§¹©[yú+y«$x*¹ë-ìØÂ)²êº^JëÊljém!¶¬Æ¥'(§*Z²×éÞ«h®Êh²ÙhØb²+!£².ÖÞvÞjëh×6 For $i = 1 To 5 Send("D") Send("{a down}") Send("{down down}") Sleep(10000) Send("{a up}") Send("{down up}") Send("D") Send("{UP}") Send("A") Send("{RIGHT 2}") Send("{DOWN}") Next After you have sent a "down" macro, you need to send the "up" macro aswell, otherwise the button will still be held down, forever(until you press it, or something else triggers the "up" event) Link to comment Share on other sites More sharing options...
YaBoy Posted May 26, 2007 Author Share Posted May 26, 2007 well I got it working until a point... and if its working half way I dont see why it wont work. This is my whole script: For $i = 1 to 5 Step 1 Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) WinWait(" Era ","") If Not WinActive(" Era ","") Then WinActivate(" Era ","") Sleep(2000) Send("{D down}") Sleep(200) Send("{a down}") Sleep(100) Send("{LEFT down}") Sleep(10000) Send("{LEFT up}") Sleep(200) Send("{a up}") Sleep(200) Send("{D down}") Send("{D up}") Sleep(200) Send("RIGHT") Send("{a down}") Send("{a up}") Sleep(200) Send("{DOWN 2}") Sleep(200) Send("{LEFT down}") Send("{LEFT up}") Sleep(200) Next Now.. it works until it has to RIGHT. It skips everything after Right and also the D. Link to comment Share on other sites More sharing options...
FreeFry Posted May 26, 2007 Share Posted May 26, 2007 (edited) well I got it working until a point... and if its working half way I dont see why it wont work. This is my whole script: For $i = 1 to 5 Step 1 Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) WinWait(" Era ","") If Not WinActive(" Era ","") Then WinActivate(" Era ","") Sleep(2000) Send("{D down}") Sleep(200) Send("{a down}") Sleep(100) Send("{LEFT down}") Sleep(10000) Send("{LEFT up}") Sleep(200) Send("{a up}") Sleep(200) Send("{D down}") Send("{D up}") Sleep(200) Send("RIGHT") Send("{a down}") Send("{a up}") Sleep(200) Send("{DOWN 2}") Sleep(200) Send("{LEFT down}") Send("{LEFT up}") Sleep(200) Next Now.. it works until it has to RIGHT. It skips everything after Right and also the D. First, don't put options in a loop, that's .. actually stupid lol. And if it's not entirely necessary, you do not need that If in that loop either: Opt("WinWaitDelay",100) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) WinWait("Era") If Not WinActive("Era") Then WinActivate("Era") ; Note that this loop will take 13.5 seconds to run just once... 13.5s*5 = 67.5 seconds runtime... For $i = 1 to 5 ; Step 1 is not needed, it steps with 1 as default... Sleep(2000) Send("{d down}") Sleep(200) Send("{a down}") Sleep(100) Send("{LEFT down}") Sleep(10000) Send("{LEFT up}") Sleep(200) Send("{a up}") Sleep(200) Send("d") ; Dont use {d down} then {d up} that's only if you need to HOLD a button, you just want to press it.... use Send() in those cases Sleep(200) Send("RIGHT") Send("a") ; Dont use {a down} then {a up} that's only if you need to HOLD a button, you just want to press it.... use Send() in those cases Sleep(200) Send("{DOWN 2}") Sleep(200) Send("{left}") ; Dont use {left down} then {left up} that's only if you need to HOLD a button, you just want to press it.... use Send() in those cases Sleep(200) Next Edited May 26, 2007 by FreeFry Link to comment Share on other sites More sharing options...
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