06/30/2016, 20:55
|
#3
|
elite*gold: 0
Join Date: Apr 2010
Posts: 2,297
Received Thanks: 325
|
Here
Quote:
Func PickUpLoot()
Local $lMe
Local $lBlockedTimer
Local $lBlockedCount = 0
Local $lItemExists = True
Local $Distance
For $i = 1 To GetMaxAgents()
If GetIsDead(-2) Then Return False
$lAgent = GetAgentByID($i)
If Not GetIsMovable($lAgent) Then ContinueLoop
$lDistance = GetDistance($lAgent)
If $lDistance > 2000 Then ContinueLoop
$lItem = GetItemByAgentID($i)
If CanPickup($lItem) Then
Do
If GetDistance($lAgent) > 150 Then Move(DllStructGetData($lAgent, 'X'), DllStructGetData($lAgent, '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(500, 1000, 1)
If $lItemExists Then $lBlockedCount += 1
Until Not $lItemExists Or $lBlockedCount > 5
EndIf
Next
EndFunc
|
|
|
|