Advertisement
thegreatstudio

os.lua

Mar 13th, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.91 KB | None | 0 0
  1. Build = 1.0
  2. Codename = "Angry Koala"
  3. name = "Isaac OS"
  4.  
  5. os.loadAPI = "/isaacos/system/api/isaacos.api"
  6.  
  7. screenX, screenY = term.getSize()
  8.  
  9. term.setBackgroundColor(colors.white)
  10. term.clear()
  11. term.setCursorPos(1,1)
  12. os.sleep(0.1)
  13. while true do
  14.   term.setBackgroundColor(colors.lightBlue)
  15.   term.clear()
  16.   paintutils.drawLine(1, 1, screenX, 1, colors.cyan)
  17.   term.setTextColor(colors.black)
  18.   term.setCursorPos(1,1)
  19.   print("[Isaac]")
  20.    local event, button, x, y = os.pullEventRaw("mouse_click")
  21.   if event == "mouse_click" then
  22.     if x >= 1 and x <= 6 then
  23.       if y == 1 then
  24.         paintutils.drawLine(1, 1, 6, 1, colors.cyan)
  25.         paintutils.drawLine(1, 2, 8, 2, colors.cyan)
  26.         paintutils.drawLine(1, 3, 8, 3, colors.cyan)
  27.         term.setCursorPos(1,1)
  28.         print("(Isaac)")
  29.         print("All Programs")
  30.         print("Restart")
  31.         print("Shutdown")
  32.  
  33.  
  34.         b = false
  35.  
  36.         local event, button, x, y = os.pullEventRaw("mouse_click")
  37.         if event == "mouse_click" then
  38.         if x >= 1 and x <= 8 then
  39.           term.setBackgroundColor(colors.lightBlue)
  40.           term.clear()
  41.           paintutils.drawLine(1, 1, screenX, 1, colors.blue)
  42.           term.setTextColor(colors.black)
  43.           term.setBackgroundColor(colors.lightBlue)
  44.           if y == 2 then -- shell
  45.           print("Going to Programs!")
  46.           sleep(0)
  47.           shell.run("/isaacos/Programs/program.lua")
  48.  
  49.           elseif y == 3 then -- restart
  50.           term.clear()
  51.             term.setCursorPos(1,1)
  52.             print("Restarting System.")
  53.             os.sleep(1.5)
  54.             os.reboot()
  55.  
  56.           elseif y == 4 then -- shutdown
  57.               term.clear()
  58.               term.setCursorPos(1,1)
  59.               print("Shutting down")
  60.               os.sleep(1.5)
  61.               os.shutdown()
  62.                 end
  63.               end
  64.            
  65.  
  66.         end
  67.  
  68.       end
  69.     end
  70.   end
  71. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement