Advertisement
Doob

pos

Sep 18th, 2015
194
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement