Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rs = require("component").redstone
- local sides = require("sides")
- local event = require("event")
- local addr = 0
- addrSide = sides.north
- rdSide = sides.east
- wrSide = sides.south
- local ram = {}
- for i = 0, 255 do
- ram[i] = 0
- -- print(ram[i])
- end
- local function redstoneUpdate(_, _, side)
- if side == addrSide then
- local input = rs.getBundledInput(addrSide)
- local total = 0
- for i = 0, 15 do
- if input[i] > 0 then
- input[i] = 1
- end
- io.write(input[i])
- total = total + (input[i] * (2^i))
- end
- addr = total
- end
- end
- while true do
- redstoneUpdate(event.pull("redstone_changed"))
- end
- -- event.listen("redstone_changed", redstoneUpdate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement