Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --this is the skeleton program for E-Handbook
- local Page = {}
- local CPage = "home.txt"
- local function Clean()
- term.clear()
- term.setCursorPos(1,1)
- end
- local function Options(Y,OPTs)
- term.setCursorPos(1,Y)
- local n = 1
- while true do
- for i = 1, #OPTs do
- term.setCursorPos(1,Y+(i-1))
- term.clearLine()
- if n == i then term.write(">> "..i.." - "..OPTs[i].. "<<") else term.write(i.." - "..OPTs[i]) end
- end
- local a, b = os.pullEvent("key")
- if b == keys.w or b == keys.up then if n == 1 then n = #OPTs else n = n - 1 end end
- if b == keys.s or b == keys.down then if n == #OPTs then n = 1 else n = n + 1 end end
- if b == keys.enter then break end
- end
- return n
- end
- local function Single_Prompt(text)
- Clean()
- print(text)
- print("y/n")
- local a, b
- repeat a,b = os.pullEvent("key") until b == keys.y or b == keys.n
- local A
- if b == keys.y then A = true elseif b == keys.n then A = false end
- return A
- end
- local function LoadImage(file,x,y)
- if fs.exists(file) then
- else
- term.setCursorPos(x,y)
- term.write("Error: Image not found")
- end
- end
- local function PageSystem(pg,action,entity,arg)
- --Page Format
- --(Title),(colors),{Entities},(ReturnButton)
- --Colors = {Text,Background}
- --Entity Format: {id,text,type,{events},w,h,x,y,files}
- if action == "interact" then
- elseif action == "load" then
- local file = fs.open(pg,"r")
- Page = textutils.unserialize(file.readAll())
- file.close()
- for i = 1, #Page[3] do
- end
- elseif action == "edit" then
- end
- end
- function SettingsMenu()
- Clean()
- print("System")
- local List = Options(3,{"[Menu]","reboot normal","check updates","details"})
- if List == 1 then Menu() elseif List == 2 then os.queueEvent("admin","N_restart") elseif List == 3 os.queueEvent("admin","network","updates") elseif List == 4 then end
- end
- function ScheduleMenu()
- end
- function ReportMenu()
- end
- function EvidenceMenu()
- end
- function Menu()
- Clean()
- print("Student E-Handbook")
- print("[Skeleton mode]")
- print("hello <STUDENT>!")
- local List = Options(5,{"Schedule","Report Cards", "Evidence","System"})
- if List == 1 then ScheduleMenu() elseif List == 2 then ReportMenu() elseif List == 3 then EvidenceMenu() elseif List == 4 then SettingsMenu() end
- end
- Menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement