Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This program creates a square of 9 3x3 block satellites for use as GPS trackers.
- local v = 1
- local y = 0
- local x = 0
- local s = 0
- -- v/x are timers, y is the turtle's Y coordinate. s is the spread of the satellites.
- -- Functions, placesat places a 3x3 square starting with the middle, then a console. landing lands the turtle at the end.
- function placesat()
- turtle.down()
- turtle.placeDown()
- turtle.forward()
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.placeDown()
- turtle.forward()
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.placeDown()
- turtle.forward()
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.placeDown()
- turtle.forward()
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.back()
- turtle.up()
- turtle.select(9)
- turtle.placeDown()
- turtle.select(1)
- if turtle.getItemCount(1) == 0 then
- turtle.select(2)
- else
- end
- x = 1
- end
- function landing()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.down()
- turtle.down()
- turtle.down()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- repeat
- turtle.down()
- v = v - 1
- until v < 2
- end
- print ("Enter your turtle's current elevation [Y].")
- y = tonumber (read())
- print ("Place materials in slots 1-2, computers in slot 9. Enter the desired spread and press enter to begin.")
- s = tonumber (read())
- print ("Spread of ..s.. selected. Beginning ascent.")
- -- This is the beginning ascent.
- repeat
- turtle.up()
- v = v + 1
- until v > (129 - y)
- -- The extra 1 block of ascent is to account for the 1 block drop at the start of placesat
- placesat()
- repeat
- turtle.forward()
- x = x + 1
- until x > s
- -- Second platform
- placesat()
- turtle.turnLeft()
- repeat
- turtle.forward()
- x = x + 1
- until x > s
- turtle.turnRight()
- -- Third platform
- placesat()
- turtle.turnLeft()
- turtle.turnLeft()
- repeat
- turtle.forward()
- x = x + 1
- until x > s
- turtle.turnRight()
- turtle.turnRight()
- -- Forth platform
- placesat()
- turtle.turnLeft()
- turtle.turnLeft()
- repeat
- turtle.forward()
- x = x + 1
- until x > s
- turtle.turnRight()
- turtle.turnRight()
- -- Fifth platform
- placesat()
- turtle.turnRight()
- repeat
- turtle.forward()
- x = x + 1
- until x > s
- turtle.turnLeft()
- -- Sixth platform
- placesat()
- turtle.turnRight()
- repeat
- turtle.forward()
- x = x + 1
- until x > s
- turtle.turnLeft()
- -- Seventh platform
- placesat()
- repeat
- turtle.forward()
- x = x + 1
- until x > s
- -- Eighth platform
- placesat()
- repeat
- turtle.forward()
- x = x + 1
- until x > s
- -- Final platform
- placesat()
- turtle.turnLeft()
- repeat
- turtle.forward()
- x = x + 1
- until x > s
- x = 0
- turtle.turnLeft()
- turtle.up()
- repeat
- turtle.forward()
- x = x + 1
- until x > s
- x = 0
- turtle.turnRight()
- turtle.turnRight()
- landing()
Add Comment
Please, Sign In to add comment