Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Control Panel and Display for Factories --
- -- Components --
- ControlPanel = component.proxy("F06414914975C77E77F01C88581CD001") -- Mini Display
- StatusPanel = component.proxy("0EF0590D41325AFD81771FB45487D272") -- Large Screen
- gpu1 = computer.getGPUs(1)[1]
- gpu1:bindScreen(StatusPanel)
- gpu1:setsize(50,20)
- gpu1:setForeground(1,1,1,1)
- gpu1:setBackground(0,0,0,0)
- -- Supercomputer City Components --
- SCSW = ControlPanel:getModule(4,9,0) -- SC lever switch
- SCDI = ControlPanel:getModule(1,9,0)
- SCBUT1 = ControlPanel:getModule(5,9,0)
- SCBUT2 = ControlPanel:getModule(5,10,0)
- SCDI.size = 52 -- Mini Screen Size --
- SCDI.text = "Supercomputer"
- shred = component.proxy(component.findComponent("SCshred")) -- all sinks at SC City
- gpu1:fill(0,0,100,50," ")
- gpu1:setText(1,1,"F A C T O R I E S S T A T U S")
- gpu1:SetBackground(60,60,60,0.3)
- gpu1:fill(1,2,30,1," ")
- gpu1:setBackground(0,0,0,0)
- gpu1:flush()
- function scturnon()
- SCBUT1:setcolor(0,255,0,0)
- SCBUT2:setcolor(0,255,0,0)
- for _, m in ipairs(shred) do
- m.Standby = false
- end
- gpu1:setText(1,4,"SUPERCOMPUTERS: ")
- gpu1:setForeground(0,255,0,1)
- gpu1:setText(20,4," > ONLINE < ")
- gpu1:flush()
- gpu1:setForeground(1,1,1,1)
- end
- function scturnoff()
- SCBUT1:setcolor(255,0,0,0)
- SCBUT2:setcolor(255,0,0,0)
- for _, m in ipairs(shred) do
- m.Standby = true
- end
- gpu1:setText(1,4,"SUPERCOMPUTERS: ")
- gpu1:setForeground(255,0,0,1)
- gpu1:setText(20,4,"> OFFLINE <")
- gpu1:flush()
- gpu1:setForeground(1,1,1,1)
- end
- -- scstate = "true"
- while true do
- event.listen(SCSW)
- e, s, scstate = event.pull(2)
- if scstate == true then scturnon()
- end
- if scstate == false then scturnoff()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement