Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.34 KB | None | 0 0
  1.  Func Store()
  2.     StoreBag(1)
  3.     StoreBag(2)
  4.     StoreBag(3)
  5.     StoreBag(4)
  6.  EndFunc
  7.  
  8.  Func UnStore()
  9.     For $i = 6 To 16
  10.          StoreChest($i)
  11.     Next
  12.  EndFunc
  13.  
  14. Func StoreBag($aBag)
  15.    Out("Storing bag " & $aBag)
  16.    If Not IsPtr($aBag) Then $aBag = GetBagPtr($aBag)
  17.    Local $lItem
  18.    Local $lSlot
  19.  
  20.    If IsChestFull() Then
  21.       $boolRunning = False
  22.    EndIf
  23.  
  24.    For $i = 1 To MemoryRead($aBag + 32, 'long')
  25.  
  26.       If $boolRunning = False Then
  27.          ExitLoop
  28.       EndIf
  29.  
  30.       $stockable = false
  31.       $lItem = GetItemPtrBySlot($aBag, $i)
  32.       If $lItem = 0 Then ContinueLoop
  33.       $m = MemoryRead($lItem + 44, 'long')
  34.       $r = GetRarity($lItem)
  35.  
  36.       If _ArraySearch($ArrayModelIDInv, $m) <> -1 Then
  37.          $stockable = True
  38.       ElseIf $r = $rGold And getchecked($iGold) Then
  39.          $stockable = True
  40.       EndIf
  41.  
  42.       If $stockable == True Then
  43.          $lExtraID = MemoryRead($lItem + 34, 'short')
  44.          $lSlot = FindStorageStack($m, $lExtraID)
  45.          If IsArray($lSlot) And getchecked($iGold) == False Then
  46.             MoveItem($lItem, $lSlot[0], $lSlot[1])
  47.             Sleep(GetPing() + Random(500, 750, 1))
  48.             $i -= 1
  49.          Else
  50.             $lSlot = OpenStorageSlot()
  51.             If IsArray($lSlot) Then
  52.                MoveItem($lItem, $lSlot[0], $lSlot[1])
  53.                Sleep(GetPing() + Random(500, 750, 1))
  54.             EndIf
  55.          EndIf
  56.       EndIf
  57.    Next
  58. EndFunc   ;==>StoreBag
  59.  
  60. Func StoreChest($aBag)
  61.    Out("UnStoring chest " & $aBag & ".")
  62.    If Not IsPtr($aBag) Then $aBag = GetBagPtr($aBag)
  63.    Local $lItem
  64.    Local $lSlot
  65.  
  66.    If IsInvFull() Then
  67.       $boolRunning = False
  68.    EndIf
  69.  
  70.    For $i = 1 To MemoryRead($aBag + 32, 'long')
  71.  
  72.       If $boolRunning = False Then
  73.          ExitLoop
  74.       EndIf
  75.  
  76.       $stockable = false
  77.       $lItem = GetItemPtrBySlot($aBag, $i)
  78.       If $lItem = 0 Then ContinueLoop
  79.       $m = MemoryRead($lItem + 44, 'long')
  80.       $r = GetRarity($lItem)
  81.  
  82.       If _ArraySearch($ArrayModelIDInv, $m) <> -1 Then
  83.          $stockable = True
  84.       ElseIf $r = $rGold And getchecked($iGold) Then
  85.          $stockable = True
  86.       EndIf
  87.  
  88.       If $stockable == True Then
  89.          $lSlot = FindBackpackStack($m)
  90.          If IsArray($lSlot) And getchecked($iGold) == False Then
  91.             MoveItem($lItem, $lSlot[0], $lSlot[1])
  92.             Sleep(GetPing() + Random(500, 750, 1))
  93.             $i -= 1
  94.          Else
  95.             $lSlot = OpenInventorySlot()
  96.             If IsArray($lSlot) Then
  97.                MoveItem($lItem, $lSlot[0], $lSlot[1])
  98.                Sleep(GetPing() + Random(500, 750, 1))
  99.             EndIf
  100.          EndIf
  101.       EndIf
  102.    Next
  103. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement