Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Handheld Operating System by Goodle Software
- -- VARIABLES
- w,h=term.getSize()
- cw = w/2
- ch = h/2
- notif = false -- if a notification is present
- time = os.time()
- formattedTime = textutils.formatTime( time, false)
- -- FUNCTIONS
- homeScreen=function()
- local pD = 1 -- Pixels Down
- term.clear()
- while pD <= h do
- paintutils.drawLine(1,pD, w,pD, colours.cyan )
- pD = pD + 1
- end
- term.setCursorPos(w-1,h-1)
- term.setBackgroundColour( colours.cyan )
- term.setTextColour( colours.white )
- term.write("#")
- paintutils.drawLine(1,1, w,1, colours.blue )
- term.setCursorPos(2,1)
- if notif==true
- then term.write("!")
- else
- term.write(" ")
- end
- term.setCursorPos(0,0)
- term.setCursorBlink(false)
- while true do
- read("")
- end
- end
- startup=function()
- term.clear()
- term.setBackgroundColour( colours.cyan )
- term.setTextColour( colours.white )
- term.setCursorPos(cw-1,ch)
- term.write(" G ")
- term.setCursorPos(cw-1,ch+1)
- term.write(" S ")
- term.setCursorPos(cw-1,ch+2)
- term.setBackgroundColour( colours.blue )
- term.write(" ")
- term.setCursorPos(cw-2,ch+1)
- term.write(" ")
- term.setCursorPos(cw-2,ch+2)
- term.write(" ")
- term.setBackgroundColour( colours.black )
- term.setTextColour( colours.white)
- sleep(5)
- end
- clock = function()
- time = os.time()
- formattedTime = textutils.formatTime( time, false)
- local clockwin = window.create(term.current(),w-6,1,6,1)
- while true do
- clockwin.setBackgroundColour( colours.blue )
- clockwin.setCursorPos(w-6, 1)
- clockwin.write(formattedTime)
- os.sleep(1)
- end
- end
- -- EXECUTION
- startup()
- clock()
- parallel.waitForAny(homeScreen(), clock())
Advertisement
Add Comment
Please, Sign In to add comment