1st being the normal start for doing the underworld loop
2nd being going la to turn in quests
3rd being opening tots.
i've been messing around with the eventhandler and the while 1 loop for a day, and i havnt really had much knowledge about the eventhandler functions, since i've always copied somebody elses loop and just put my functions in there.
So what i want is basically to be able to run underworld, then press pause, and once paused i can then press button 2 to go LA and turn in quests, and open tots with button 3. Everything without having to close down the bot at all.
Is that possible? any info would be very much appreciated!
LEADER SCRIPT
Code:
Global Const $btnStart = GUICtrlCreateButton("Start", 8, 200, 154, 25)
Global Const $btnAcceptor = GUICtrlCreateButton("Grab ToT", 8, 230, 154, 25)
Global Const $btnOpenToT = GUICtrlCreateButton("Open ToT", 8, 260, 154, 25)
GUICtrlSetOnEvent($cbxHideGW, "EventHandler")
GUICtrlSetOnEvent($btnStart, "EventHandler")
GUICtrlSetOnEvent($btnAcceptor, "EventHandler")
GUICtrlSetOnEvent($btnOpenToT, "EventHandler")
GUISetOnEvent($GUI_EVENT_CLOSE, "EventHandler")
GUISetState(@SW_SHOW)
#include "Shared.au3"
Out("Ready")
Do
Sleep(500)
Until $yeetInitialized Or $boolInitialized Or $dabInitialized
SetMaxMemory()
While 1
If $boolRunning Then ;UW SKELE
Main()
Else
Out("Bot Paused")
GUICtrlSetState($btnStart, $GUI_ENABLE)
GUICtrlSetData($btnStart, "Start")
GUICtrlSetState($btnAcceptor, $GUI_ENABLE)
GUICtrlSetData($btnAcceptor, "ToT Time")
If Not $boolRunning Then
Do
Sleep(500)
Until $boolRunning Or $yeetrunning Or $dabrunning
EndIf
EndIf
If $yeetrunning Then ;LA QUEST
GoQuests()
Else
out("Bot Paused")
GUICtrlSetState($btnStart, $GUI_ENABLE)
GUICtrlSetData($btnStart, "Start")
GUICtrlSetState($btnAcceptor, $GUI_ENABLE)
GUICtrlSetData($btnAcceptor, "ToT Time")
If Not $yeetrunning Then
Do
Sleep(250)
Until $boolRunning Or $yeetrunning Or $dabrunning
EndIf
EndIf
If $dabrunning Then ;OPEN TOTS
GORAPESOMETOTS()
Else
Out("Bot Paused")
GUICtrlSetState($btnStart, $GUI_ENABLE)
GUICtrlSetData($btnStart, "Start")
GUICtrlSetState($btnAcceptor, $GUI_ENABLE)
GUICtrlSetData($btnAcceptor, "ToT Time")
If Not $dabrunning Then
Do
Sleep(500)
Until $boolRunning Or $yeetrunning Or $dabrunning
EndIf
EndIf
WEnd
SHARED SCRIPT.
Code:
Global $yeetrunning = False
Global $yeetInitialized = False
Global $dabrunning = False
Global $dabInitialized = False
Global $boolRunning = False
Global $boolInitialized = False
Global $Rendering = True
Global Const $USED_CITY = $TOA_ID
Global Const $POSITION_NEAR_AVATAR = $POSITION_NEAR_AVATAR_CHANTRY
Global Const $POSITION_AVATAR = $POSITION_AVATAR_CHANTRY
Global $runs = 0
Global $fails = 0
Global $GoldDrops = 0
Global $qcount = 0
Global $lastDistrict = -1
Func EventHandler()
Switch (@GUI_CtrlId)
Case $btnStart
If $boolRunning Then
GUICtrlSetData($btnStart, "Will pause after this run")
GUICtrlSetState($btnStart, $GUI_DISABLE)
$boolRunning = False
ElseIf $boolInitialized Then
GUICtrlSetData($btnStart, "Pause")
$boolRunning = True
Else
$boolRunning = True
GUICtrlSetData($btnStart, "Initializing...")
GUICtrlSetState($btnStart, $GUI_DISABLE)
GUICtrlSetState($inputCharName, $GUI_DISABLE)
WinSetTitle($MainGui, "", GUICtrlRead($inputCharName))
If GUICtrlRead($inputCharName) = "" Then
If Initialize(ProcessExists("gw.exe"), True, False, False) = False Then ; don't need string logs or event system
MsgBox(0, "Error", "Guild Wars it not running.")
Exit
EndIf
Else
If Initialize(GUICtrlRead($inputCharName), True, False, False) = False Then ; don't need string logs or event system
MsgBox(0, "Error", "Can't find a Guild Wars client with that character name.")
Exit
EndIf
EndIf
GUICtrlSetData($btnStart, "Pause")
GUICtrlSetState($btnStart, $GUI_ENABLE)
$boolInitialized = True
EndIf
Case $btnAcceptor
If $boolRunning Then
GUICtrlSetData($btnAcceptor, "Will pause after this run")
GUICtrlSetState($btnAcceptor, $GUI_DISABLE)
$boolRunning = False
ElseIf $boolInitialized Then
GUICtrlSetData($btnAcceptor, "Pause")
$boolRunning = True
Else
$boolRunning = True
GUICtrlSetData($btnAcceptor, "Initializing...")
GUICtrlSetState($btnAcceptor, $GUI_DISABLE)
GUICtrlSetState($inputCharName, $GUI_DISABLE)
WinSetTitle($MainGui, "", GUICtrlRead($inputCharName))
If GUICtrlRead($inputCharName) = "" Then
If Initialize(ProcessExists("gw.exe"), True, False, False) = False Then ; don't need string logs or event system
MsgBox(0, "Error", "Guild Wars it not running.")
Exit
EndIf
Else
If Initialize(GUICtrlRead($inputCharName), True, False, False) = False Then ; don't need string logs or event system
MsgBox(0, "Error", "Can't find a Guild Wars client with that character name.")
Exit
EndIf
EndIf
GUICtrlSetData($btnAcceptor, "Pause")
GUICtrlSetState($btnAcceptor, $GUI_ENABLE)
$boolInitialized = True
EndIf
Case $btnOpenToT
If $dabrunning Then
GUICtrlSetData($btnOpenToT, "Will pause after this run")
GUICtrlSetState($btnOpenToT, $GUI_DISABLE)
$dabrunning = False
ElseIf $dabInitialized Then
GUICtrlSetData($btnOpenToT, "Pause")
$dabrunning = True
Else
$dabrunning = True
GUICtrlSetData($btnOpenToT, "Initializing...")
GUICtrlSetState($btnOpenToT, $GUI_DISABLE)
GUICtrlSetState($inputCharName, $GUI_DISABLE)
WinSetTitle($MainGui, "", GUICtrlRead($inputCharName))
If GUICtrlRead($inputCharName) = "" Then
If Initialize(ProcessExists("gw.exe"), True, False, False) = False Then ; don't need string logs or event system
MsgBox(0, "Error", "Guild Wars it not running.")
Exit
EndIf
Else
If Initialize(GUICtrlRead($inputCharName), True, False, False) = False Then ; don't need string logs or event system
MsgBox(0, "Error", "Can't find a Guild Wars client with that character name.")
Exit
EndIf
EndIf
GUICtrlSetData($btnOpenToT, "Pause")
GUICtrlSetState($btnOpenToT, $GUI_ENABLE)
$dabInitialized = True
EndIf
Case $cbxHideGW
ClearMemory()
ToggleRendering()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
EndFunc ;==>EventHandler








