This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
predatorxil's profile picture

OpenCcSensor

Started by predatorxil, 25 March 2013 - 07:05 AM
predatorxil #1
Posted 25 March 2013 - 08:05 AM
Hello,
Im trying to make a door open when within a proximity of the sensor, i dont now how to add this into a program, i am however able to pull certain players from the card readings, display them, and make the computer tell me if they are in range or not. Please help.
Molinko #2
Posted 25 March 2013 - 11:20 AM
Hello,
Im trying to make a door open when within a proximity of the sensor, i dont now how to add this into a program, i am however able to pull certain players from the card readings, display them, and make the computer tell me if they are in range or not. Please help.


what youre looking for is the value "Position" in the table that getTargets() returns.
e.g.

targets = prox.getTargets() -- your choice here
for k,v in pairs(targets) do
   x = v.Position.X
   y = v.Position.Y
   z = v.Position.Z
end



this should be a start for gathering the data you need. what you doo with the info is up to you :)/>