Sign in to follow this  
Followers 0
Fella

Probably easy, but i don't know

4 posts in this topic

#1 ·  Posted (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.html

Thats the game if anyone wants to try

So 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 script

If $answer = 7 Then

MsgBox(0, "AutoIt", "OK. Bye!")

Exit

EndIf

HotkeySet("{Esc}", "_Terminate"); End Program

AutoItSetOption("SendKeyDelay", 1)

Myloop:

send"{space}"

goto, myloop

the 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 by Fella

Share this post


Link to post
Share on other sites



Theres no "goto" in autoit 3. Try this:

While 1
Send("{SPACE}")
WEnd

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Zib

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0