Guest User

startup

a guest
Oct 4th, 2023
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2.   prox = sensor.wrap("left")
  3.  
  4.   local target = prox.getTargets()
  5.  
  6. for tarName, _ in pairs(target) do
  7.     --fetch the detailed information table for the current target.
  8.     local details = prox.getTargetDetails(tarName)
  9.     if details["RawName"] == "tile.averagecounter" then
  10.       for k, v in pairs(details) do
  11.           print(tostring(k)..": "..tostring(v))
  12.       end
  13.     end
  14.     sleep(2)
  15. end
Advertisement
Add Comment
Please, Sign In to add comment