Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- load the API
- os.loadAPI("ocs/apis/sensor")
- -- wrap the sensor
- prox = sensor.wrap("bottom")
- m = peripheral.wrap("top")
- -- get the targets
- local targets = prox.getTargets()
- -- loop through them
- for name, basicDetails in pairs(targets) do
- -- print their name
- print("Found entity: "..name)
- -- get more details about them
- local md = prox.getTargetDetails(name)
- if md.MaxStorage == "" then
- print ""
- else
- m.write("Stored: ")
- m.write(md.MaxStorage)
- m.write("/")
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment