Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This is in fact my code. Liscenced under Mozilla 2
- shell.run("clear")
- rednet.open("back")
- gid = nil
- function cid()
- output = false
- while true do
- print("test")
- id,msg = rednet.receive()
- if id == gid then
- output = msg
- end
- end
- return output
- end
- function main()
- while true do
- energy = cid()
- fuel = cid()
- state = cid()
- shell.run("clear")
- print("Reactor...")
- if energy < 5000000 and energy > 2500000 then
- term.setTextColor(colors.yellow)
- elseif energy < 2500000 then
- term.setTextColor(colors.red)
- elseif energy > 5000000 then
- term.setTextColor(colors.green)
- end
- print("Energy: "..energy)
- if fuel < 40000 and fuel > 25000 then
- term.setTextColor(colors.yelow)
- elseif fuel < 25000 then
- term.setTextColor(colors.red)
- elseif fuel > 40000 then
- term.setTextColor(colors.green)
- end
- print("Fuel: "..fuel)
- if state == true then
- term.setTextColor(colors.green)
- print("On/Off: ON")
- elseif state == false then
- term.setTextColor(colors.red)
- print("On/Off: OFF")
- end
- term.setTextColor(colors.white)
- end
- end
- while true do
- id,msg = nil
- id,msg = rednet.receive(2)
- if msg == "pair" then
- rednet.send(id,io.read())
- id,msg = rednet.receive(id)
- if msg == "paired" then
- gid = id
- print("paired")
- main()
- end
- end
- end
- print("paired")
Advertisement
Add Comment
Please, Sign In to add comment