Guest User

CC OpenSensors Power Measure

a guest
Oct 5th, 2015
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  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")
  6.  
  7. targets = sensor.getTargets()
  8.  
  9. for name, details in pairs(targets) do
  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
Advertisement
Add Comment
Please, Sign In to add comment