Guest User

WaffgoHOS

a guest
Aug 2nd, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. -- Handheld Operating System by Goodle Software
  2.  
  3. -- VARIABLES
  4. w,h=term.getSize()
  5.  
  6. cw = w/2
  7.  
  8. ch = h/2
  9.  
  10. notif = false -- if a notification is present
  11.  
  12. time = os.time()
  13. formattedTime = textutils.formatTime( time, false)
  14.  
  15. -- FUNCTIONS
  16. homeScreen=function()
  17.  
  18.   local pD = 1 -- Pixels Down
  19.    
  20.   term.clear()
  21.  
  22.   while pD <= h do
  23.     paintutils.drawLine(1,pD, w,pD, colours.cyan )
  24.     pD = pD + 1
  25.     end
  26.  
  27.   term.setCursorPos(w-1,h-1)
  28.   term.setBackgroundColour( colours.cyan )
  29.   term.setTextColour( colours.white )
  30.   term.write("#")
  31.  
  32.   paintutils.drawLine(1,1, w,1, colours.blue )
  33.   term.setCursorPos(2,1)
  34.  
  35.     if notif==true
  36.       then term.write("!")
  37.     else
  38.       term.write(" ")
  39.       end
  40.  
  41.   term.setCursorPos(w-6,1)
  42.   term.write(formattedTime)
  43.  
  44.   while true do
  45.     term.setCursorPos(0,0)
  46.     term.setCursorBlink(false)
  47.     read("")
  48.     end
  49.  
  50. end
  51.  
  52. startup=function()
  53.  
  54.   term.clear()
  55.  
  56.   term.setBackgroundColour( colours.cyan )
  57.   term.setTextColour( colours.white )
  58.   term.setCursorPos(cw-1,ch)
  59.   term.write(" G  ")
  60.   term.setCursorPos(cw-1,ch+1)
  61.   term.write("  S ")
  62.   term.setCursorPos(cw-1,ch+2)
  63.   term.setBackgroundColour( colours.blue )
  64.   term.write("   ")
  65.   term.setCursorPos(cw-2,ch+1)
  66.   term.write(" ")
  67.   term.setCursorPos(cw-2,ch+2)
  68.   term.write(" ")
  69.  
  70.   term.setBackgroundColour( colours.black )
  71.   term.setTextColour( colours.white)
  72.  
  73.   sleep(5)
  74.  
  75. end
  76.  
  77. -- EXECUTION
  78.  
  79. startup()
  80.  
  81. homeScreen()
Advertisement
Add Comment
Please, Sign In to add comment