Godleydemon

anothetest

Jul 29th, 2013
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. local sensor = peripheral.wrap("left")
  2. -- get basic details of the targets the sensor has detected
  3. local targets = sensor.getTargets()
  4. -- loop through them
  5. for name, details in pairs(targets) do
  6.  
  7. print("Found a target of type "..details["type"])
  8. print("Details:")
  9.  
  10. -- get full details for the current target
  11. local fulldetails = sensor.getTargetDetails(name)
  12.  
  13. -- print out each detail one by one
  14. for key, value in pairs(fulldetails) do
  15. print(key..": "..tostring(value))
  16. end
  17.  
  18. end
Add Comment
Please, Sign In to add comment