Working on old dust farmer anyone having an idea why the loot doesn't get collected at all?
Here the functions used:
Func Farm()
If Not $WeAreDead Then CurrentAction("Nightmare Group 1/3")
If Not $WeAreDead Then Engage()
If Not $WeAreDead Then CollectObject()
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then CurrentAction("Nightmare Group 2/3")
If Not $WeAreDead Then Engage()
If Not $WeAreDead Then CollectObject()
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead then CurrentAction("Recharging Life-Energy-Skills")
local $timertobethebest = TimerInit()
If Not $WeAreDead then
Do
Sleep(200)
$me2 = GetAgentByID(-2)
Until (DllStructGetData($me2, 'EnergyPercent') = .7 And DllStructGetData($me2, 'HP') = .8) or TimerDiff($timertobethebest) > 15000
EndIf
If Not $WeAreDead then MoveTo(7321, -3438)
If Not $WeAreDead Then CurrentAction("Nightmare Group 3/3")
If Not $WeAreDead Then Engage()
If Not $WeAreDead Then CollectObject()
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(10338, -5940, $enemy)
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(12720, -5286, $enemy)
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(12588, -818, $enemy)
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(12432, 1077, $enemy)
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(10303, 980, $enemy)
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(9720, 2245, $enemy)
AdlibUnRegister("CheckDeath")
AdlibUnRegister("HealYourself")
CurrentAction("End Of Run")
EndFunc
Func CollectObject()
Sleep(800)
If Not $WeAreDead Then CurrentAction("Pickup Loot")
PickupLoot()
;PickupLoot() ;Need to edit Canpickup list and create checkbox for: pickup all = PickupItems
CheckIfInventoryIsFull()
If Not $WeAreDead Then CurrentAction("Recharging")
Do
local $NearestAgent = GetNearestEnemyToAgent(-2)
$distance = @

If $distance < 1020 Then
Fight2()
CollectObject()
EndIf
If Not $WeAreDead Then RndSlp(500)
Until (DllStructGetData(GetAgentByID(-2), 'EnergyPercent') >= 0.9 OR $WeAreDead)
UseSkillEx(8,0)
UseSkillEx(7,0)
EndFunc;==>CollectObject
Func CanPickUp($aItem)
Local $lModelID = DllStructGetData(($aItem), 'ModelId')
Local $aExtraID = DllStructGetData($aItem, 'ExtraId')
Local $lRarity = GetRarity($aItem)
Local $Requirement = GetItemReq($aItem)
If ($lModelID == 2511) Then
If (GetGoldCharacter() < 99000) Then
Return True ; gold coins (only pick if character has less than 99k in inventory)
Else
Return False
EndIf
ElseIf ($lModelID == $ITEM_ID_Dyes) Then ; if dye
If (($aExtraID == $ITEM_ExtraID_BlackDye) Or ($aExtraID == $ITEM_ExtraID_WhiteDye)) Then ; only pick white and black ones
Return True
EndIf
ElseIf ($lRarity == $RARITY_Gold) Then ; gold items
$GoldsCount = $GoldsCount + 1
GUICtrlSetData($GUI_Golds,$GoldsCount)
Return True
ElseIf ($lRarity == $RARITY_Purple) Then ; purple items
Return True
ElseIf ($lRarity == $RARITY_Blue) Then ; blue items
Return True
ElseIf ($lRarity == $RARITY_White) Then ; White items
Return True
Else
Return False
EndIf
EndFunc
Func PickupItems($iItems = -1, $fMaxDistance = 1012)
Local $aItemID, $lNearestDistance, $lDistance
$tDeadlock = TimerInit()
Do
$aItem = GetNearestItemToAgent(-2)
$lDistance = @
$aItemID = DllStructGetData($aItem, 'ID')
If $aItemID = 0 Or $lDistance > $fMaxDistance Or TimerDiff($tDeadlock) > 30000 Then ExitLoop
PickUpItem($aItem)
$tDeadlock2 = TimerInit()
Do
Sleep(500)
If TimerDiff($tDeadlock2) > 5000 Then ContinueLoop 2
Until DllStructGetData(GetAgentById($aItemID), 'ID') == 0
$iItems_Picked += 1
;UpdateStatus("Picked total " & $iItems_Picked & " items")
Until $iItems_Picked = $iItems
Return $iItems_Picked
EndFunc ;==>PickupItems