Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clearAll()
- local function usernameS()
- tinyClear()
- tinyPrint("What is your new desired",1,glcolors.otherBlue)
- tinyPrint("username?",2,glcolors.otherBlue)
- local evt, cmd = os.pullEvent("chat_command")
- tinyClear()
- newusername = fs.open("username", "w")
- newusername.writeLine(cmd)
- newusername.close()
- username = cmd
- tinyPrint("Alright, "..cmd..",",1,glcolors.otherBlue)
- tinyPrint("Settings will take affect",2,glcolors.otherBlue)
- tinyPrint("immediately.",3,glcolors.otherBlue)
- sleep(2)
- end
- local function trans()
- tinyClear()
- tinyPrint("How transparent do you want",1,glcolors.otherBlue)
- tinyPrint("glass? (default level is 0.75)",2,glcolors.otherBlue)
- local evt, cmd = os.pullEvent("chat_command")
- --we don't need it to be a number, but it's like
- --a safety feature
- cmd = tonumber(cmd)
- if cmd == nil then
- tinyClear()
- tinyPrint("You need to enter a number.",1,glcolors.otherBlue)
- sleep(2)
- else
- tr = fs.open("glasstrans", "w")
- tr.write(cmd)
- tr.close()
- tinyClear()
- tinyPrint("You'll need to reboot glass",1,glcolors.otherBlue)
- tinyPrint("for this to work.",2,glcolors.otherBlue)
- sleep(2)
- end
- end
- function updGlass()
- shell.run('pastebin get yJgWrGpY installeralpha')
- tinyClear()
- tinyPrint("Will quit glass aswell.",1,glcolors.otherBlue)
- sleep(1)
- autoUpdate = true
- shell.run("installeralpha")
- goodShutdown = true
- on = false
- end
- function update()
- tinyClear()
- tinyPrint("Getting the current",1,glcolors.otherBlue)
- tinyPrint("version from pastebin...",2,glcolors.otherBlue)
- if fs.exists("vertemp") == true then fs.delete("vertemp") end
- shell.run("pastebin get n2x4xWXn vertemp")
- f = fs.open("vertemp", "r")
- curVer = f.readLine()
- curVer = tonumber(curVer)
- f.close()
- tinyClear()
- if glassVer < curVer then
- tinyPrint("Glass is not up to date!",1,glcolors.otherBlue)
- tinyPrint("Would you like to update?",2,glcolors.otherBlue)
- tinyPrint("(y/n)",3,glcolors.otherBlue)
- local evt, cmd = os.pullEvent("chat_command")
- cmd = string.lower(cmd)
- if cmd == "y" or cmd == "yes" then
- updGlass()
- end
- elseif glassVer > curVer then
- tinyPrint("You're running a dev version",1,glcolors.otherBlue)
- tinyPrint("?!?!?!?!?!",2,glcolors.otherBlue)
- sleep(5)
- else
- tinyPrint("Glass is up to date",1,glcolors.otherBlue)
- sleep(5)
- end
- end
- local function theme()
- clearAll()
- tinyCPrint("Themes:",1,glcolors.red)
- tinyPrint("default, inverted, ",2,glcolors.otherBlue)
- tinyPrint("night,swapped,",3,glcolors.otherBlue)
- tinyPrint("greenEdit, purpleEdit",4,glcolors.otherBlue)
- local evt, cmd = os.pullEvent("chat_command")
- cmd = cmd:lower()
- if cmd == "inverted" then
- bigBoxColor = glcolors.black
- sideColors = glcolors.darkBlue
- elseif cmd == "default" then
- bigBoxColor = glcolors.gray sideColors = glcolors.blue
- elseif cmd == "night" then
- bigBoxColor = glcolors.darkBlue
- sideColors = glcolors.black
- elseif cmd == "swapped" then
- bigBoxColor = glcolors.blue
- sideColors = glcolors.gray
- elseif cmd == "greenedit" then
- bigBoxColor = glcolors.gray
- sideColors = glcolors.green
- elseif cmd == "purpleedit" then
- bigBoxColor = glcolors.gray
- sideColors = glcolors.purple
- end
- change = fs.open("glassTheme","w")
- change.writeLine("bigBoxColor = "..bigBoxColor.." sideColors = "..sideColors.." ")
- change.close()
- end
- local function main()
- while true do
- tinyClear()
- tinyCPrint("Avalible Options:",1,glcolors.red)
- tinyPrint("username, update,",2,glcolors.otherBlue)
- tinyPrint("transparency, theme, exit",3,glcolors.otherBlue)
- local evt, cmd = os.pullEvent("chat_command")
- cmd = string.lower(cmd)
- if cmd == "username" then
- usernameS()
- elseif cmd == "update" then
- update()
- elseif cmd == "transparency" then
- trans()
- elseif cmd == "theme" then
- theme()
- elseif cmd == "exit" then
- error()
- end
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment