Advertisement
Guest User

Untitled

a guest
Jan 19th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. local controllerSide = sensors.getController()
  2. print( controllerSide )
  3. local sensorName = "Sensor"
  4. print( sensorName )
  5. local WorldProbe = sensors.getProbes( controllerSide, sensorName )[1]
  6. local targets = sensors.getAvailableTargetsforProbe(controllerSide, sensorName, WorldProbe)
  7. local data = {}
  8.  
  9. for k,v in pairs( targets ) do
  10.     table.insert( data, sensors.getSensorReadingAsDict( controllerSide, sensorName, v, WorldProbe ) )
  11. end
  12.  
  13. for k,entity in pairs( data ) do
  14.     if entity.name == "vq" then
  15.         print( "Name:"..entity.name )
  16.         print( "X: "..entity.xCoord )
  17.         print( "Y: "..entity.yCoord )
  18.         print( "Z: "..entity.zCoord )
  19.     end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement