Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --To use, call from shell with the integer you wish to pass
- --precede with _ instead of - for negative numbers
- shell = require("shell")
- params, args = shell.parse(...)
- component = require("component")
- outputs = {}
- for address in component.list("redstone") do
- outputs[component.proxy(address).getInput(1)] = component.proxy(address)
- end
- input = string.gsub(params[1], "_", "-")
- input = tonumber(input)
- hex = string.format("%.8x", math.floor(math.abs(2*input+0.5)))
- for i, v in pairs(outputs) do
- v.setOutput(5, tonumber("0x"..hex:sub(i,i)))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement