Advertisement
Tomyf4

ThirstyTurtleCode

Jan 30th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. print("Please remember to insert fuel")
  2. print("Awaiting input..")
  3.  
  4. bucket = peripheral.wrap("left")
  5. holding = 0
  6.  
  7. while true do
  8. local input, character = os.pullEvent("char")
  9. if character == "w" then
  10. turtle.forward()
  11. print("Moving forward")
  12. elseif character == "s" then
  13. turtle.back()
  14. print("Moving back")
  15. elseif character == "a" then
  16. turtle.turnLeft()
  17. print("Turning Left")
  18. elseif character == "d" then
  19. turtle.turnRight()
  20. print("Turning Right")
  21. elseif character == "q" then
  22. turtle.up()
  23. print("Moving up")
  24. elseif character == "e" then
  25. turtle.down()
  26. print("Moving down")
  27. elseif character == "f" and holding == 0 then
  28. bucket.suckDown()
  29. holding = 1
  30. print("Sucking Liquid")
  31. elseif character == "f" and holding == 1 then
  32. bucket.place()
  33. holding = 0
  34. print("Placing Liquid")
  35. end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement