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")
- StatusPanel = component.proxy("0EF0590D41325AFD81771FB45487D272")
- MoSink = component.proxy("FBDA27EF47E9B688082CA8B0B24D6432") -- Motors sink --
- OsSink = component.proxy("AD06B4F9497D88B5BFFD3083970103B9") -- Oscillators Sink --
- 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
- SCDI.text = "Supercomputer"
- -- Motors Components --
- MOSW = ControlPanel:getModule(4,6,0) -- Motors lever switch
- MODI = ControlPanel:getModule(1,6,0)
- MOBUT1 = ControlPanel:getModule(5,6,0)
- MOBUT2 = ControlPanel:getModule(5,7,0)
- MODI.size = 52
- MODI.text = "Motors"
- -- Oscillator Components --
- OSSW = ControlPanel:getModule(4,3,0) -- Oscillator lever switch
- OSDI = ControlPanel:getModule(1,3,0)
- OSBUT1 = ControlPanel:getModule(5,3,0)
- OSBUT2 = ControlPanel:getModule(5,4,0)
- OSDI.size = 52
- OSDI.text = "Oscillators"
- shred = component.proxy(component.findComponent("SCshred")) -- all sinks at SC City
- -- Supercomputers functions --
- function scfunction()
- if scstate == true then
- print("SCan")
- 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
- if scstate == false then
- print ("SCaus")
- 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
- end
- -- Motors functions --
- function mofunction()
- if scstate == true then
- print ("MOan")
- MoSink.Standby = false
- MOBUT1:setcolor(0,255,0,0)
- MOBUT2:setcolor(0,255,0,0)
- gpu1:setText(1,6,"MOTORS: ")
- gpu1:setForeground(0,255,0,1)
- gpu1:setText(20,6," > ONLINE < ")
- gpu1:flush()
- gpu1:setForeground(1,1,1,1)
- end
- if scstate == false then
- print ("MOaus")
- MoSink.Standby = true
- MOBUT1:setcolor(255,0,0,0)
- MOBUT2:setcolor(255,0,0,0)
- gpu1:setText(1,6,"MOTORS: ")
- gpu1:setForeground(255,0,0,1)
- gpu1:setText(20,6,"> OFFLINE <")
- gpu1:flush()
- gpu1:setForeground(1,1,1,1)
- end
- end
- -- Oscillator functions --
- function osfunction()
- if scstate == true then
- print ("OSan")
- OsSink.Standby = false
- OSBUT1:setcolor(0,255,0,0)
- OSBUT2:setcolor(0,255,0,0)
- gpu1:setText(1,8,"OSCILLATORS: ")
- gpu1:setForeground(0,255,0,1)
- gpu1:setText(20,8," > ONLINE < ")
- gpu1:flush()
- gpu1:setForeground(1,1,1,1)
- end
- if scstate == false then
- print ("OSaus")
- OsSink.Standby = true
- OSBUT1:setcolor(255,0,0,0)
- OSBUT2:setcolor(255,0,0,0)
- gpu1:setText(1,8,"OSCILLATORS: ")
- gpu1:setForeground(255,0,0,1)
- gpu1:setText(20,8,"> OFFLINE <")
- gpu1:flush()
- gpu1:setForeground(1,1,1,1)
- end
- end
- -- Header --
- 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)
- event.listen(SCSW, MOSW, OSSW)
- while true do
- e, s, scstate = event.pull(5)
- if s == SCSW then
- scfunction()
- elseif s == MOSW then
- mofunction()
- elseif s == OSSW then
- osfunction()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement