Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Color ()
- button.e.color("a","text", colors.lime, colors.red)
- button.e.color("a","back", colors.lime, colors.red)
- button.e.color("b","text", colors.lime, colors.red)
- button.e.color("b","back", colors.lime, colors.red)
- button.e.color("c","text", colors.lime, colors.red)
- button.e.color("c","back", colors.lime, colors.red)
- button.e.color("d","text", colors.lime, colors.red)
- button.e.color("d","back", colors.lime, colors.red)
- button.e.color("e","text", colors.lime, colors.red)
- button.e.color("e","back", colors.lime, colors.red)
- button.e.color("f","text", colors.lime, colors.red)
- button.e.color("f","back", colors.lime, colors.red)
- end
- function TurbinePower(state)
- rednet.send(controller,tostring(state),"tMonPower")
- end
- function TurbineEng(state)
- rednet.send(controller,tostring(state),"tMonInduct")
- end
- function networkLoop()
- while true do
- local senderId, message, protocol = rednet.receive("turbine")
- if senderId == controller then
- local turbinetable = textutils.unserialize(message)
- button.e.text("a",tostring(turbinetable[2]))
- button.e.text("b",tostring(turbinetable[3]))
- button.e.status("e",turbinetable[1])
- button.e.status("f",turbinetable[4])
- end
- end
- end
- rednet.open("top")
- rednet.host("tMon",os.getComputerLabel())
- controller = rednet.lookup("turbine","turbinethreecontroller")
- os.loadAPI("button")
- button.wrap("back")
- button.e.s.scale(1)
- button.new.b("a","Button 1",2,12,2,4,nil,nil)
- button.new.b("b","Button 2",2,12,6,8,nil,nil)
- button.new.b("e","Turbine",26,36,2,4,TurbinePower,false)
- button.new.b("f","Inductor",26,36,6,8,TurbineEng,false)
- parallel.waitForAll(button.cycle,networkLoop)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement