Advertisement
Guest User

HappyMove

a guest
Dec 22nd, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. while true do
  2. event, param1=os.pullEvent("key")
  3. if param1==200 then --Hoch
  4. if turtle.forward() == true then
  5. print("Erfolgreich 1 Feld FORWARD bewegt")
  6. else
  7. print("Fehler")
  8. end
  9. end
  10. if param1==203 then --Links
  11. if turtle.turnLeft() == true then
  12. print("Erfolgreich nach LINKS gedreht")
  13. else
  14. print("Fehler")
  15. end
  16. end
  17. if param1==205 then --Rechts
  18. if turtle.turnRight() == true then
  19. print("Erfolgreich nach RECHTS gedreht")
  20. else
  21. print("Fehler")
  22. end
  23. end
  24. if param1==208 then --Runter
  25. if turtle.back() == true then
  26. print("Erfolgreich 1 Feld BACK bewegt")
  27. else
  28. print("Fehler")
  29. end
  30. end
  31. if param1==72 then --Num8
  32. if turtle.up() == true then
  33. print("Erfolgreich 1 Feld UP bewegt")
  34. else
  35. print("Fehler")
  36. end
  37. end
  38. if param1==80 then --Num2
  39. if turtle.down() == true then
  40. print("Erfolgreich 1 Feld DOWN bewegt")
  41. else
  42. print("Fehler")
  43. end
  44. end
  45. if param1==73 then --Num9
  46. if turtle.digUp() == true then
  47. print("Erfolgreich 1 Feld UP geturtelt")
  48. else
  49. print("Fehler")
  50. end
  51. end
  52. if param1==77 then --Num6
  53. if turtle.dig() == true then
  54. print("Erfolgreich 1 Feld FRONT geturtelt")
  55. else
  56. print("Fehler")
  57. end
  58. end
  59. if param1==81 then --Num3
  60. if turtle.digDown() == true then
  61. print("Erfolgreich 1 Feld DOWN geturtelt")
  62. else
  63. print("Fehler")
  64. end
  65. end
  66. if param1==201 then --Page up
  67. slot = turtle.getSelectedSlot()
  68. if slot == 16 then
  69. slot = 1
  70. else
  71. slot = slot + 1
  72. end
  73. if turtle.select(slot) then
  74. print("Erfolgreich nächsten Slot ausgewählt")
  75. else
  76. print("Fehler")
  77. end
  78. end
  79. if param1==209 then --Page down
  80. slot = turtle.getSelectedSlot()
  81. if slot == 1 then
  82. slot = 16
  83. else
  84. slot = slot - 1
  85. end
  86. if turtle.select(slot) then
  87. print("Erfolgreich nächsten Slot ausgewählt")
  88. else
  89. print("Fehler")
  90. end
  91. end
  92. if param1==71 then -- Num7
  93. if turtle.placeUp() == true then
  94. print("Erfolgreich 1 Block UP gesetzt")
  95. else
  96. print("Fehler")
  97. end
  98. end
  99.  
  100. if param1==75 then --Num4
  101. if turtle.place() == true then
  102. print("Erfolgreich 1 Block FRONT gesetzt")
  103. else
  104. print("Fehler")
  105. end
  106. end
  107.  
  108. if param1==79 then --Num1
  109. if turtle.placeDown() == true then
  110. print("Erfolgreich 1 Block DOWN gesetzt")
  111. else
  112. print("Fehler")
  113. end
  114. end
  115.  
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement