Advertisement
MaxBerz

bewegen

Sep 23rd, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. function vor ()
  2. while not turtle.forward() do
  3. turtle.dig()
  4. turtle.attack()
  5. end
  6. end
  7. function hoch ()
  8. while not turtle.up() do
  9. turtle.digUp()
  10. turtle.attackUp()
  11. end
  12. end
  13. function runter ()
  14. while not turtle.down() do
  15. turtle.digDown()
  16. turtle.attackDown()
  17. end
  18. end
  19.  
  20.  
  21. eingabe = "x"
  22. print("v or")
  23.  
  24. print("z urück")
  25.  
  26. print("r echts")
  27.  
  28. print("l inks")
  29.  
  30. print("o ben")
  31.  
  32. print("u nten")
  33.  
  34. print("e nde")
  35.  
  36. while eingabe ~= "e" do
  37. eingabe = read()
  38. if eingabe == "v" then
  39. vor()
  40. elseif eingabe == "z" then
  41. turtle.back()
  42. elseif eingabe == "r" then
  43. turtle.turnRight()
  44. elseif eingabe == "l" then
  45. turtle.turnLeft()
  46. elseif eingabe == "o" then
  47. hoch()
  48. elseif eingabe == "u" then
  49. runter()
  50. end
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement