Advertisement
tobast

[CC] Obsimaker

Aug 4th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. function pulse(side)
  2.     redstone.setOutput(side, true)
  3.     os.sleep(0.1)
  4.     redstone.setOutput(side,false)
  5. end
  6.  
  7. function condense()
  8.     for slot=2,16 do
  9.         turtle.select(slot)
  10.         turtle.transferTo(1)
  11.         if(turtle.getItemSpace(1) == 0) then
  12.             break
  13.         end
  14.     end
  15.     turtle.select(1)
  16. end
  17.  
  18. while true do
  19.     turtle.place()
  20.  
  21.     while true do
  22.         os.pullEvent('redstone')
  23.         if(redstone.getInput('back') == true) then
  24.             break
  25.         end
  26.     end
  27.  
  28.     while true do
  29.         if(redstone.getInput('back') == false) then
  30.             break
  31.         end
  32.  
  33.         pulse('left')
  34.         os.sleep(0.2)
  35.         turtle.place()
  36.         if(turtle.getItemCount(1) == 0) then
  37.             condense()
  38.             if(turtle.getItemCount(1) == 0) then
  39.                 print("Done! Reload and press enter to continue.")
  40.                 read()
  41.                 break
  42.             end
  43.         end
  44.         os.sleep(3)
  45.     end
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement