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("C659D07C4E5C2B8F6BACC895A3BBA74D")
- gpu1 = computer.getGPUs(1)[1]
- gpu1:bindScreen(StatusPanel)
- gpu1:setsize(20,50)
- 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 = 60
- SCDI.text = "Supercomputer"
- -- print (SCSW, SCDI, SCBUT1, SCBUT2)
- shred = component.proxy(component.findComponent("SCshred")) -- all sinks at SC City
- function turnon()
- SCBUT1:setcolor(0,255,0,0)
- SCBUT2:setcolor(0,255,0,0)
- for _, m in ipairs(shred) do
- m.Standby = false
- end
- end
- function turnoff()
- SCBUT1:setcolor(255,0,0,0)
- SCBUT2:setcolor(255,0,0,0)
- for _, m in ipairs(shred) do
- m.Standby = true
- end
- end
- -- scstate = "true"
- while true do
- event.listen(SCSW)
- e, s, scstate = event.pull(2)
- print (scstate)
- if scstate == true then turnon()
- end
- if scstate == false then turnoff()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment