for the peopel to scream me for trojan in the toc bot look the source code i dont scam you in the source its not a virus or trojan pls shut up or take you brain on ty
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include "GWA2.au3"
#Region Declarations
Global const $Template = "OgcTc5+8Z6ASn5uU4ABimsBKuEA"
Global Const $RARITY_GOLD = 2624
Global Const $RARITY_PURPLE = 2626
Global Const $RARITY_BLUE = 2623
Global Const $RARITY_WHITE = 2621
Global Const $C_WHITEDYE = 12
Global Const $C_BLACKDYE = 10
Global Const $scroll = 22280
Global Const $scrollitem = GetItemByModelID($scroll)
Global Const $shard = 945
Global Const $darkremains = 522
Global Const $ruby = 937
Global Const $saph = 938
Global Const $obbykey = 5971
Global Const $chaosaxe = 111
Global $PickupGold = True
Global $SellGold = True
Global $PickupPurple = False
Global $SellPurple = False
Global $PickupBlue = False
Global $SellBlue = False
Global $PickupWhite = False
Global $SellWhite = False
Global $PickupScrolls = True
Global $PickupCoins = True
Global $fromToA = False
Global $fromZinKu = False
Global $fromChantry = False
Global $enterScroll = false
Global $enterKneel = True
Global $enterEvent = False
Global $RenderingEnabled = True
Global Const $doLoadLoggedChars = True
Global $BotRunning = False
Global $BotInitialized = False
Global $RunDone = False
Global $RunsDone = 0
Global $runsFailed = 0
Global $shardcount = 0
Global $GoldUsed = 0
Global $MaxGold = 0
Global $bag_slots[5] = [0, 20, 5, 10, 10]
global const $champion = 1937
Global const $timermax = 120000 ;2 Minuten
Global Const $fow = 34
global const $toa = 138
global const $chantry = 393
Global Const $embark = 857
global const $zinku = 284
Global $townarry[3] = [0, 0, 0]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Global Const $skill_id_shroud = 1031
global const $skill_id_iau = 2356
global const $skill_id_wd =450
global const $skill_id_mb = 2417
Global Const $ds = 3
Global Const $sf = 2
Global Const $shroud = 1
Global Const $hos = 5
Global Const $wd = 4
Global Const $iau = 6
Global Const $de = 7
Global Const $mb = 8
; Store skills energy cost
Global $skillCost[9]
$skillCost[$ds] = 5
$skillCost[$sf] = 5
$skillCost[$shroud] = 10
$skillCost[$wd] = 4
$skillCost[$hos] = 5
$skillCost[$iau] = 5
$skillCost[$de] = 5
$skillCost[$mb] = 10
#EndRegion
#Region GUI
Opt("GUIOnEventMode", True)
$Form1 = GUICreate("$tReCkY,s ToC Farmer", 277, 375, 350, 165)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
$Settings = GUICtrlCreateTab(0, 0, 273, 369)
$TabSheet1 = GUICtrlCreateTabItem("Settings")
If $doLoadLoggedChars Then
$Char = GUICtrlCreateCombo("", 8, 40, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, GetLoggedCharNames())
Else
$Char = GUICtrlCreateInput("character name", 8, 40, 145, 25)
EndIf
$Button = GUICtrlCreateButton("Start", 176, 40, 75, 25)
GUICtrlSetOnEvent(-1, "GuiButtonHandler")
$Rendering = GUICtrlCreateCheckbox("Disable Rendering", 8, 72, 121, 17)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "ToggleRendering")
$Group1 = GUICtrlCreateGroup("Entering", 16, 96, 233, 257)
$Check_Kneel = GUICtrlCreateRadio("Kneel", 30, 128, 57, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
;~ $Check_Scroll = GUICtrlCreateRadio("Scroll", 120, 128, 57, 17)
$Check_Scroll = GUICtrlCreateRadio("Scroll", 90, 128, 57, 17)
$Check_Event = GUICtrlCreateRadio("Event", 150, 128, 65, 17)
$Label1 = GUICtrlCreateLabel("How much k max?", 32, 170, 92, 17)
$MaxGoldtoUse = GUICtrlCreateInput("0", 136, 170, 65, 21)
$Group2 = GUICtrlCreateGroup("Start from?", 32, 216, 201, 129)
$Check_ToA = GUICtrlCreateCheckbox("Temple of the Ages", 56, 248, 129, 17)
$Check_ZinKu = GUICtrlCreateCheckbox("Zin Ku Corridor", 56, 280, 97, 17)
$Check_Chantry = GUICtrlCreateCheckbox("Chantry of Secrets", 56, 312, 113, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$TabSheet2 = GUICtrlCreateTabItem("Loot")
$Group3 = GUICtrlCreateGroup("What should be picked up?", 16, 40, 241, 121)
$CheckGrabScrolls = GUICtrlCreateCheckbox("Scrolls", 24, 64, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$CheckGrabGolds = GUICtrlCreateCheckbox("Gold Items", 136, 64, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$CheckGrabPurple = GUICtrlCreateCheckbox("Purple Items", 24, 96, 97, 17)
$CheckGrabCoins = GUICtrlCreateCheckbox("Gold Coins", 136, 128, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$CheckGrabBlue = GUICtrlCreateCheckbox("Blue Items", 136, 96, 97, 17)
$CheckGrabWhite = GUICtrlCreateCheckbox("White Items", 24, 128, 97, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group4 = GUICtrlCreateGroup("What should be sold?", 16, 176, 241, 97)
$CheckSellGold = GUICtrlCreateCheckbox("Gold Items", 24, 200, 97, 17)
$CheckSellPurple = GUICtrlCreateCheckbox("Purple Items", 136, 200, 97, 17)
$CheckSellBlue = GUICtrlCreateCheckbox("Blue Items", 24, 232, 97, 17)
$CheckSellWhite = GUICtrlCreateCheckbox("White Items", 136, 232, 97, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label2 = GUICtrlCreateLabel("Shard Count:", 24, 296, 66, 17)
$Label4 = GUICtrlCreateLabel("Current Gold:", 24, 328, 66, 17)
$LblShards = GUICtrlCreateLabel("0", 120, 296, 80, 17)
$LblGold = GUICtrlCreateLabel("0", 120, 328, 80, 17)
$TabSheet3 = GUICtrlCreateTabItem("Log")
$Console = GUICtrlCreateEdit("", 9, 29, 249, 248, -1, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
GUICtrlSetData(-1, "")
$Label3 = GUICtrlCreateLabel("Runs Done:", 24, 296, 61, 17)
$Label5 = GUICtrlCreateLabel("Runs Failed:", 24, 328, 63, 17)
$LblRunsDone = GUICtrlCreateLabel("0", 120, 296, 50, 17)
$LblRunsFailed = GUICtrlCreateLabel("0", 120, 328, 50, 17)
GUICtrlCreateTabItem("")
GUISetState @

SHOW)
Func GuiButtonHandler()
If $BotRunning Then
GUICtrlSetData($Button, "Will pause after this run")
GUICtrlSetState($Button, $GUI_DISABLE)
$BotRunning = False
ElseIf $BotInitialized Then
GUICtrlSetData($Button, "Pause")
$BotRunning = True
Else
Out("Initializing")
Local $CharName = GUICtrlRead($Char)
If $CharName=="" Then
If Initialize(ProcessExists("gw.exe"), True, True, False) = False Then
MsgBox(0, "Error", "Guild Wars is not running.")
Exit
EndIf
Else
If Initialize($CharName, True, True, False) = False Then
MsgBox(0, "Error", "Could not find a Guild Wars client with a character named '"&$CharName&"'")
Exit
EndIf
EndIf
GUICtrlSetState($Rendering, $GUI_ENABLE)
GUICtrlSetState($Char, $GUI_DISABLE)
GUICtrlSetData($Button, "Pause")
$BotRunning = True
$BotInitialized = True
EndIf
EndFunc
Func UpdateStats()
Local $ShardCount = GetShardCount()
Local $GoldCount = GetGoldCharacter()
Local $k = Round(($GoldCount/1000)-0.5)
Local $g = $GoldCount - ($k*1000)
GUICtrlSetData($LblShards, $ShardCount)
If $g < 100 Then
GUICtrlSetData($LblGold, $k & ".0" & $g & " K")
Else
GUICtrlSetData($LblGold, $k & "." & $g & " K")
EndIf
GUICtrlSetData($LblRunsDone, $RunsDone)
GUICtrlSetData($LblRunsFailed, $RunsFailed)
EndFunc
Func _exit()
Exit
EndFunc
Func Out($aString)
;~ FileWriteLine("logfiles\History.log", @

& ":" & @

& " - " & $aString)
ConsoleWrite @

& ":" & @

& " - " & $aString & @

)
GUICtrlSetData($Console, GUICtrlRead($Console) & @

& ":" & @

& " - " & $aString & @

)
_GUICtrlEdit_Scroll($Console, 4)
EndFunc
#EndRegion
While Not $BotRunning
Sleep(100)
WEnd
While True
#Region CheckItems
If GUICtrlRead($CheckGrabGolds) = 1 Then
$PickupGolds = True
Else
$PickupGolds = False
EndIf
If GUICtrlRead($CheckSellGold) = 1 Then
$SellGold = True
Else
$SellGold = False
EndIf
If GUICtrlRead($CheckGrabPurple) = 1 Then
$PickupPurple = True
Else
$PickupPurple = False
EndIf
If GUICtrlRead($CheckSellPurple) = 1 Then
$SellPurple = True
Else
$SellPurple = False
EndIf
If GUICtrlRead($CheckGrabBlue) = 1 Then
$PickupBlue = True
Else
$PickupBlue = False
EndIf
If GUICtrlRead($CheckSellBlue) = 1 Then
$SellBlue = True
Else
$SellBlue = False
EndIf
If GUICtrlRead($CheckGrabWhite) = 1 Then
$PickupWhite = True
Else
$PickupWhite = False
EndIf
If GUICtrlRead($CheckSellWhite) = 1 Then
$SellWhite = True
Else
$SellWhite = False
EndIf
If GUICtrlRead($CheckGrabCoins) = 1 Then
$PickupCoins = True
Else
$PickupCoins = False
EndIf
If GUICtrlRead($CheckGrabScrolls) = 1 Then
$PickupScrolls = True
Else
$PickupScrolls = False
EndIf
#EndRegion
#Region CheckEnter
If GUICtrlRead($Check_Kneel) = 1 Then
$MaxGold = (GUICtrlRead($MaxGoldtoUse)*1000)
Switch $GoldUsed
case $MaxGold
MsgBox(0,"Out of Gold!", "Used max. amount of Gold!")
$BotRunning = False
case Else
$enterKneel = True
EndSwitch
EndIf
If GUICtrlRead($Check_Scroll) = 1 Then
Switch GetScrollCount()
Case 0
MsgBox(0, "No Scrolls", "No scrolls found! Exitig!")
$BotRunning = False
case Else
$enterKneel =False
$enterScroll = True
EndSwitch
EndIf
If GUICtrlRead($Check_Event) = 1 Then
$enterKneel = False
$enterEvent = True
EndIf
If GUICtrlRead($Check_ToA) = 1 Then
$fromToA = True
EndIf
If GUICtrlRead($Check_ZinKu) = 1 Then
$fromZinKu = True
EndIf
If GUICtrlRead($Check_Chantry) = 1 Then
$fromChantry = True
EndIf
#EndRegion
If Not $BotRunning Then
Out("Bot Paused")
TravelGH()
GUICtrlSetData($Button, "Start")
GUICtrlSetState($Button, $GUI_ENABLE)
While Not $BotRunning
Sleep(100)
WEnd
EndIf
If $enterKneel Then
Sleep(50)
clearmemory()
enterfow()
loop()
UpdateStats()
$GoldUsed = $GoldUsed + 1000
If $RenderingEnabled = False Then _PurgeHook()
EndIf
If $enterScroll Then
Sleep(50)
clearmemory()
enterfow()
loop()
UpdateStats()
If $RenderingEnabled = False Then _PurgeHook()
EndIf
If $enterEvent Then
Sleep(50)
clearmemory()
enterfow()
loop()
UpdateStats()
If $RenderingEnabled = False Then _PurgeHook()
EndIf
WEnd
#Region Funtions
Func enterfow()
If (($RunsDone = 0) And ($RunsFailed = 0)) Then
LoadSkillTemplate($Template)
Sleep(100)
EndIf
If $enterScroll Then
If getmapid() <> $embark Then
travelto($embark)
EndIf
enterscroll()
WaitMapLoading($fow)
EndIf
If $enterKneel Then
;~ Global $timer = TimerInit()
enterkneel()
;~ If TimerDiff($timer) > $timermax Then Stucked()
WaitMapLoading($fow)
EndIf
If $enterEvent Then
;~ Global $timer = TimerInit()
enterEvent()
;~ If TimerDiff($timer) > $timermax Then Stucked()
WaitMapLoading($fow)
EndIf
EndFunc
Func enterscroll()
CheckInventory()
Out("using scroll")
useitembymodelid($scroll)
EndFunc ;==>enterscroll
func enterkneel()
Local $RandomTown = GetRndTown()
Switch $RandomTown
Case $ToA
Out("Traveling to ToA")
Case $ZinKu
Out("Traveling to Zin Ku Corridor")
Case $Chantry
Out("Traveling to Chantry of Secrets")
EndSwitch
RndTravel($RandomTown)
Switch GetMapID()
Case $ToA
EnterToA()
Case $ZinKu
EnterZinKu()
Case $Chantry
EnterChantry()
EndSwitch
EndFunc
Func enterEvent()
Local $RandomTown = GetRndTown()
Switch $RandomTown
Case $ToA
Out("Traveling to ToA")
Case $ZinKu
Out("Traveling to Zin Ku Corridor")
Case $Chantry
Out("Traveling to Chantry of Secrets")
EndSwitch
RndTravel($RandomTown)
Switch GetMapID()
Case $ToA
EnterToAE()
Case $ZinKu
EnterZinKuE()
Case $Chantry
EnterChantryE()
EndSwitch
EndFunc
Func Kneel($aX, $aY)
MoveTo($aX,$aY)
Out("Kneeling")
SendChat("Kneel","/")
Sleep(3000)
Out("Entering FoW!")
GoNearestNPCToCoords($aX,$aY)
;~ If TimerDiff($timer) > $timermax Then Stucked()
Sleep(500)
Dialog(0x85)
Sleep(500)
Dialog(0x86)
Sleep(100)
EndFunc
Func EnterToA()
CheckInventory()
CheckGold()
MoveTo(-4845,19213)
MoveTo(-3811, 17682)
kneel(-2607, 18700)
EndFunc
Func EnterZinKu()
CheckInventory()
CheckGold()
MoveTo(7072,-17511)
MoveTo(-1008,-17543)
MoveTo(-2469,-16276)
MoveTo(-2345,-16056)
MoveTo(-1360,-16072)
kneel(-1128,-16484)
EndFunc
Func EnterChantry()
CheckGold()
CheckInventory()
kneel(-9979,1171)
EndFunc
Func EnterToAE()
CheckInventory()
MoveTo(-4845,19213)
MoveTo(-3811, 17682)
kneel(-2607, 18700)
EndFunc
Func EnterZinKuE()
CheckInventory()
MoveTo(7072,-17511)
MoveTo(-1008,-17543)
MoveTo(-2469,-16276)
MoveTo(-2345,-16056)
MoveTo(-1360,-16072)
kneel(-1128,-16484)
EndFunc
Func EnterChantryE()
CheckInventory()
kneel(-9979,1171)
EndFunc
Func UseSkillEx($lSkill, $lTgt = -2, $aTimeout = 3000)
$mSkillbar = GetSkillbar()
If GetInstanceUpTime() > (6*60*1000) Then StuckedInFoW()
If GetIsDead(-2) Then Failed() ;Return
If Not IsRecharged($lSkill) Then Return
If GetEnergy(-2) < $skillCost[$lSkill] Then Return
Local $Skill = GetSkillByID(DllStructGetData($mSkillbar, 'Id' & $lSkill))
If DllStructGetData($mSkillbar, 'AdrenalineA' & $lSkill) < DllStructGetData($lSkill, 'Adrenaline') Then Return False
Local $lDeadlock = TimerInit()
UseSkill($lSkill, $lTgt)
Do
Sleep(50)
If GetIsDead(-2) = 1 Then Return
Until (Not IsRecharged($lSkill)) Or (TimerDiff($lDeadlock) > $aTimeout)
If $lSkill > 1 Then RndSleep(350)
EndFunc ;==>UseSkillEx
Func IsRecharged($lSkill)
Return GetSkillBarSkillRecharge($lSkill) == 0
EndFunc ;==>IsRecharged
Func UseSF()
If IsRecharged($sf) Then
UseSkillEx($sf)
EndIf
If isrecharged($shroud) and GetEffectTimeRemaining($skill_id_iau) > 1 Then
useSkillEx($shroud)
EndIf
if GetEffectTimeRemaining($skill_id_shroud) < 10 then
useSkillEx($shroud)
EndIf
EndFunc ;==>UseSF
Func MoveRunning($lDestX, $lDestY)
If GetIsDead(-2) Then Return False
Local $lMe, $lTgt
Local $lBlocked = 0
Local $ChatStuckTimer = TimerInit()
Move($lDestX, $lDestY)
Do
RndSleep(500)
TargetNearestEnemy()
$lMe = GetAgentByID(-2)
$lTgt = GetAgentByID(-1)
If GetIsDead($lMe) Then Return False
if $lblocked > 1 Then
If TimerDiff($ChatStuckTimer) > 3000 Then
SendChat("stuck", "/")
$ChatStuckTimer = TimerInit()
EndIf
EndIf
UseSF()
If $lBlocked = 5 Then
UseSkillEx($hos,-1)
Sleep(100)
Move($lDestX, $lDestY)
If DllStructGetData($lMe, 'MoveX') == 0 And DllStructGetData($lMe, 'MoveY') == 0 Then
$lBlocked = 1
Else
$lBlocked = 0
EndIf
EndIf
If DllStructGetData($lMe, 'MoveX') == 0 And DllStructGetData($lMe, 'MoveY') == 0 Then
$lBlocked += 1
Move($lDestX, $lDestY)
EndIf
If DllStructGetData($lMe, 'hp') < 0.2 Then
UseSkillEx($hos)
EndIf
if gethascondition($lme) and DllStructGetData($lMe, 'hp') < 0.4 Then
UseSkillEx($hos)
EndIf
If GetDistance() > 1100 Then ;
If TimerDiff($ChatStuckTimer) > 3000 Then ;
SendChat("stuck", "/")
$ChatStuckTimer = TimerInit()
RndSleep(GetPing())
endIf
EndIf
Until ComputeDistance(DllStructGetData($lMe, 'X'), DllStructGetData($lMe, 'Y'), $lDestX, $lDestY) < 250
Return True
EndFunc ;==>MoveRunning
Func WaitFor($lMs,$class = 1 ) ;class cause we dont want to hos @ rangers
If GetIsDead(-2) Then Return
$lMe = GetAgentByID(-2)
Local $lTimer = TimerInit()
if $class = 1 Then
Do
if GetEffectTimeRemaining($skill_id_wd) < 1 then Return
Sleep(100)
If GetIsDead(-2) Then Return
If IsRecharged($iau) Then
UseSkillEx($iau)
EndIf
If DllStructGetData($lMe, 'hp') < 0.3 Then
UseSkillEx($hos)
EndIf
if gethascondition($lme) and DllStructGetData($lMe, 'hp') < 0.4 Then
UseSkillEx($hos)
EndIf
UseSF()
if isrecharged($mb) and geteffecttimeremaining($skill_id_mb) = 0 Then
useskillex($mb)
EndIf
Until TimerDiff($lTimer) > $lMs or GetIsDead(-2)
Else
Do
Sleep(100)
If GetIsDead(-2) Then Return
If IsRecharged($iau) Then
UseSkillEx($iau)
EndIf
UseSF()
Until TimerDiff($lTimer) > $lMs
EndIf
EndFunc ;==>WaitFor
Func loop()
If Not $RenderingEnabled Then ClearMemory()
If getmapid() <> $fow then Stucked()
out("moving to first spot")
UseSkillEx($sf)
UseSkillEx($ds)
UseSkillEx($de)
moveto(-21131, -2390)
MoveRunning(-16494, -3113)
out("starting to ball abbys")
Sleep(1000)
UseSkillEx($iau)
If IsRecharged($ds) Then
UseSkillEx($ds)
EndIf
If IsRecharged($ds) Then
UseSkillEx($ds)
EndIf
useskillex($mb)
MoveRunning(-14453, -3536)
UseSkillEx($ds)
UseSkillEx($wd)
$whirletimer = TimerInit()
MoveRunning(-13684, -2077)
MoveRunning(-14113, -418)
out("whirling abbys")
waitfor(38000 - TimerDiff($whirletimer))
out("abbys dead")
MoveRunning(-13684, -2077)
out("balling rangers")
MoveRunning(-15826, -3046)
rndsleep(1500)
moveto(-16002, -3031)
out("checking skills")
Do
if getisdead(-2) then Failed() ;Return
WaitFor(1500)
Until IsRecharged($mb) and isrecharged($wd)
moveto(-16004, -3202)
MoveRunning(-15272, -3004)
UseSkillEx($iau)
UseSkillEx($ds)
UseSkillEx($mb)
If IsRecharged($wd) Then
UseSkillEx($wd)
EndIf
If IsRecharged($mb) Then
UseSkillEx($mb)
EndIf
out("killing rangers")
MoveRunning(-14453, -3536)
moverunning(-14209, -2935)
moverunning(-14535, -2615)
waitfor(27000,2)
moveto(-14506, -2633)
out("looting")
PickUpLoot()
If Not getisdead(-2) Then
$RunsDone = $RunsDone + 1
GUICtrlSetData($LblRunsDone, $RunsDone)
Else
Failed()
;~ $RunsFailed = $RunsFailed + 1
;~ GUICtrlSetData($LblRunsFailed, $RunsFailed)
EndIf
EndFunc ;==>loop
Func GoNearestNPCToCoords($x, $y)
Local $guy, $Me
Do
RndSleep(250)
$guy = GetNearestNPCToCoords($x, $y)
Until DllStructGetData($guy, 'Id') <> 0
ChangeTarget($guy)
RndSleep(250)
GoNPC($guy)
RndSleep(250)
Do
RndSleep(500)
Move(DllStructGetData($guy, 'X'), DllStructGetData($guy, 'Y'), 40)
RndSleep(500)
GoNPC($guy)
RndSleep(250)
$Me = GetAgentByID(-2)
Until ComputeDistance(DllStructGetData($Me, 'X'), DllStructGetData($Me, 'Y'), DllStructGetData($guy, 'X'), DllStructGetData($guy, 'Y')) < 250
RndSleep(1000)
EndFunc
Func CheckGold()
Local $WithdrawnGold = 0
Local $RestGold = 0
Local $MyGold = GetGoldCharacter()
$RestGold = $MaxGold - $WithdrawnGold
If GetGoldCharacter() < 1000 Then
If ($RunsDone = 0 And $RunsFailed = 0) Then
If $MyGold > 0 Then
GoldAction("Store", $MyGold)
EndIf
Switch $MaxGold
Case ($MaxGold > 100000)
GoldAction("WithDraw", 100000)
$WithdrawnGold = 100000
Case Else
GoldAction("WithDraw",$MaxGold)
$WithdrawnGold = $MaxGold
EndSwitch
ElseIf ($RunsDone <> 0 Or $RunsFailed <> 0) Then
If $RestGold >= 1000 Then
Switch $RestGold
Case ($RestGold > 100000)
GoldAction("WithDraw", 100000)
$WithdrawnGold = $WithdrawnGold + 100000
Case Else
GoldAction("WithDraw", $RestGold)
$WithdrawnGold = $WithdrawnGold + $RestGold
EndSwitch
ElseIf $RestGold < 1000 Then
MsgBox(0, "Error!", "Not Enough Gold")
_exit()
EndIf
EndIf
EndIf
EndFunc
Func CheckInventory()
Local $OldGold = GetGoldCharacter()
Local $NewGold = 0
If CountSlots() < 5 Then
GoSelling()
$NewGold = GetGoldCharacter() - $OldGold
GoldAction("Store",$NewGold)
Sleep(2000)
EndIf
EndFunc
Func GetRndTown()
Local $Random
Local $town
For $i = 1 to 100
$Random = Random(1,3,1)
Switch $Random
Case 1
switch $fromToA
case True
$town = $toa
case False
$town = 0
EndSwitch
Case 2
switch $fromZinKU
case True
$town = $ZinKu
case False
$town = 0
EndSwitch
Case 3
Switch $fromChantry
case true
$town = $Chantry
case false
$town = 0
EndSwitch
EndSwitch
If $town = 0 then ContinueLoop
if $town <> 0 then ExitLoop
Next
Return $town
EndFunc
Func RndTravel($aMapID)
Local $UseDistricts = 11 ; 7=eu-only, 8=eu+int, 11=all(excluding America)
; Region/Language order: eu-en, eu-fr, eu-ge, eu-it, eu-sp, eu-po, eu-ru, us-en, int, asia-ko, asia-ch, asia-ja
Local $Region[11] = [2, 2, 2, 2, 2, 2, 2, -2, 1, 3, 4]
Local $Language[11] = [0, 2, 3, 4, 5, 9, 10, 0, 0, 0, 0]
Local $Random = Random(0, $UseDistricts - 1, 1)
MoveMap($aMapID, $Region[$Random], 0, $Language[$Random])
waitmaploading($amapid)
EndFunc ;==>RndTravel
Func useitembymodelid($amodelid)
Local $lItem
For $lbag = 1 To 4
For $lslot = 1 To $bag_slots[$lbag]
$lItem = getitembyslot($lbag, $lslot)
If DllStructGetData($lItem, "ModelID") == $amodelid Then Return sendpacket(8, 119, DllStructGetData($lItem, "ID"))
Next
Next
Return False
EndFunc
Func ToggleRendering()
$RenderingEnabled = Not $RenderingEnabled
If $RenderingEnabled Then
EnableRendering()
WinSetState(GetWindowHandle(), "", @

SHOW)
Else
DisableRendering()
WinSetState(GetWindowHandle(), "", @

HIDE)
ClearMemory()
EndIf
EndFunc ;==>ToggleRendering
Func Failed()
out("Failed

")
$RunsFailed = $RunsFailed + 1
GUICtrlSetData($LblRunsFailed, $RunsFailed)
ReturnToOutpost()
Sleep(2000)
clearmemory()
enterfow()
loop()
UpdateStats()
EndFunc
Func Stucked()
out("Stucked on something")
Sleep(1000)
clearmemory()
enterfow()
loop()
UpdateStats()
EndFunc
Func StuckedInFoW()
Out("Stucked in FoW. Restarting")
Resign()
Sleep(2000)
ReturnToOutpost()
Sleep(2000)
clearmemory()
enterfow()
loop()
UpdateStats()
EndFunc
Func _PurgeHook()
ToggleHook()
Sleep(Random(2000,2500))
ToggleHook()
EndFunc ;==>_PurgeHook
Func ToggleHook()
$RenderingEnabled = Not $RenderingEnabled
If $RenderingEnabled Then
EnableRendering()
Else
DisableRendering()
ClearMemory()
EndIf
EndFunc
#EndRegion
#Region Inventory & Items
Func useitembyslot($abag, $aslot)
Local $item = getitembyslot($abag, $aslot)
Return sendpacket(8, 119, DllStructGetData($item, "ID"))
EndFunc ;==>useitembyslot
Func GoldAction($task, $amount)
Switch $task
Case "WithDraw"
out("Grabbing " & $amount/1000 & "K")
If GetMapID() = $toa Then
GoNearestNPCToCoords(-6670, -18717)
WithdrawGold($amount)
ElseIf GetMapID() = $zinku Then
GoNearestNPCToCoords(8136.08, -18218.98)
WithdrawGold($amount)
ElseIf GetMapID() = $chantry Then
GoNearestNPCToCoords(-11781.12, 2678.43)
WithdrawGold($amount)
Endif
Case "Store"
Out("Storing " & $amount & " Gold")
If GetMapID() = $toa Then
GoNearestNPCToCoords(-6670, -18717)
DepositGold($amount)
ElseIf GetMapID() = $zinku Then
GoNearestNPCToCoords(8136.08, -18218.98)
DepositGold($amount)
ElseIf GetMapID() = $chantry Then
GoNearestNPCToCoords(-11781.12, 2678.43)
DepositGold($amount)
Endif
EndSwitch
EndFunc
Func GoSelling()
out("Going to Merch")
If GetMapID() = $toa Then
GoNearestNPCToCoords(-5114, 19435)
ElseIf GetMapID() = $zinku Then
GoNearestNPCToCoords(10970.73, -18917.95)
ElseIf GetMapID() = $chantry Then
GoNearestNPCToCoords(-11051.63, 2065.87)
ElseIf GetMapID() = $embark Then
TravelTo(248) ;Balthi Temple
GoNearestNPCToCoords(-4819,-737)
Endif
Out("Identifying")
;~ Identifies each bag
Ident(1)
Ident(2)
Ident(3)
Ident(4)
Out("Selling")
;~ Sells each bag
Sell(1)
Sell(2)
Sell(3)
Sell(4)
EndFunc
Func CountSlots()
Local $bag
Local $temp = 0
$bag = GetBag(1)
$temp += DllStructGetData($bag, 'Slots') - DllStructGetData($bag, 'ItemsCount')
$bag = GetBag(2)
$temp += DllStructGetData($bag, 'Slots') - DllStructGetData($bag, 'ItemsCount')
$bag = GetBag(3)
$temp += DllStructGetData($bag, 'Slots') - DllStructGetData($bag, 'ItemsCount')
$bag = GetBag(4)
$temp += DllStructGetData($bag, 'Slots') - DllStructGetData($bag, 'ItemsCount')
Return $temp
EndFunc
Func Ident($BAGINDEX)
Local $bag
Local $I
Local $AITEM
$BAG = GETBAG($BAGINDEX)
For $I = 1 To DllStructGetData($BAG, "slots")
If FINDIDKIT() = 0 Then
If GETGOLDCHARACTER() < 500 And GETGOLDSTORAGE() > 499 Then
WITHDRAWGOLD(500)
Sleep(GetPing()+500)
EndIf
Local $J = 0
Do
BuyItem(6, 1, 500)
Sleep(GetPing()+500)
$J = $J + 1
Until FINDIDKIT() <> 0 Or $J = 3
If $J = 3 Then ExitLoop
Sleep(GetPing()+500)
EndIf
$AITEM = GETITEMBYSLOT($BAGINDEX, $I)
If DllStructGetData($AITEM, "ID") = 0 Then ContinueLoop
IDENTIFYITEM($AITEM)
Sleep(GetPing()+500)
Next
EndFunc
Func Sell($BAGINDEX)
Local $AITEM
Local $BAG = GETBAG($BAGINDEX)
Local $NUMOFSLOTS = DllStructGetData($BAG, "slots")
For $I = 1 To $NUMOFSLOTS
Out("Selling item: " & $BAGINDEX & ", " & $I)
$AITEM = GETITEMBYSLOT($BAGINDEX, $I)
If DllStructGetData($AITEM, "ID") = 0 Then ContinueLoop
If CANSELL($AITEM) Then
SELLITEM($AITEM)
EndIf
Sleep(GetPing()+250)
Next
EndFunc
Func CanSell($aItem)
Local $m= DllStructGetData($aitem, "ModelID")
Local $r = GetRarity($aitem)
If $r == $RARITY_GOLD Then
Switch $m
Case $scroll
Return False
Case else
Switch $SellGold
Case True
Switch $m
Case $scroll, $chaosaxe
Return False
EndSwitch
Return True
Case False
Return False
EndSwitch
EndSwitch
EndIf
If $r == $RARITY_PURPLE Then
Switch $SellPurple
Case True
Return True
Case False
Return False
EndSwitch
EndIf
If $r == $RARITY_BLUE Then
Switch $SellBlue
Case True
Return True
Case False
Return False
EndSwitch
EndIf
If $r == $RARITY_WHITE Then
Switch $SellWhite
Case True
Switch $m
case $darkremains, $ruby, $saph, $obbykey, $shard
return False
case Else
return True
EndSwitch
Case False
Return False
EndSwitch
EndIf
EndFunc ;==>CANSELL
Func PickUpLoot()
useskillex($de)
Local $lMe
Local $lBlockedTimer
Local $lBlockedCount = 0
Local $lItemExists = True
For $i = 1 To GetMaxAgents()
$lMe = GetAgentByID(-2)
If DllStructGetData($lMe, 'HP') <= 0.0 Then Return -1
$lAgent = GetAgentByID($i)
If Not GetIsMovable($lAgent) Then ContinueLoop
If Not GetCanPickUp($lAgent) Then ContinueLoop
$lItem = GetItemByAgentID($i)
If canpickup($lItem) Then
Do
if $lBlockedCount > 2 Then
useskillex($hos)
EndIf
;~ If GetDistance($lItem) > 150 Then Move(DllStructGetData($lItem, 'X'), DllStructGetData($lItem, 'Y'), 100)
PickUpItem($lItem)
Sleep(GetPing())
Do
Sleep(100)
$lMe = GetAgentByID(-2)
Until DllStructGetData($lMe, 'MoveX') == 0 And DllStructGetData($lMe, 'MoveY') == 0
$lBlockedTimer = TimerInit()
Do
Sleep(3)
$lItemExists = IsDllStruct(GetAgentByID($i))
Until Not $lItemExists Or TimerDiff($lBlockedTimer) > Random(5000, 7500, 1)
If $lItemExists Then $lBlockedCount += 1
Until Not $lItemExists Or $lBlockedCount > 5
EndIf
Next
EndFunc ;==>PickUpLoot
Func canpickup($lItem)
$m = DllStructGetData($lItem, 'ModelID')
$c = DllStructGetData($lItem, 'ExtraID')
$r = GetRarity($lItem)
If $r = $RARITY_WHITE Then
Switch $PickupWhite
Case True
Return True
Case False
Switch $m
Case $ruby, $saph, $obbykey, $darkremains, $shard
Return True
Case 2511
switch $PickupCoins
Case True
Return True
Case False
Return False
EndSwitch
Case 146
Switch $c
case $C_BLACKDYE, $C_WHITEDYE
Return True
case Else
Return False
EndSwitch
Case else
return False
EndSwitch
EndSwitch
EndIf
If $r = $RARITY_BLUE Then
Switch $PickupBlue
Case True
return True
Case False
return False
EndSwitch
EndIf
If $r = $RARITY_PURPLE Then
Switch $PickupPurple
Case True
return True
Case False
return False
EndSwitch
EndIf
If $r = $RARITY_GOLD then
Switch $PickupGolds
Case True
Switch $m
case $scroll
switch $PickupScrolls
case True
return True
case False
return false
EndSwitch
case else
return true
EndSwitch
case false
Switch $m
case $scroll
switch $PickupScrolls
case True
return True
case False
return false
EndSwitch
case else
return False
EndSwitch
EndSwitch
EndIf
EndFunc ;==>canpickup
Func GetShardCount()
Local $AAMOUNTShards
Local $aBag
Local $aItem
Local $i
For $i = 1 To 4
$aBag = GetBag($i)
For $j = 1 To DllStructGetData($aBag, "Slots")
$aItem = GetItemBySlot($aBag, $j)
If DllStructGetData($aItem, "ModelID") == $shard Then
$AAMOUNTShards += DllStructGetData($aItem, "Quantity")
Else
ContinueLoop
EndIf
Next
Next
Return $AAMOUNTShards
EndFunc
Func GetScrollCount()
Local $AAMOUNTScrolls
Local $aBag
Local $aItem
Local $i
For $i = 1 To 4
$aBag = GetBag($i)
For $j = 1 To DllStructGetData($aBag, "Slots")
$aItem = GetItemBySlot($aBag, $j)
If DllStructGetData($aItem, "ModelID") == $scroll Then
$AAMOUNTScrolls += DllStructGetData($aItem, "Quantity")
Else
ContinueLoop
EndIf
Next
Next
Return $AAMOUNTScrolls
EndFunc
#EndRegion