Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- settings.load(".settings")
- local AvUpdates = {"2.0.0"}
- local LatestVersion = "2.0.0"
- local ClientV = settings.get("ClientVersion")
- local Paster = settings.get("osPaster")
- local function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function CUI(m) --declare function
- n=1
- local l = #m
- while true do
- term.setCursorPos(1,5)
- for i=1, #m, 1 do --traverse the table of options
- if i==n then term.clearLine() print(i, ">",m[i]) else term.clearLine() print(i, "-", m[i]) end --print them
- end
- a, b= os.pullEvent("key") --wait for keypress
- if b==keys.w and n>1 then n=n-1 end
- if b==keys.s and n<l then n=n+1 end
- if b==keys.enter then break end
- end
- return n --return the value
- end
- function UpdateMenu()
- Clear()
- print("Client Version = ",ClientV)
- local options = AvUpdates
- local n = CUI(options)
- local file = fs.open("os/System/Files/UpdateConfig","w")
- file.writeLine(options[n])
- file.close()
- shell.run(Paster,"run","esrL34E1")
- end
- UpdateMenu()
Add Comment
Please, Sign In to add comment