Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- local direction = tArgs[1]
- local distance = tArgs[2]
- if not direction then
- iox.colorPrint("No direction given: forward, back, up or down", colors.red)
- return
- elseif direction ~= "forward" and direction ~= "back" and direction ~= "up" and
- direction ~= down then
- iox.colorPrint("Invalid direction: "..direction..
- ", use forward, back, up or down", colors.red)
- return
- end
- if not distance then
- distance = 1
- end
- if direction == "forward" then
- navigate.forward(distance)
- elseif direction == "back" then
- navigate.back(distance)
- elseif direction == "up" then
- navigate.up(distance)
- elseif direction == "down" then
- navigate.down(distance)
- end
Advertisement
Add Comment
Please, Sign In to add comment