Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome to Quick Move.")
- print("To begin, read the movement codes")
- print("and make sure your turtle is fueled.")
- print("Forward - 'w'")
- print("Backward - 's'")
- print("Up - 'q'")
- print("Down - 'e'")
- print("Turn Left - 'a'")
- print("Turn Right - 'd'")
- print("Dig - 'x'")
- print("Exit - Left CTRL")
- while true do
- local event, param1 = os.pullEvent()
- if event == "key" then
- if param1 == 17 then -- 'w'
- turtle.forward()
- end
- if param1 == 30 then -- 'a'
- turtle.turnLeft()
- end
- if param1 == 31 then -- 's'
- turtle.back()
- end
- if param1 == 32 then -- 'd'
- turtle.turnRight()
- end
- if param1 == 16 then -- 'q'
- turtle.up()
- end
- if param1 == 18 then -- 'e'
- turtle.down()
- end
- if param1 == 45 then -- 'x'
- turtle.dig()
- end
- if param1 == 29 then -- Left CTRL
- term.clear()
- term.setCursorPos(1,1)
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment