Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Centering Text
- local function center(text)
- local x,y = term.getSize()
- local x2,y2 = term.getCursorPos()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- write(text)
- end
- local arg = { ... }
- if arg[1] == "-s" then
- --Shutdown
- term.setBackgroundColor(colors.lightBlue)
- term.clear()
- center("Kapaniyor")
- sleep(1)
- os.shutdown()
- elseif arg[1] == "-r" then
- --Reboot
- term.setBackgroundColor(colors.lightBlue)
- term.clear()
- center("Yeniden baslatiliyor")
- sleep(1)
- os.reboot()
- elseif arg[1] == "-h" then
- --Help
- print("goodbye -s KAPAT")
- print("goodbye -r YENIDEN BASLAT")
- else
- --No args
- error("\"goodbye -h\" yazip parametreleri goruntuleyin")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement