Advertisement
Fwaky

Depotbox depositer - Windbot

Jul 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.34 KB | None | 0 0
  1. --### Dehan's Depot Boxes Depositer v1.0.0 ###
  2. --### Modified by Strahowski to not use looting ###--
  3. --### Modification inspired by Garkstal inf depositer ###--
  4. local lootingBp = "Orange backpack"
  5. local nonstackableNumber = 7
  6. local stackableNumber = 8
  7. local ignore = {"gold coin", "platinum coin"}                -- Will not move these items
  8.  
  9. -- Do not edit anything below this line
  10. for i=1, #ignore do
  11.     ignore[i] = itemid(ignore[i])
  12. end
  13.  
  14. --[[DO NOT EDIT BELOW THIS LINE]]--
  15.  
  16. setsetting('Looting/OpenNextBP', 'no')
  17. waitping()
  18. closewindows()  wait(1500)
  19. while windowcount(lootingBp) == 0 do
  20.     closewindows()  wait(1000)
  21.     openitem($back.id,'back')   wait(1000)
  22.     openitem(lootingBp,itemname($back.id),true) wait(1000)
  23.     resizewindows()
  24. end
  25. print("Bp opened, opening depot")
  26. while windowcount("Depot Chest") == 0 do
  27.     opendepot(true)
  28.     wait(300)
  29.     openitem(3502)
  30.     wait(500)
  31. end
  32. print("depot opened, onwards")
  33. local depotId = 22796
  34. local stackableId = depotId + stackableNumber
  35. local nonstackableId = depotId + nonstackableNumber
  36.  
  37. local cont = getcontainer(lootingBp)
  38. while windowcount(cont.name) > 0 do
  39.     local j = 1
  40.     for i=1, cont.itemcount do
  41.         local info = iteminfo(cont.item[j].id)
  42.         print(info)
  43.         print(info.iscontainer)
  44.         if not info.iscontainer and not table.find(ignore, info.id) then
  45.             if info.iscumulative then
  46.                 --
  47.                 moveitemsonto(info.id, stackableId, 1, 'depot chest', lootingBp, 100)
  48.                 waitping()
  49.             else
  50.                 --
  51.                 moveitemsonto(info.id, nonstackableId, 1, 'depot chest', lootingBp, 100)
  52.                 waitping()
  53.             end
  54.         else
  55.             j = j + 1
  56.         end
  57.     end
  58.  
  59.     local function isItemIn(name)
  60.         local val = false
  61.         for i=1, getcontainer(name).itemcount do
  62.             if not iteminfo(getcontainer(name).item[i].id).iscontainer and not table.find(ignore, getcontainer(name).item[i].id) then
  63.                 val = true
  64.                 break
  65.             end
  66.         end
  67.         return val
  68.     end
  69.  
  70.     if not isItemIn(lootingBp) then
  71.         if itemcount(lootingBp, lootingBp) > 0 then
  72.             openitem(lootingBp, lootingBp, false)
  73.             wait(300, 400)
  74.         else
  75.             closewindows(lootingBp)
  76.         end
  77.     end
  78. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement