Advertisement
DDarkstorm

Moniteur énergie avec alarme (computercraft)

Mar 3rd, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. rednet.open"left"
  2. m = peripheral.wrap("back")
  3.  
  4. m.setTextScale(?)
  5.  
  6. while true do
  7.   event, id, text = os.pullEvent()
  8.   if event == "rednet_message" then
  9.     if id == ? then
  10.       if tonumber(text) <= 20 then
  11.         redstone.setOutput("top",true)
  12.         m.setBackgroundColor(colors.white)
  13.         m.setTextColor(colors.red)
  14.       else
  15.         redstone.setOutput("top",false)
  16.         m.setBackgroundColor(colors.black)
  17.         m.setTextColor(colors.white)
  18.       end
  19.       m.clear()
  20.       m.setCursorPos(1,1)
  21.       m.write("il reste")
  22.       m.write(text)
  23.       m.write("% sur le dernier cube")
  24.     end
  25.   end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement