Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. function getSlot(name, damage)
  2.   for i=1,16 do
  3.     local data = turtle.getItemDetail(i)
  4.    
  5.     if data and data.name == name and data.damage == damage then
  6.       return i
  7.     end
  8.  
  9.   end  
  10.  
  11.   return 0
  12. end
  13.  
  14. function dropSlot(slot)
  15.  
  16.  
  17. function update()
  18.   local slots = {
  19.     getSlot("Botania:manaResource", 0),
  20.     getSlot("Botania:manaResource", 1),
  21.     getSlot("Botania:manaResource", 2)
  22.   }
  23.  
  24.   for i,slot in slots do
  25.     if slot == 0 then
  26.       return
  27.     end
  28.   end
  29.  
  30.   for i,slot in slots do
  31.     turtle.select(slot)
  32.     turtle.dropDown(1)
  33.   end
  34. end
  35.  
  36. update()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement