Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pullEvent = os.pullEvent
- os.pullEvent = os.pullEventRaw
- local function centerText(text)
- local x,y = term.getSize()
- local x2,y2 = term.getCursorPos()
- term.setTextColor(colors.red)
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- write(text)
- end
- hello=true
- while hello==true do
- term.clear()
- centerText("Press Enter for emergency:")
- input = read()
- if input == "terminate" then
- os.pullEvent = pullEvent
- hello=false
- term.clear()
- term.setCursorPos(1, 1)
- elseif input == "" then
- redstone.setOutput("bottom", true)
- sleep(0.1)
- redstone.setOutput("bottom", false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment