Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function Move(key)
- print("trying to move" , key)
- if key == 265 then --up arrow
- turtle.forward()
- elseif key == 264 then -- down arrow
- turtle.back()
- elseif key == 262 then -- right arrow
- turtle.turnRight()
- elseif key == 261 then -- left arrow
- turtle.turnLeft()
- elseif key == 344 then -- right shift
- turtle.digUp()
- turtle.up()
- elseif key == 345 then -- right control
- turtle.digDown()
- turtle.down()
- end
- end
- print("program started")
- while true do
- local event, key, is_held = os.pullEvent("key")
- if key == 32 then
- turtle.dig()
- else
- Move(key)
- end
- end
Add Comment
Please, Sign In to add comment