Code:
#cs ----------------------------------------------------------------------------
AutoIt Version : 3.3.12.0
Auteur: Razzor2008
Fonction du Script :
Modèle de Script AutoIt.
#ce ----------------------------------------------------------------------------
;==================================================================
;======================== INCLUDES ============================
;==================================================================
#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;==================================================================
;========================== GUI =================================
;==================================================================
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("MyB", 383, 210, 192, 124)
Global $Button1 = GUICtrlCreateButton("Start BOT", 144, 72, 99, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;==================================================================
;======================== VARIABLES =============================
;==================================================================
HotKeySet ("^q","quit") ;If Ctrl+Q, close the bot
HotKeySet ("^p","pause") ; If Ctrl+P, pause the bot
Global $quit = False
Global $pause = False
;==================================================================
;======================== CODE =============================
;==================================================================
While Not $quit
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1 ; Bot start
Sleep(5000)
combat()
EndSwitch
WEnd
;==================================================================
;======================== FONCTIONS =============================
;==================================================================
Func combat()
Local $hWnd = WinWait("[CLASS:ArcheAge]", "", 3) ; handle of AA window
Do
If $hWnd = True Then
ControlSend ($hWnd, "[CLASS:ArcheAge]", "", "{TAB}f") ;start fighting and looting at the same time
Sleep(2000)
ControlSend ($hWnd, "[CLASS:ArcheAge]", "", "&f")
Sleep(5000)
ControlSend ($hWnd, "[CLASS:ArcheAge]", "", "éf")
Sleep(2000)
ControlSend ($hWnd, "[CLASS:ArcheAge]", "", "éf")
Sleep(2000)
ControlSend ($hWnd, "[CLASS:ArcheAge]", "", "éf")
Sleep(2000)
ControlSend ($hWnd, "[CLASS:ArcheAge]", "", "f") ;end of the cycle
search()
EndIf
Until $pause = True
EndFunc
Func search() ; function research mobs
Local $hWnd = WinWait("[CLASS:ArcheAge]", "", 3)
Opt("SendKeyDownDelay", 1250)
ControlSend ($hWnd, "[CLASS:ArcheAge]", "", "e")
Opt("SendKeyDownDelay", 5)
EndFunc
Func quit() ; function stop the bot
$quit = True
MsgBox(0,"Closing","Good-Bye")
GUISetState(@SW_SHOW)
Exit
EndFunc
Func pause() ; function pause the bot
$Pause = NOT $Pause
While $Pause
ToolTip("Paused")
sleep(100)
WEnd
ToolTip("")
EndFunc