Updated:
Player_Detector_2.1
http://pastebin.com/uxEjL0s6
Here is a list of the problems it has
1:
This has been fixed.
2:
The code can't properly detect a player. As the code stands, it will detect me, display coords, etc, but I can't seem to find a way to get it to detect another player and update their coords. for example, if I have a buddy in the room, and if im nearest to the computer/sensor, and I move to past my buddy in relation to said computer. the code will break at line 17: attempt to index ? (a nil value). As username = info[1].name gathers the players username. If i was nearest to the computer first it would assign me to the first person it detected online. hence table value of 1, my buddy is number 2. I assume it doesn't automatically switch between the assigned numbers, or that players don't get reassigned, but I can't see that part of computer craft.
3:
A java programming friend of mine who is helping me with the code off and on suggests that I refresh the information coming in or the peripheral connection. When playing around with the 3 local variables (other than peripheral.wrap) I find that the information lingers and does not want to change. I really did try refreshing these variables within the code, but to no avail, the code breaks or doesn't do what its supposed to do.
I suggest looking through my previous versions of the code before you offer a suggestion. chances are i've done that already here, but post anyways!
Any Ideas?
Previous Versions:
order is from Eldest to Newest
Computercraft 1.5 for 1.6.4:
Player_Detector
http://pastebin.com/x3dYYTZw
Player_Detector_v1.3
http://pastebin.com/3hfBPVip
pd (I don't remember what this one was for, probbably testing)
http://pastebin.com/vLSPvH3M
Computercraft 1.6 for 1.7.10 pastebins:
(More recent)
sensor
http://pastebin.com/2R70VBbg
prank
http://pastebin.com/4YvLke07
Door (working code/testing horror)
http://pastebin.com/E8U73dWR