Advertisement
MatthewJ217

Raw Control

Oct 23rd, 2022 (edited)
1,096
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. -- Directly move the turtle with keyboard inputs
  2.  
  3. local moves = {
  4. [32] = turtle.up,
  5. [340] = turtle.down,
  6. [87] = turtle.forward,
  7. [83] = turtle.back,
  8. [65] = turtle.turnLeft,
  9. [68] = turtle.turnRight,
  10. [265] = turtle.digUp,
  11. [264] = turtle.digDown,
  12. [262] = turtle.dig,
  13. [81] = turtle.place,
  14. [90] = turtle.placeDown,
  15. [50] = turtle.placeUp,
  16. [82] = turtle.refuel
  17. };
  18.  
  19. while true do
  20.     local event, key, is_held = os.pullEvent("key")
  21.     moves[key]();
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement