Advertisement
denvys5

DropCrafting

Oct 1st, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. t = turtle
  2.  
  3. result = {}
  4.  
  5. sleeptime = 10
  6.  
  7. function getItemFromFluid()
  8.     for i=1,16 do
  9.         t.select(i)
  10.         t.suck()
  11.     end
  12. end
  13.  
  14. function checkItem(slot)
  15.     item = t.getItemDetail(slot)
  16.     t.select(slot)
  17.     for i = 1,#result do
  18.         if item.name == result[i] then
  19.             t.drop()
  20.         else
  21.             t.dropDown()
  22.         end
  23.     end
  24. end
  25.  
  26. function checkInventory()
  27.     for i = 1,16 do
  28.         if t.getItemCount(i) > 0 then
  29.             checkItem(i)
  30.         end
  31.     end
  32. end
  33.  
  34. function main()
  35.     getItemFromFluid()
  36.     checkInventory()
  37.     sleep(sleeptime)
  38. end
  39.  
  40. while true do
  41.     main()
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement