View difference between Paste ID: Nu26ApLp and T32a3a2W
SHOW: | | - or go back to the newest paste.
1
print("Loading OpenCCSensors Power Measuring And Averaging Script")
2
os.loadAPI("ocs/apis/sensor")
3
4
print("Assuming radar is on the right")
5-
radar = sensor.wrap("right")
5+
sensor = sensor.wrap("right")
6
7-
targets =  sensor.getTargets()
7+
targets = sensor.getTargets()
8
9
for name, details in pairs(targets) do
10-
  print("Found a target of type "..details["type"])
10+
  --print("Found a target of type "..details["type"])
11
  print("Details:")
12
13
  -- get full details for the current target
14
  local fulldetails = sensor.getTargetDetails(name)
15
16
  -- print out each detail one by one
17
  for key, value in pairs(fulldetails) do
18
    print(key..": "..tostring(value))
19
  end
20
21
end