SHARE
TWEET

Untitled

a guest Jul 25th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Func PickUpLoot()
  2.     Local $lAgent
  3.     Local $aitem
  4.     Local $lDeadlock
  5.     For $i = 1 To GetMaxAgents()
  6.         If GetIsDead(-2) Then Return
  7.         $lAgent = GetAgentByID($i)
  8.         If DllStructGetData($lAgent, 'Type') <> 0x400 Then ContinueLoop
  9.         $aitem = GetItemByAgentID($i)
  10.         If CanPickUp($aitem) Then
  11.             PickUpItem($aitem)
  12.             $lDeadlock = TimerInit()xxxxx
  13.             While GetAgentExists($i)
  14.                 Sleep(100)
  15.                 If GetIsDead(-2) Then Return
  16.                 If TimerDiff($lDeadlock) > 10000 Then ExitLoop
  17.             WEnd
  18.         EndIf
  19.     Next
  20. EndFunc   ;==>PickUpLoot
  21.  
  22.  
  23.  
  24. ; Checks if should pick up the given item. Returns True or False
  25. Func CanPickUp($aItem)
  26.     Local $lModelID = DllStructGetData(($aItem), 'ModelID')
  27.     Local $lRarity = GetRarity($aItem)
  28.     If $lModelID == 2511 And GetGoldCharacter() < 99000 Then Return True    ; gold coins (only pick if character has less than 99k in inventory)
  29.     ;If $lModelID > 21785 And $lModelID < 21806 Then Return True    ; Elite/Normal Tomes
  30.     If $lModelID == $ITEM_ID_DYES Then  ; if dye
  31.         Switch DllStructGetData($aItem, "ExtraID")
  32.             Case $ITEM_EXTRAID_BLACKDYE, $ITEM_EXTRAID_WHITEDYE ; only pick white and black ones
  33.                 Return False
  34.             Case Else
  35.                 Return False
  36.         EndSwitch
  37.     EndIf
  38.     If $lRarity == $RARITY_GOLD             Then Return True; gold items
  39.     If $lModelID == $ITEM_ID_LOCKPICKS      Then Return True ; Lockpicks
  40.     If $lModelID == $ITEM_ID_GLACIAL_STONES Then Return True ; glacial stones
  41.     ; ==== Pcons ====
  42.     If $lModelID == $ITEM_ID_TOTS           Then Return True
  43.     If $lModelID == $ITEM_ID_GOLDEN_EGGS    Then Return True
  44.     If $lModelID == $ITEM_ID_BUNNIES        Then Return True
  45.     If $lModelID == $ITEM_ID_GROG           Then Return True
  46.     If $lModelID == $ITEM_ID_CLOVER         Then Return True
  47.     If $lModelID == $ITEM_ID_PIE            Then Return True
  48.     If $lModelID == $ITEM_ID_CIDER          Then Return True
  49.     If $lModelID == $ITEM_ID_POPPERS        Then Return True
  50.     If $lModelID == $ITEM_ID_ROCKETS        Then Return True
  51.     If $lModelID == $ITEM_ID_CUPCAKES       Then Return True
  52.     If $lModelID == $ITEM_ID_SPARKLER       Then Return True
  53.     If $lModelID == $ITEM_ID_HONEYCOMB      Then Return True
  54.     If $lModelID == $ITEM_ID_VICTORY_TOKEN  Then Return True
  55.     If $lModelID == $ITEM_ID_LUNAR_TOKEN    Then Return True
  56.     If $lModelID == $ITEM_ID_HUNTERS_ALE    Then Return True
  57.     If $lModelID == $ITEM_ID_LUNAR_TOKENS   Then Return True
  58.     If $lModelID == $ITEM_ID_KRYTAN_BRANDY  Then Return True
  59.     If $lModelID == $ITEM_ID_BLUE_DRINK     Then Return True
  60.     If $lModelID == $ITEM_ID_GHOST_IN_A_BOX Then Return True
  61.     If $lModelID == $ITEM_ID_SHAMROCK_ALE   Then Return True
  62.  
  63.     ; If you want to pick up more stuff add it here
  64.     Return False
  65. EndFunc   ;==>CanPickUp
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top