Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("/API/tde-msg")
- os.loadAPI("advPrint")
- powermenu = "no"
- function aloadImage()
- end
- --[[ THIS IS SPARTAA!
- local function wallpaper()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- term.setCursorPos(1, 1)
- --wallpaper = paintutils.loadImage("tde-wallpaper")
- paintutils.drawImage(wallpaper, 3, 2)
- end
- Don't enable this option, this very bug function!
- ]]
- local function restore()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- end
- local function menu()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.setCursorPos(1, 1)
- write("[S] ")
- term.setCursorPos(5, 1)
- --term.setBackgroundColor(colors.black)
- --term.setTextColor(colors.white)
- write("[Menu]")
- term.setTextColor(colors.white)
- term.setCursorPos(43, 18)
- xx, yy = term.getSize()
- term.setCursorPos(xx-2, 1)
- term.setBackgroundColor(colors.blue)
- write("[P]")
- term.setCursorPos(xx-5, 1)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- write("===")
- term.setBackgroundColor(colors.white)
- end
- aloadImage()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- term.setCursorPos(1, 1)
- wallpaper = paintutils.loadImage("tde-wallpaper")
- paintutils.drawImage(wallpaper, 3, 2)
- while true do
- paintutils.drawImage(wallpaper, 3, 2)
- menu()
- x1, y1, x2, y2 = 1, 18, 6, 18
- local event, button, X, Y = os.pullEventRaw()
- if event == "mouse_click" then
- if X >= xx-3 and X <= xx and Y == 3 and powermenu == "yes" then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- advPrint.tout(1, "* * * TDE-DESKTOP * * *")
- print(" Thank's for using!")
- break
- elseif X >= xx-2 and X <= xx and Y == 1 and powermenu ~= "yes" then
- powermenu = "yes"
- if powermenu == "yes" then
- term.setCursorPos(xx-6, 2)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- os.sleep(0.01)
- write(" lock ")
- os.sleep(0.01)
- term.setCursorPos(xx-6, 3)
- write(" exit ")
- end
- elseif X >= xx-3 and X <= xx and Y == 2 and powermenu == "yes" then
- shell.run("tde-lock")
- restore()
- powermenu = "no"
- elseif X >= 1 and Y >= 1 and X<= 3 and Y <= 1 then
- term.setCursorPos(1, 1)
- term.setBackgroundColor(colors.white)
- shell.run("tde-settings")
- restore()
- elseif X>=5 and Y>= 1 and X<= 10 and Y<= 1 then
- shell.run("tde-menu")
- restore()
- elseif X >= xx-5 and X <= xx-3 and Y == 1 and messagemenu ~= "yes" then
- i = 0
- while i <= 15 do
- term.setCursorPos(xx-i, 2)
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.yellow)
- write(" ")
- i = i + 1
- end
- messagemenu = "yes"
- i = 3
- while i <= 7 do
- term.setCursorPos(xx-15, i)
- write(" ")
- i = i + 1
- end
- term.setCursorPos(xx-15, 2)
- shell.run("check.tde")
- if fs.exists(".tde.msg1") then
- file = fs.open(".tde.msg1", "r")
- text = file.readLine()
- if string.len(text) > 16 then
- text = string.sub(text, 1, 16)
- end
- file.close()
- term.setCursorPos(xx-15, 4)
- write(text)
- shell.run("rm .tde.msg1")
- end
- --
- if fs.exists(".tde.msg2") then
- file = fs.open(".tde.msg2", "r")
- text = file.readLine()
- if string.len(text) > 16 then
- text = string.sub(text, 1, 16)
- end
- file.close()
- term.setCursorPos(xx-15, 6)
- write(text)
- shell.run("rm .tde.msg2")
- end
- --
- while true do
- local event, button, X, Y = os.pullEventRaw()
- if event == "mouse_click" then
- if X >= xx-15 and X <= xx-3 and Y == 2 and fs.exists(".update") then
- file = fs.open(".update", 'r')
- update = file.readLine()
- file.close()
- local function check()
- shell.run("rm .update")
- end
- local function WaitForAny1()
- while true do
- local event, button, X, Y = os.pullEventRaw()
- if event == "mouse_click" then
- break
- end
- end
- end
- parallel.waitForAny(check, WaitForAny1)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.yellow)
- term.setCursorPos(1, 1)
- term.clear()
- print("tde-desktop 3.4 updating...")
- os.sleep(1)
- term.setTextColor(colors.white)
- shell.run("pastebin run "..update)
- else
- restore()
- messagemenu = "no"
- break
- end
- end
- end
- else
- if powermenu == "yes" then
- powermenu = "no"
- restore()
- end
- end
- end
- end
- os.unloadAPI("/API/tde-msg")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement