Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p = peripheral.wrap("back")
- monitor = peripheral.wrap("monitor_1")
- monitor.setTextScale(0.5)
- monitor.clear()
- monitor.setCursorPos(1,1)
- s = peripheral.wrap("speaker_0")
- c = 0
- t = 0
- hads = 1
- eject = 0
- components = 1
- importantComponents = 1
- modem = peripheral.wrap("bottom")
- tardisTabletId = 5
- tardisHomex = -150
- tardisHomey = 72
- tardisHomez = 245
- tardisHomeDimensionID = 0
- fuelingstate = false
- function tardis()
- if p.isInFlight() then
- redstone.setOutput("left",false)
- redstone.setOutput("right",true)
- if p.isDoorsOpened() == true then
- if eject == 0 then
- p.setDoors(false)
- else
- p.setDoors(true)
- end
- end
- monitor.setCursorPos(1,1)
- monitor.write("Tardis Status : In Flight")
- monitor.setCursorPos(1,1)
- monitor.setCursorPos(1,2)
- monitor.write("Tardis fuel : ".. p.getArtron())
- monitor.setCursorPos(18,2)
- monitor.write("/256 ")
- else
- redstone.setOutput("left",true)
- redstone.setOutput("right",false)
- monitor.setCursorPos(1,1)
- monitor.write("Tardis Status : Landed ")
- monitor.setCursorPos(1,1)
- if p.getArtron() == 256 then
- if fuelingstate == true then
- p.setFueling(false)
- fuelingstate = false
- end
- monitor.setCursorPos(1,2)
- monitor.write("Tardis fuel : 256/256 ")
- monitor.setCursorPos(1,2)
- else
- if fuelingstate == false then
- p.setFueling(true)
- fuelingstate = true
- end
- monitor.setCursorPos(1,2)
- monitor.write("Tardis is now fueling "..p.getArtron())
- monitor.setCursorPos(26,2)
- monitor.write("/256 ")
- end
- end
- if p.getHealthComponent(0) < 0.40 then
- monitor.setCursorPos(1,8)
- monitor.write("Components Damaged ! " .. p.getSystemName(0))
- components = 0
- elseif p.getHealthComponent(1) < 0.40 then
- monitor.setCursorPos(1,8)
- monitor.write("Components Damaged ! " .. p.getSystemName(1))
- components = 0
- elseif p.getHealthComponent(2) < 0.40 then
- monitor.setCursorPos(1,8)
- monitor.write("Components Damaged ! " .. p.getSystemName(2))
- components = 0
- elseif p.getHealthComponent(3) < 0.40 then
- monitor.setCursorPos(1,8)
- monitor.write("Components Damaged ! " .. p.getSystemName(3))
- components = 0
- elseif p.getHealthComponent(4) < 0.40 then
- monitor.setCursorPos(1,8)
- monitor.write("Components Damaged ! " .. p.getSystemName(4))
- components = 0
- elseif p.getHealthComponent(5) < 0.40 then
- monitor.setCursorPos(1,8)
- monitor.write("Components Damaged ! " .. p.getSystemName(5))
- components = 0
- elseif p.getHealthComponent(6) < 0.40 then
- monitor.setCursorPos(1,8)
- monitor.write("Components Damaged ! " .. p.getSystemName(6))
- components = 0
- elseif p.getHealthComponent(7) < 0.40 then
- monitor.setCursorPos(1,8)
- monitor.write("Components Damaged ! " .. p.getSystemName(7))
- components = 0
- elseif p.getHealthComponent(8) < 0.40 then
- monitor.setCursorPos(1,8)
- monitor.write("Components Damaged ! " .. p.getSystemName(8))
- components = 0
- else
- monitor.setCursorPos(1,8)
- monitor.write(" ")
- components = 1
- importantComponents = 1
- end
- if components == 0 then
- s.playNote("Bell", 2, 0.5)
- sleep(1)
- end
- if p.getDimension() ~= 0 then
- t = t + 1
- else
- t = 0
- end
- if hads == 1 then
- if t > 3000 then
- if p.isInFlight() == false then
- if p.getArtron() == 256 then
- monitor.setCursorPos(1,5)
- monitor.write("This is security protocol 712")
- monitor.setCursorPos(1,6)
- monitor.write("The echelon circuit has been activated")
- monitor.setCursorPos(1,7)
- monitor.write("Please stow any hand luggage and prepare for departure")
- p.setDoors(false)
- p.setTardisDestination(tardisHomex,tardisHomey,tardisHomez,tardisHomeDimensionID)
- p.startFlight()
- sleep(20)
- t = 0
- monitor.clear()
- end
- end
- end
- end
- monitor.setCursorPos(1,3)
- x,y,z = p.getTardisPos()
- monitor.write("Tardis location : "..x.." "..y.." "..z.." ")
- monitor.setCursorPos(1,4)
- monitor.write("Travel time : "..p.getTravelTime().." ")
- modem.open(2)
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- if message == "open" then
- p.setDoors(true)
- modem.transmit(3, 1, "Doors opened")
- elseif message == "close" then
- p.setDoors(false)
- modem.transmit(3, 1, "Doors closed")
- elseif message == "hads off" then
- hads = 0
- modem.transmit(3, 1, "HADS off")
- elseif message == "hads on" then
- hads = 1
- modem.transmit(3, 1, "HADS on")
- elseif message == "home" then
- if importantComponents == 1 then
- if p.isInFlight() == false then
- if p.getArtron() == 256 then
- modem.transmit(3, 1, "Takeoff !")
- p.setDoors(false)
- p.setTardisDestination(tardisHomex,tardisHomey,tardisHomez,tardisHomeDimensionID)
- p.startFlight()
- else
- modem.transmit(3, 1, "The tardis doesn't have enough fuel")
- end
- else
- modem.transmit(3, 1, "The tardis is already in flight !")
- end
- else
- modem.transmit(3, 1, "Components health too low")
- end
- elseif message == "nether" then
- if importantComponents == 1 then
- if p.isInFlight() == false then
- if p.getArtron() == 256 then
- modem.transmit(3, 1, "Takeoff !")
- p.setDoors(false)
- p.setTardisDestination(-196,82,192,-1)
- p.startFlight()
- else
- modem.transmit(3, 1, "The tardis doesn't have enough fuel")
- end
- else
- modem.transmit(3, 1, "The tardis is already in flight !")
- end
- else
- modem.transmit(3, 1, "Components health too low")
- end
- elseif message == "ender" then
- if importantComponents == 1 then
- if p.isInFlight() == false then
- if p.getArtron() == 256 then
- modem.transmit(3, 1, "Takeoff !")
- p.setDoors(false)
- p.setTardisDestination(-22,59,-10,1)
- p.startFlight()
- else
- modem.transmit(3, 1, "The tardis doesn't have enough fuel")
- end
- else
- modem.transmit(3, 1, "The tardis is already in flight !")
- end
- else
- modem.transmit(3, 1, "Components health too low")
- end
- elseif message == "base2" then
- if importantComponents == 1 then
- if p.isInFlight() == false then
- if p.getArtron() == 256 then
- modem.transmit(3, 1, "Takeoff !")
- p.setDoors(false)
- p.setTardisDestination(-910,59,233,0)
- p.startFlight()
- else
- modem.transmit(3, 1, "The tardis doesn't have enough fuel")
- end
- else
- modem.transmit(3, 1, "The tardis is already in flight !")
- end
- else
- modem.transmit(3, 1, "Components health too low")
- end
- elseif message == "farm" then
- if importantComponents == 1 then
- if p.isInFlight() == false then
- if p.getArtron() == 256 then
- modem.transmit(3, 1, "Takeoff !")
- p.setDoors(false)
- p.setTardisDestination(-549,76,224,0)
- p.startFlight()
- else
- modem.transmit(3, 1, "The tardis doesn't have enough fuel")
- end
- else
- modem.transmit(3, 1, "The tardis is already in flight !")
- end
- else
- modem.transmit(3, 1, "Components health too low")
- end
- elseif message == "eject" then
- if importantComponents == 1 then
- if p.isInFlight() == false then
- if p.getArtron() == 256 then
- p.setDoors(true)
- modem.transmit(3, 1, "Takeoff !")
- p.setDoors(true)
- p.setTardisDestination(tardisHomex,tardisHomey,tardisHomez,tardisHomeDimensionID)
- eject = 1
- p.startFlight()
- sleep(12)
- eject = 0
- p.setDoors(false)
- else
- modem.transmit(3, 1, "The tardis doesn't have enough fuel")
- end
- else
- modem.transmit(3, 1, "The tardis is already in flight !")
- end
- else
- modem.transmit(3, 1, "Components health too low")
- end
- end
- end
- while true do
- tardis()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement