Guest User

Untitled

a guest
Dec 14th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. tArgs = { ...}
  2. size=tonumber(tArgs[1])
  3. height=tonumber(tArgs[2])
  4.  
  5. qx1,qy1,qz1 = gps.locate(1,false)
  6.     cx,cy,cz =  gps.locate(1,false)
  7.     if size == nil then
  8.  print ('size = nil')
  9.         size = 10
  10.     end
  11.     if height == nil then
  12.         height = 10
  13.     end
  14.    
  15.     qx2 = qx1 + size
  16.     qz2 = qz1 + size
  17.    
  18.     for i = 1 , height do
  19.         for i = 0 , (size/2) - 1 do
  20.             shell.run('Df',(math.abs(cx-qx2)))
  21.             shell.run('TurnRight',(1))
  22.             shell.run('Df',(1))
  23.             shell.run('TurnRight',(1))
  24.             shell.run('Df',(math.abs(cx-qx2)))
  25.             shell.run('TurnLeft',(1))
  26.             shell.run('Df',(1))
  27.             shell.run('TurnLeft',(1))
  28.    
  29.        
  30.         shell.run('Df',(math.abs(cx-qx2 )))
  31.         shell.run('TurnRight',(1))
  32.         shell.run('Df',(1))
  33.  
  34.    
  35.     shell.run('TurnRight',(1))
  36.         shell.run('Df',(math.abs(cx-qx2 )))
  37.         shell.run('TurnLeft',(1))
  38.         shell.run('Dd',(1))
  39.         shell.run('TurnLeft',(1))
  40.   end      
  41. --      for i = 0 , (size/2) - 1 do
  42.         -- shell.run('Df',(math.abs(cx-qx2 )))
  43.     --shell.run('TurnLeft',1)
  44. --          shell.run('Df',(1))
  45. --          shell.run('TurnLeft',(1))
  46. --          shell.run('Df',(math.abs(cx-qx2)))
  47. --          shell.run('TurnRight',(1))
  48. --          shell.run('Df',(1))
  49. --          shell.run('TurnRight',(1))
  50.        
  51.        
  52. --      shell.run('Df',(math.abs(cx-qx2 )))
  53. --      shell.run('TurnLeft',(1))
  54.         --shell.run('Df',(1))
  55. --      shell.run('TurnLeft',(1))
  56. --      shell.run('Df',(math.abs(cx-qx2)))
  57. --      shell.run('TurnRight',(1))
  58. --      shell.run('Dd',(1))
  59. --      shell.run('TurnRight',(1))
  60. --   end
  61. end
Add Comment
Please, Sign In to add comment