Advertisement
sanovskiy

Block Placer

Aug 21st, 2014
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. function doNothing()
  2.     os.queueEvent("randomEvent")
  3.     os.pullEvent()
  4. end
  5.  
  6. sideIn="left"
  7. sideOut="right"
  8. curslot=1
  9. while true do
  10.   while turtle.getItemCount(curslot)<1 do
  11.     rs.setOutput(sideOut,true)
  12.     curslot=curslot+1
  13.     if curslot>16 then
  14.       curslot=1
  15.     end
  16.     doNothing()
  17.   end
  18.   rs.setOutput(sideOut,false)
  19.   turtle.select(curslot)
  20.   if rs.getInput(sideIn) and not(turtle.detect()) then
  21.     if turtle.place() then
  22.       doNothing()
  23.     end
  24.   else
  25.     doNothing()
  26.   end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement