MigasRocha

MainScreen FirstPage /Tank Regulator/Computer ID:43

Dec 26th, 2024
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.79 KB | Gaming | 0 0
  1. modem = peripheral.find("modem")
  2.  
  3. mon = peripheral.find("monitor")
  4.  
  5. mon.clear()
  6.  
  7. ---Next Page---
  8.  
  9. mon.setCursorPos(29,12)
  10. mon.setTextColor(colors.white)
  11. mon.write(">")
  12.  
  13. ---General Title--
  14.  
  15. mon.setCursorPos(8,1)
  16. mon.setTextColor(colors.purple)
  17. mon.write("Reactor Gases")
  18.  
  19. --Fissile Fuel Title--
  20.  
  21. mon.setCursorPos(1,3)
  22. mon.setTextColor(colors.lightBlue)
  23. mon.write("Fissile Fuel Tank")
  24.  
  25. --Uranium Hexafluoride Title--
  26.  
  27. mon.setCursorPos(1,7)
  28. mon.setTextColor(colors.lime)
  29. mon.write("Uranium Hexafluoride")
  30.  
  31. modem.open(1)
  32.  
  33. modem.open(2)
  34.  
  35.  
  36. function handleModemMessages()
  37.  
  38.     while true do
  39.        
  40.                 local event, _, channel, _, message = os.pullEventRaw("modem_message")
  41.                    
  42.                 if event == "modem_message" then
  43.                         if  channel == 1 then
  44.                             mon.setCursorPos(3,5)
  45.                             mon.clearLine()
  46.                             mon.setTextColor(colors.white)
  47.                             mon.write(message .."%")
  48.                            
  49.                         elseif channel == 2 then
  50.                             mon.setCursorPos(3,9)
  51.                             mon.clearLine()
  52.                             mon.setTextColor(colors.white)
  53.                             mon.write(message .."%")
  54.                         end
  55.                 end
  56.     end
  57. end
  58.  
  59. function handleMonitorTouch()
  60.  
  61.     while true do
  62.         local touchEvent, touchSide, x, y = os.pullEvent("monitor_touch")
  63.         if touchEvent == "monitor_touch" and x == 29 and y == 12 then
  64.            mon.clear()
  65.            modem.close(1)
  66.            modem.close(2)
  67.            shell.run("teste2")
  68.            return
  69.         end      
  70.     end
  71.    
  72. end
  73.  
  74. parallel.waitForAll(handleModemMessages, handleMonitorTouch)
  75.  
Advertisement
Add Comment
Please, Sign In to add comment