Advertisement
Doob

pos

Sep 18th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. local tA = {...}
  2.  
  3. local robot = require('robot')
  4.  
  5. local function printPos()
  6.   local x, y, z, s = robot.getPos()
  7.   print('position:\n  x = '..x..'\n  y = '..y..'\n  z = '..z..'\n  side = '..s)
  8. end
  9.  
  10. if #tA == 0 then
  11.   printPos()
  12. elseif #tA == 4 then
  13.   robot.setPos(tonumber(tA[1]), tonumber(tA[2]), tonumber(tA[3]), tA[4])
  14.   printPos()
  15. else
  16.   print('Usage: pos <x> <y> <z> <side>')
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement