Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tArgs = { ...}
- size=tonumber(tArgs[1])
- height=tonumber(tArgs[2])
- UpDown=tonumber(tArgs[3])
- if size == nil then
- size = 10
- end
- if height == nil then
- height = 10
- end
- if UpDown == nil then
- UpDown = 0
- end
- directionVal2 = 0
- directionVal = 0
- qx1,qy1,qz1 = gps.locate(1,false)
- cx,cy,cz = gps.locate(1,false)
- qx2 = qx1 + size -1
- qz2 = qz1 + size -1
- lenght = (math.abs(qx1-qx2))
- shell.run('Df',1)
- for i = 1 , height do
- for i = 1, lenght do
- shell.run('Df',lenght)
- directionVal = directionVal2
- if directionVal == 0 then
- shell.run('TurnRight',(1))
- shell.run('Df',(1))
- shell.run('TurnRight',(1))
- directionVal2 = 1
- else
- shell.run('TurnLeft',(1))
- shell.run('Df',(1))
- shell.run('TurnLeft',(1))
- directionVal2 = 0
- end
- end
- shell.run('Df',lenght)
- shell.run('TurnRight',(1))
- shell.run('TurnRight',(1))
- if UpDown == 0 then
- shell.run('Dd',1)
- elseif UpDown == 1 then
- shell.run('Du',1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement