Sign in to follow this  
Followers 0
ImJackMurphy

Help with loop :o

3 posts in this topic

#1 ·  Posted (edited)

Hi, i have this bot that makes clicks for me, i got it to start with "S", pause with "P" , and terminate with "{ESC}"

only problem is, i cant get it to Start over and over :/ This is what i have:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("form1", 207, 48, 192, 124)
$Label1 = GUICtrlCreateLabel("S To start bot", 0, 0, 68, 17)
$Label2 = GUICtrlCreateLabel("P to pause bot", 0, 16, 73, 17)
$Label3 = GUICtrlCreateLabel("ESC to exit bot", 0, 32, 74, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Global $Paused
Hotkeyset("s", "StartBot")
HotKeySet("p", "TogglePause")
HotKeySet("{ESC}", "Terminate")


Func StartBot ()
MouseClick("left",278,295,1)
Sleep(200)
MouseClick("left",529,444,1) 
Sleep(500)
MouseClick("left",569,259,1) 
Sleep(200)
MouseClick("left",617,452,1)
Sleep(3000)
MouseClick("left",617,452,1) 
Sleep(500)
MouseClick("left",617,452,1) 
Sleep(5000)
MouseClick("left",511,434,1)
Sleep(5000)
MouseClick("left",511,434,1) 
Sleep(2300)
MouseClick("left",511,434,1)
Sleep(3500)
MouseClick("left",621,490,1)
Sleep(650)
MouseClick("left",621,490,1) 
Sleep(1500)
MouseClick("left",837,436,1)
Sleep(4250)
MouseClick("left",837,436,1)
EndFunc

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Help plz :graduated:

Edited by ImJackMurphy

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi.

1) Announcement: Game Bots and Automation

2) Online AutoIt documentation

Think that about covers it.

[Edit: less bold, little more text. (+hovering OP moved onwards)]

Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

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