Advertisement
hoblin

Light client

Nov 24th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. rednet.open("front")
  2. lightOn = false
  3. while true do
  4.   wiresOn = colors.green
  5.   sender, message, distance = rednet.receive(1)
  6.   if message == "lightOn" then
  7.     print('Day begins')
  8.     lightOn = true
  9.   elseif message == "lightOff" then
  10.     print('Night comes')
  11.     lightOn = false
  12.   end
  13.   if lightOn then
  14.     wiresOn = wiresOn + colors.white
  15.   end
  16.   rs.setBundledOutput("top", wiresOn)
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement