Cakejoke

[CC] COS-CJE turn program

Dec 22nd, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. local tArgs = {...}
  2. local direction = tArgs[1]
  3. local times = tArgs[2]
  4.  
  5. if not direction then
  6.     iox.colorPrint("No direction given: left or right", colors.red)
  7.     return
  8. elseif direction ~= "left" and direction ~= "right" then
  9.     iox.colorPrint("Invalid direction: "..direction..", use left or right", colors.red)
  10.     return
  11. end
  12. if not times then
  13.     times = 1
  14. end
  15.  
  16. if direction == "left" then
  17.     navigate.turnLeft(times)
  18. elseif direction == "right" then
  19.     navigate.turnRight(times)
  20. end
Advertisement
Add Comment
Please, Sign In to add comment