Advertisement
poboivin

Quarry

Oct 3rd, 2012
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. tArgs = { ...}
  2. size=tonumber(tArgs[1])
  3. height=tonumber(tArgs[2])
  4. UpDown=tonumber(tArgs[3])
  5.     if size == nil then
  6.         size = 10
  7.     end
  8.     if height == nil then
  9.         height = 10
  10.     end
  11.     if UpDown == nil then
  12.         UpDown = 0
  13.     end
  14.    
  15.     directionVal2 = 0
  16.     directionVal = 0
  17.     qx1,qy1,qz1 = gps.locate(1,false)
  18.     cx,cy,cz =  gps.locate(1,false)
  19.     qx2 = qx1 + size -1
  20.     qz2 = qz1 + size -1
  21.     lenght = (math.abs(qx1-qx2))
  22.     shell.run('Df',1)
  23.     for i = 1 , height do
  24.     for i = 1, lenght do
  25.     shell.run('Df',lenght)
  26.    
  27.    
  28.         directionVal = directionVal2
  29.         if directionVal == 0 then
  30.             shell.run('TurnRight',(1))
  31.             shell.run('Df',(1))
  32.             shell.run('TurnRight',(1))
  33.             directionVal2 = 1
  34.         else
  35.             shell.run('TurnLeft',(1))
  36.             shell.run('Df',(1))
  37.             shell.run('TurnLeft',(1))
  38.             directionVal2 = 0
  39.         end
  40.        
  41.     end
  42.     shell.run('Df',lenght)
  43.     shell.run('TurnRight',(1))
  44.     shell.run('TurnRight',(1))
  45.     if UpDown == 0 then
  46.         shell.run('Dd',1)
  47.     elseif UpDown == 1 then
  48.         shell.run('Du',1)
  49.     end
  50.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement