meuced

affetatWF.lua

Jan 20th, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. os.setComputerLabel("MaIF") -- changer label ici en fonction du monitor à controler : MaIF (entre Macerarot et IronFurnace) ou IFCo (entre Iron Furnace et Compressor)
  2. mon = peripheral.wrap("back")
  3. for n,m in ipairs(rs.getSides()) do rednet.open(m) end -- Opens all rednet sides.
  4. while true do
  5.     event, id, text = os.pullEvent()
  6.     if event == "rednet_message" then
  7.         if id == 66 then -- adapter l'id en fonction de celui de l'ordinateur qui envoie les messages (utiliser en lua la commande os.computerID() )
  8.             if text == "true" then
  9.                 mon.setBackgroundColor(colors.green)
  10.                 mon.clear()
  11.             elseif text == "false" then
  12.                 mon.setBackgroundColor(colors.red)
  13.                 mon.clear()
  14.                 end
  15.             end
  16.     end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment