Advertisement
DigitalZilla

SlaveRenderer

Aug 23rd, 2014
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. MAX = 65535; -- All 16 bits turned on
  2.  
  3. local Side = select(1, ...);
  4. local Invert = select(2, ...);
  5.  
  6. Invert = Invert == "true";
  7.  
  8. print(Side);
  9. print(Invert);
  10.  
  11. rednet.open("right");
  12.  
  13. while true do
  14.     local sender, msg = rednet.receive();
  15.     local num = tonumber(msg);
  16.     if (num) then
  17.         if (Invert) then
  18.             num = bit.band(MAX, bit.bnot(num));
  19.         end
  20.  
  21.         print(os.time(), ": ", num);
  22.         rs.setBundledOutput(Side, num);
  23.     end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement