Advertisement
forzakenus

Coal dropper

Dec 11th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1. function drop_coal()
  2.     coal = turtle.getItemCount()
  3.     if(coal==0) then
  4.         turtle.select(turtle.getSelectedSlot()+1)
  5.         drop_coal()
  6.     else
  7.         turtle.drop(1)
  8.     end    
  9. end
  10.  
  11. while true do
  12.     if redstone.getAnalogInput('front')==0 then
  13.     drop_coal()
  14.     os.sleep(0.3)
  15.     else
  16.     os.sleep(5)
  17.     end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement