Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Directly move the turtle with keyboard inputs
- local moves = {
- [32] = turtle.up,
- [340] = turtle.down,
- [87] = turtle.forward,
- [83] = turtle.back,
- [65] = turtle.turnLeft,
- [68] = turtle.turnRight,
- [265] = turtle.digUp,
- [264] = turtle.digDown,
- [262] = turtle.dig,
- [81] = turtle.place,
- [90] = turtle.placeDown,
- [50] = turtle.placeUp,
- [82] = turtle.refuel
- };
- while true do
- local event, key, is_held = os.pullEvent("key")
- moves[key]();
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement