Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- rs.setOutput("bottom", true)
- while true do
- local Id, msg, distance = rednet.receive()
- if msg == "service" then
- while y ~= 89 do
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 89 then
- os.reboot()
- end
- if y > 89 then
- rs.setOutput("left", true)
- os.sleep(0.1)
- rs.setOutput("left", false)
- os.sleep(0.1)
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 89 then
- os.reboot()
- end
- if y < 89 then
- rs.setOutput("right", true)
- os.sleep(0.1)
- rs.setOutput("right", false)
- os.sleep(0.1)
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 89 then
- os.reboot()
- end
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 89 then
- os.reboot()
- end
- end
- if msg == "BL 1" then
- while y ~= 99 do
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 99 then
- os.reboot()
- end
- if y > 99 then
- rs.setOutput("left", true)
- os.sleep(0.1)
- rs.setOutput("left", false)
- os.sleep(0.1)
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 99 then
- os.reboot()
- end
- if y < 99 then
- rs.setOutput("right", true)
- os.sleep(0.1)
- rs.setOutput("right", false)
- os.sleep(0.1)
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 99 then
- os.reboot()
- end
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 99 then
- os.reboot()
- end
- end
- if msg == "floor 1" then
- while y ~= 107 do
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 107 then
- os.reboot()
- end
- if y > 107 then
- rs.setOutput("left", true)
- os.sleep(0.1)
- rs.setOutput("left", false)
- os.sleep(0.1)
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 107 then
- os.reboot()
- end
- if y < 107 then
- rs.setOutput("right", true)
- os.sleep(0.1)
- rs.setOutput("right", false)
- os.sleep(0.1)
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 107 then
- os.reboot()
- end
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 107 then
- os.reboot()
- end
- end
- if msg == "mage tower" then
- while y ~= 111 do
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 111 then
- os.reboot()
- end
- if y > 111 then
- rs.setOutput("left", true)
- os.sleep(0.1)
- rs.setOutput("left", false)
- os.sleep(0.1)
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 111 then
- os.reboot()
- end
- if y < 111 then
- rs.setOutput("right", true)
- os.sleep(0.1)
- rs.setOutput("right", false)
- os.sleep(0.1)
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 111 then
- os.reboot()
- end
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 111 then
- os.reboot()
- end
- end
- if msg == "storage 1" then
- while y ~= 114 do
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 114 then
- os.reboot()
- end
- if y > 114 then
- rs.setOutput("left", true)
- os.sleep(0.1)
- rs.setOutput("left", false)
- os.sleep(0.1)
- end
- local x, y, z = gps.locate(.2)
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 114 then
- os.reboot()
- end
- if y < 114 then
- rs.setOutput("right", true)
- os.sleep(0.1)
- rs.setOutput("right", false)
- os.sleep(0.1)
- end
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 114 then
- os.reboot()
- end
- end
- while y == nill do
- local x, y, z = gps.locate(.2)
- end
- if y == 114 then
- os.reboot()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement