Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local glasses = peripheral.wrap("top");
- rednet.open("right");
- local protocol = "API";
- local furnaceStatus = "Offline";
- glasses.clear();
- function main()
- while true do
- local address = rednet.lookup("API", "FurnaceSystem");
- if address ~= nil then
- rednet.send(address, "getFurnaceData", protocol);
- local from, message = rednet.receive(protocol, 1);
- furnaceStatus = message;
- if furnaceStatus == nil then furnaceStatus = "Offline" end
- print(furnaceStatus);
- end
- sleep(0);
- end
- end
- function updateGlasses()
- while true do
- glasses.clear();
- glasses.drawString("Furnace Status: ", 7, 200, 0xFFFFFF);
- -- if furnaceStatus == "Offline" then
- -- glasses.drawString("Offline ", 90, 200, 0xFF0000);
- -- elseif furnaceStatus == "Partially Online" then
- -- glasses.drawString("Partially Online ", 90, 200, 0xFF9700);
- -- elseif furnaceStatus == "Online" then
- -- glasses.drawString("Online ", 90, 200, 0x00FF00);
- -- end
- sleep(1)
- end
- end
- parallel.waitForAny(main, updateGlasses);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement