Advertisement
Guest User

menu

a guest
Jul 24th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. monitor = peripheral.wrap("monitor_21")
  2. backColor = fs.open("background", "r")
  3. color = backColor.readLine()
  4. color = math.floor(color)
  5. backColor.close()
  6.  
  7. shell.exit("screen")
  8.  
  9. monW, monH = monitor.getSize()
  10. monitor.setTextScale(1.5)
  11. term.redirect(monitor)
  12.  
  13. function draw()
  14.   monitor.setBackgroundColor(color)
  15.   monitor.clear()
  16.   logo = paintutils.loadImage("logo")
  17.   paintutils.drawImage(logo,29  , 8)
  18.   monitor.setBackgroundColor(colors.gray)
  19.   monitor.setTextColor(colors.white)
  20.   monitor.setCursorPos(29, 17)
  21.   monitor.write(" RaysonTech ")
  22.   monitor.setCursorPos(30, 18)
  23.   monitor.write(" Systems ")
  24.  
  25.   monitor.setBackgroundColor(color)
  26.   monitor.setCursorPos(1, 3)
  27.   monitor.write("ME System Stats")
  28.  
  29.   monitor.setCursorPos(1, 5)
  30.   monitor.write("Power Resources")
  31.  
  32.   monitor.setCursorPos(1, 7)
  33.   monitor.write("Security")
  34.  
  35.   monitor.setCursorPos(41, 22)
  36.   monitor.setBackgroundColor(colors.green)
  37.   monitor.write(" REBOOT ")
  38.  
  39.   monitor.setCursorPos(1, 22)
  40.   monitor.setBackgroundColor(colors.black)
  41.   monitor.write("SETTINGS ")
  42.  
  43.   monitor.setBackgroundColor(color)
  44.   end
  45.  
  46. function handle()
  47.   event, side, posX, posY = os.pullEvent("monitor_touch")
  48.   sleep(0.1)
  49.   if posY == 4 or posY == 3 then
  50.     shell.run("meSys")
  51.     shell.exit()
  52.     end
  53.   if posY == 5 or posY == 6 then
  54.     shell.run("power")
  55.     shell.exit()
  56.     end
  57.   if posY == 7 or posY == 8 then
  58.     shell.run("security")
  59.     shell.exit()
  60.     end
  61.   if (posY == 22 or posY == 23) and (posX >= 41) then
  62.     os.reboot()
  63.     end
  64.   if (posY == 22 or posY == 23) and (posX <= 10) then
  65.     shell.run("settings")
  66.     shell.exit()
  67.     end
  68.   end
  69.  
  70. draw()
  71. handle()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement