9551

Untitled

Jun 16th, 2021 (edited)
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. ---light switch by elektrobom1---
  2. rednet.open("top")
  3. local b = require("button")
  4. local cables = {
  5.     colors.white,
  6.     colors.orange,
  7.     colors.yellow
  8. }
  9. local ffs = {}
  10. for i = 1, #cables do
  11.     ffs[i] = false
  12. end
  13. local function ff(num)
  14.     ffs[num] = not ffs[num]
  15. end
  16. while true do
  17.     local rec = {rednet.receive()}
  18.     ff(rec[2])
  19.     b.bundle("back", cables[rec[2]], ffs[rec[2]])
  20. end
  21.  
Add Comment
Please, Sign In to add comment