Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- local function WINDOW(X,Y,EX,EY,T,C,EMPTY,H)
- local WIND = window.create(term.current(),X,Y,(EX),(EY))
- WIND.setBackgroundColor(C)
- if EMPTY == true then
- WIND.clear()
- end
- WIND.setCursorPos(1,1)
- WIND.write(H)
- for i=1,#T do
- WIND.setCursorPos(1,i+1)
- WIND.write(T[i])
- end
- end
- term.setBackgroundColor(colors.gray)
- term.clear()
- if fs.exists("./MAIN/") == false then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.red)
- term.clear()
- term.setCursorPos(1,1)
- print("MAIN DIR NOT FOUND")
- print("[C]reate or [E]xit")
- if string.upper(read()) == "C" then
- shell.run("mkdir ./MAIN")
- end
- end
- DIR = "./MAIN"
- DIRN = "C"
- while true do
- if fs.exists("img/bg.nfp") then
- paintutils.drawImage(paintutils.loadImage("img/bg.nfp"),2,1)
- end
- sleep(0)
- C = colors.lightGray
- W,H = term.getSize()
- T = fs.list(DIR)
- WINDOW((W/2)-11,4,(W/2),10,T,C,true,"")
- term.setCursorPos((W/2)-11,4)
- term.setBackgroundColor(colors.lightGray)
- print("= |A| |B| |C| S")
- term.setCursorPos(2,H-1)
- term.setBackgroundColor(colors.black)
- term.clearLine()
- print("S")
- term.setCursorPos(W-24,H-1)
- print(os.date())
- term.setCursorPos(1,1)
- while true do
- E,KEY,MX,MY = os.pullEventRaw()
- if E == "mouse_click" then
- break
- end
- end
- term.setBackgroundColor(colors.black)
- print(MX,MY)
- if MY == 4 and MX == 14 then
- T = {"X"}
- WINDOW(MX,MY,(MX),(MY+1),T,colors.gray,true,"")
- E,KEY,MX,MY = os.pullEventRaw("mouse_click")
- if MX == 14 and MY == 5 then
- term.setCursorPos(14,4)
- T = term.getTextColour()
- term.setTextColor(colors.orange)
- print("YOU ARE ABOUT END THIS AIOS SESSION")
- term.setTextColour(colors.yellow)
- term.setCursorPos(14,5)
- print("Y to exit")
- term.setCursorPos(14,6)
- print("N to stay")
- if string.upper(read()) == "Y" then
- break
- end
- end
- elseif MY == 17 and MX == 2 then
- T = {"ATOP","SETTINGS"}
- WINDOW(1,12,10,20,T,colors.blue,true,"START")
- E,KEY,MX,MY = os.pullEvent("mouse_click")
- term.setCursorPos(1,1)
- --print(MX,MY)
- if MY == 13 then
- term.setCursorPos(10,2)
- paintutils.drawFilledBox(10,2,40,20)
- for i=1,multishell.getCount() do
- term.setCursorPos(10,2+i)
- print(multishell.getTitle(i))
- end
- sleep(2)
- elseif MY == 14 then
- term.setTextColor(colors.lightBlue)
- T = {"NO SETTINGS"}
- WINDOW(10,10,20,20,T,colors.white,true,"SETTINGS")
- end
- sleep(1)
- elseif MY == 4 and MX == 38 then
- shell.run("fg")
- elseif MY == 4 and MX == 26 then
- if fs.exists("disk2/") then
- DIR = "disk2/"
- DIRN = "B"
- else
- T = {"DIR NOT FOUND"}
- WINDOW((W/2)-11,4,(W/3),4,T,colors.red,true,"ERROR")
- end
- elseif MY == 4 and MX == 19 then
- if fs.exists("disk/") then
- DIR = "disk/"
- DIRN = "A"
- else
- T = {"DIR NOT FOUND"}
- WINDOW((W/2)-11,4,(W/3),4,T,colors.red,true,"ERROR")
- end
- elseif MY == 4 and MX == 33 then
- DIR = "./MAIN"
- DIRN = "C"
- elseif MY == 5 then
- shell.run("fg",fs.list(DIR)[1])
- elseif MY == 6 then
- shell.run("fg",fs.list(DIR)[2])
- elseif MY == 7 then
- shell.run("fg",fs.list(DIR)[3])
- elseif MY == 8 then
- shell.run("fg",fs.list(DIR)[4])
- elseif MY == 9 then
- shell.run("fg",fs.list(DIR)[5])
- elseif MY == 10 then
- shell.run("fg",fs.list(DIR)[6])
- elseif MY == 11 then
- shell.run("fg",fs.list(DIR)[7])
- elseif MY == 12 then
- shell.run("fg",fs.list(DIR)[8])
- elseif MY == 13 then
- shell.run("fg",fs.list(DIR)[9])
- end
- sleep(0.5)
- term.clear()
- term.setBackgroundColor(C)
- end
- term.setBackgroundColor(colors.black)
- term.clear()
- W,H = term.getSize()
- term.setCursorPos((W/2)-12,(H/2))
- term.setTextColor(colors.orange)
- term.setBackgroundColor(colors.gray)
- textutils.slowPrint("IT IS NOW SAFE TO SHUTDOWN")
- sleep(3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement