Advertisement
Guest User

CC Turtle program for replacing two items

a guest
Nov 14th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. -- redstone off -> set slot1 item
  2. -- redstone on -> set slot2 item
  3.  
  4. -- 1. Set the slot1 item into the forward chest.
  5. -- 2. Turtle's inventory: slot1 is empty, and slot2 has an item.
  6. -- 3. Execute this program.
  7.  
  8. RS_SIDE = 'top'
  9.  
  10. while true do
  11. if (not rs.getInput(RS_SIDE)) and (turtle.getItemSpace(1) ~= 64) and (turtle.getItemSpace(2) == 64) then
  12. turtle.select(2)
  13. turtle.suck()
  14. turtle.select(1)
  15. turtle.drop()
  16. elseif rs.getInput(RS_SIDE) and (turtle.getItemSpace(2) ~= 64) and (turtle.getItemSpace(1) == 64) then
  17. turtle.select(1)
  18. turtle.suck()
  19. turtle.select(2)
  20. turtle.drop()
  21. end
  22. sleep(1)
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement