Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. ver = ("Spawner Operating System")
  2. m = peripheral.wrap("right")
  3. w,h = m.getSize()
  4.  
  5. --function
  6.  
  7. function cenText(text, y)
  8.   m.setCursorPos(math.floor(w - #text) / 2, y)
  9.   print(text)
  10. end
  11.  
  12. function title()
  13.  m.setCursorPos(1,1)
  14.  m.clear()
  15.  m.setBackgroundColor(colors.black)
  16.  m.setTextColor(colors.yellow)
  17.  cenText(ver,1)
  18. end
  19.  
  20. function mainMenu()
  21.   title()
  22.   m.setBackgroundColor(colors.black)
  23.   m.setTextColor(colors.white)
  24.   cenText("{ Open Operating System }",7)
  25.   cenText("{ Reboot }",9)
  26.   cenText("{ Future Improvments}", 11)
  27.   m.setCursorPos(0,0)
  28. end
  29.  
  30. mainMenu()
  31.  
  32. while true do
  33.   local event, button, X, Y = os.pullEventRaw()
  34.       if event == "mouse_click" then
  35.         if X >= 13 and X <= 37 and Y == 7 and button == 1  then
  36.             print("awesome")
  37.         elseif X >= 20 and X <= 29 and Y == 9 and button == 1 then
  38.             print("YES")
  39.         elseif X >= 14 and X <= 36 and Y ==11  and button == 1 then
  40.             print("working")
  41.       end
  42.   end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement