Hello,
i try to code a bot for Total War: Arena for around 4 days now nad i am almost done ^^ but i have a problem: I have a simple GUI but if i try to click on start it doesnt work. It says that a variable isnt declared but it is ... here is my code:
It says that the variable pixel1 isn't declared but as you see it is ...
i try to code a bot for Total War: Arena for around 4 days now nad i am almost done ^^ but i have a problem: I have a simple GUI but if i try to click on start it doesnt work. It says that a variable isnt declared but it is ... here is my code:
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Fabian\Desktop\Scripts\StartStop.kxf
$Form1 = GUICreate("Total War Arena Bot", 467, 181, -1, -1)
Global $start = GUICtrlCreateButton("Start", 64, 56, 139, 65)
Global $ende = GUICtrlCreateButton("Stop", 272, 56, 139, 65)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $start
start()
Case $ende
ende()
EndSwitch
WEnd
Global $pixel = PixelSearch(956, 916, 988, 939, 0x1A1B1C)
Global $pixel2 = PixelSearch(963, 170,971, 175, 0xFAE788)
Func ende()
Exit
EndFunc
Func start()
While 1
If IsArray($pixel) = True Then
MouseClick("left", 959, 171 )
EndIf
Sleep (5000)
Do
While 1
Sleep(100)
WEnd
Until IsArray($pixel2) = True
Sleep(70000)
Send("{^a}")
Sleep(10000)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(12500)
Send ("{l}")
Send ("{l}")
Send ("{l}")
Send ("{l}")
Sleep(34004)
MouseClick("left",961, 786)
Sleep(5000)
MouseClick("left", 1268, 843)
Sleep(5000)
MouseClick("left", 959, 627)
WEnd
EndFunc