Advertisement
On_The_Edge

Factory on off panel w displays V1

Feb 25th, 2021 (edited)
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.65 KB | None | 0 0
  1. -- Control Panel and Display for Factories --
  2.  
  3.  
  4. -- Components --
  5. ControlPanel = component.proxy("F06414914975C77E77F01C88581CD001") -- Mini Display
  6. StatusPanel = component.proxy("0EF0590D41325AFD81771FB45487D272") -- Large Screen
  7. gpu1 = computer.getGPUs(1)[1]
  8. gpu1:bindScreen(StatusPanel)
  9. gpu1:setsize(50,20)
  10. gpu1:setForeground(1,1,1,1)
  11. gpu1:setBackground(0,0,0,0)
  12.  
  13. -- Supercomputer City Components --
  14. SCSW = ControlPanel:getModule(4,9,0) -- SC lever switch
  15. SCDI = ControlPanel:getModule(1,9,0)
  16. SCBUT1 = ControlPanel:getModule(5,9,0)
  17. SCBUT2 = ControlPanel:getModule(5,10,0)
  18. SCDI.size = 52  -- Mini Screen Size --
  19. SCDI.text = "Supercomputer"
  20.  
  21. shred = component.proxy(component.findComponent("SCshred")) -- all sinks at SC City
  22.  
  23. gpu1:fill(0,0,100,50," ")
  24. gpu1:setText(1,1,"F A C T O R I E S  S T A T U S")
  25. gpu1:SetBackground(60,60,60,0.3)
  26. gpu1:fill(1,2,30,1," ")
  27. gpu1:setBackground(0,0,0,0)
  28. gpu1:flush()
  29.  
  30.  
  31. function scturnon()
  32. SCBUT1:setcolor(0,255,0,0)
  33. SCBUT2:setcolor(0,255,0,0)
  34. for _, m in ipairs(shred) do
  35.    m.Standby = false
  36. end
  37. gpu1:setText(1,4,"SUPERCOMPUTERS: ")
  38. gpu1:setForeground(0,255,0,1)
  39. gpu1:setText(20,4," > ONLINE < ")
  40. gpu1:flush()
  41. gpu1:setForeground(1,1,1,1)
  42.  
  43. end
  44.  
  45.  
  46. function scturnoff()
  47. SCBUT1:setcolor(255,0,0,0)
  48. SCBUT2:setcolor(255,0,0,0)
  49. for _, m in ipairs(shred) do
  50.    m.Standby = true
  51. end
  52. gpu1:setText(1,4,"SUPERCOMPUTERS: ")
  53. gpu1:setForeground(255,0,0,1)
  54. gpu1:setText(20,4,"> OFFLINE <")
  55. gpu1:flush()
  56. gpu1:setForeground(1,1,1,1)
  57.  
  58. end
  59.  
  60. -- scstate = "true"
  61. while true do
  62. event.listen(SCSW)
  63. e, s, scstate = event.pull(2)
  64. if scstate == true then scturnon()
  65. end
  66. if scstate == false then scturnoff()
  67. end
  68. end
  69.  
  70.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement