Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Update File --
- --[[
- If you are reading this, Know that you are smart...
- ]]
- local version = "v1_0"
- function req_update()
- shell.run("clear")
- term.setTextColor(colors["lightGray"])
- local sx,sy = term.getSize()
- for i=1, sx do
- write("=")
- end
- term.setCursorPos(1,sy-1)
- for i=1, sx do
- write("=")
- end
- term.setCursorPos(1,1)
- for i=1, sy-1 do
- print("#")
- end
- for i=1, sy-2 do
- term.setCursorPos(sx,i)
- write("#")
- end
- term.setCursorPos(2,2)
- write("Update to "..version.."?")
- local selected = 1
- local menu = {"Yes, Update!", "No, Continue."}
- repeat
- for i=1, #menu do
- term.setCursorPos(2,i+3)
- if i == selected then
- term.setTextColor(colors["white"])
- print("> "..menu[i])
- else
- term.setTextColor(colors["gray"])
- print(" "..menu[i])
- end
- end
- a,i = os.pullEvent("key")
- if i == keys.w or i == keys.up then
- if selected ~= 1 then selected = 1 end
- elseif i == keys.s or i == keys.down then
- if selected ~= 2 then selected = 2 end
- end
- until i == keys.enter or i == keys.e
- end
- if not fs.exists(version) then
- req_update()
- end
Advertisement
Add Comment
Please, Sign In to add comment