Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local arg = {...}
- batC = arg[2]
- batCN = tonumber(batC)
- x = 0
- net1 = arg[4]
- net2 = arg[5]
- net3 = arg[6]
- net4 = arg[7]
- net5 = arg[8]
- rednet.open(arg[1])
- local function getSe(net)
- local BAT = peripheral.wrap(net)
- local char = BAT.getEUStored()
- return char
- end
- local function calc(enableVal, nets)
- if batCN > enableVal then
- x = x + getSe(nets)
- end
- end
- while true do
- calc(0, net1)
- calc(1, net2)
- calc(2, net3)
- calc(3, net4)
- calc(4, net5)
- rednet.send(tonumber(arg[3]), x)
- print(x)
- x = 0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement