Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Configuration
- local rednetLocation = "top"
- local drumLocation = "back"
- local numeric = 1
- local liquid = {}
- -- Configuration End
- drum = peripheral.wrap( drumLocation )
- rednet.open( rednetLocation )
- while true do
- local drumdata = drum.getTankInfo()[1]
- local maxValue = drumdata["capacity"]
- if not nil == drumdata["contents"] then
- local id = drumdata["contents"]["name"]
- local currentValue = drumdata["contents"]["amount"]
- local label = drumdata["contents"]["rawName"]
- if nil == liquid then
- liquid["id"] = id
- liquid["label"] = label
- end
- else
- local currentValue = 0
- end
- if not nil == liquid then
- rednet.broadcast( "liquidData " .. numeric .. " " .. liquid["id"] .. " " .. currentValue .. " " .. maxValue .. " " .. liquid["label"] .. "" )
- end
- sleep( 10 )
- end
- rednet.close( rednetLocation )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement