Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local sides = require("sides")
- local colors = require("colors")
- local rs = component.proxy("cfbe0990-8d07-4f27-8a2f-73c641006fab")
- args = {...}
- -- print(x)
- if args[1] == "all" then
- if args[2] == "on" then
- for i = 1, 16, 1 do
- rs.setBundledOutput(sides.north, i - 1, 255)
- rs.setBundledOutput(sides.south, i - 1, 255)
- end
- elseif args[2] == "off" then
- for i = 1, 16, 1 do
- rs.setBundledOutput(sides.north, i - 1, 0)
- rs.setBundledOutput(sides.south, i - 1, 0)
- end
- else
- print("ERROR: Arg 2 must be ON or OFF")
- end
- else
- x = #args[1]
- -- print(x)
- if x < 33 then
- for i = 1, x, 1 do
- if args[1]:sub(i,i) == "1" then
- if i > 16 then
- a = i - 17
- rs.setBundledOutput(sides.north, a, 255)
- print("2-set")
- else
- rs.setBundledOutput(sides.south, i - 1, 255)
- print("1-set")
- end
- elseif args[1]:sub(i,i) == "0" then
- if i > 16 then
- a = i - 17
- rs.setBundledOutput(sides.north, a, 0)
- print("2-unset")
- else
- rs.setBundledOutput(sides.south, i - 1, 0)
- print("1-unset")
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment