Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Set params
- tankSide = "bottom"
- modemSide = "right"
- monitorID = 52
- tank = peripheral.wrap(tankSide)
- rednet.open(modemSide)
- name = "empty"
- function main()
- amount = 1
- id, msg, distance, tableinfo, results = nil, nil, nil, nil, nil
- id, msg, distance = rednet.receive()
- if id == monitorID then
- tableinfo = tank.getTankInfo("bottom")
- results = tableinfo[1]
- sleep(1)
- if results["amount"] ~= nil then
- amount = results["amount"]
- end
- if results["name"] ~= nil then
- name = results["name"]
- end
- rednet.send(monitorID, name.." "..amount.." "..results["capacity"])
- end
- end
- while true do
- main()
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement