Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --=========================================================================================================
- --DoNot remove this Credits
- --Created On 19th MARCH 2014
- --by Angel_Code http://www.computercraft.info/forums2/index.php?/user/18955-angel-code/
- --Support Provided By theoriginalbit http://computercraft.theoriginalbit.com/
- --Support Provided By Bomb Bloke http://www.computercraft.info/forums2/index.php?/user/15121-bomb-bloke/
- --=========================================================================================================
- Mon = peripheral.wrap("top") --Change "top" to the side the monitor is on.
- local function centerText(text)
- x,y = Mon.getSize()
- x1,y1 = Mon.getCursorPos()
- Mon.setCursorPos((math.floor(x/2) - (math.floor(#text/2))), y1)
- Mon.write(text)
- end
- local function defence()
- Mon.clear()
- Mon.setCursorPos(1, 1)
- centerText("=========================================")
- Mon.setCursorPos(1, 2)
- centerText("WARNING!")
- Mon.setCursorPos(1, 3)
- centerText("INCOMING MISSILE")
- Mon.setCursorPos(1, 4)
- centerText("ACTIVATING FORCEFIELD")
- redstone.setOutput("right", true) --Change "right" to the OUTPUT side.
- Mon.setCursorPos(1, 6)
- centerText("=========================================")
- local count = 60 -- Change 60 to the amout of time in seconds a redstone signal should be turned on for.
- while true do
- Mon.setCursorPos(1, 5)
- centerText("Field Active For " ..count.. " Seconds")
- sleep(0.5)
- count = count - 1
- if count < 0 then
- redstone.setOutput("right", false) --Change "right" to the OUTPUT side.
- Mon.clear()
- check()
- end
- end
- end
- function check()
- while true do
- if redstone.getInput("left") then defence() end -- Change "left" to the INPUT side.
- os.pullEvent("redstone")
- end
- end
- check()
Advertisement
Add Comment
Please, Sign In to add comment