Fella Posted August 13, 2006 Posted August 13, 2006 (edited) So here is the deal, i want to be able to dominate this game "King of the Buttons"Its easy enough, push spacebar a bunch of times and it adds up the clicks for you and gives you points...http://www.armorgames.com/games/kingofbuttons3_popup.htmlThats the game if anyone wants to trySo i need a script that will click on the game screen (center of my screen) after i open autoit and then will push spacebar REALLY REALLY fast, untill i push esc to stop it... So far i have this... and i'm pretty sure i am doing nothing right. I spent 2 hours looking for guides or anything and couldn't come up with anything... so i'm asking for help.. PLEASE!; Prompt the user to run the script - use a Yes/No prompt (4 - see help file)$answer = MsgBox(4, "AutoIt Example (English Only)", "This will push spacebar untill you push ESC, Run?"); Check the user's answer to the prompt (see the help file for MsgBox return values); If "No" was clicked (7) then exit the scriptIf $answer = 7 Then MsgBox(0, "AutoIt", "OK. Bye!") ExitEndIfHotkeySet("{Esc}", "_Terminate"); End ProgramAutoItSetOption("SendKeyDelay", 1)Myloop:send"{space}"goto, myloopthe whole "loop" thing didn't work... and i don't think my esc to terminate works either, but i really don't know... Any help? Edited August 13, 2006 by Fella
NELyon Posted August 13, 2006 Posted August 13, 2006 Theres no "goto" in autoit 3. Try this: While 1 Send("{SPACE}") WEnd
Zib Posted August 13, 2006 Posted August 13, 2006 (edited) ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file) $Answer = MsgBox(4, "AutoIt Example (English Only)", "This will push spacebar untill you push ESC, Run?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $Answer = 7 Then MsgBox(0, "AutoIt", "OK. Bye!") Exit EndIf $Window = "King of the Buttons" If WinExists($Window) Then WinActivate($Window) WinWaitActive($Window) MouseClick("left", @DesktopWidth / 2, @DesktopHeight / 2) Else MsgBox(0, "Error", $Window & " window was not found!") Exit EndIf AutoItSetOption("SendKeyDelay", 5) HotkeySet("{Esc}", "_Terminate"); End Program While 1 Send("{SPACE}") ;Send Space as fast as possible WEND ;Function that is called when ESC is pressed Func _Terminate() Exit EndFunc EDIT: Bug Fix.. It seems to click too fast for the game to register... Edited August 13, 2006 by Zib
Fella Posted August 13, 2006 Author Posted August 13, 2006 Wow, you guys are GREAT... first one was simple, yet effective, and the second one was... WOW... thanks so much, i really appreciate your help!!!!!!
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