r/ComputerCraft • u/Ecstatic-Place1549 • Dec 12 '23
How to track a player with their pocket computer?
I could use a lot of detail since I am new to this. I would be supplying the pocket computer so I could put what ever I want on it. And I do not care how expensive it is!
10
Upvotes
4
u/niclan051 Dec 12 '23
gps
2
u/Existing-Strength-21 Dec 12 '23
I'm not sure what your trying to achieve exactly... Are you trying to hand out pocket computers to players on a server so you can track their location? Are you trying to do this covertly, so they don't know your tracking them?
Or are you trying to give players the ability to find and display their own locations on their personally assigned pocket turtles?
1
u/Ecstatic-Place1549 Dec 14 '23
My problem was resolved thank you!
3
u/fatboychummy Dec 14 '23
Method 1
The most 'covert' way would be to make a wireless pocket computer that just has a
startup.luafile of the following:Code: (Wireless Pocket Computer)
Change the
IDENTIFIERvariable to something so you can know who is broadcasting what. Change theDELAY_TIMEvariable to the time in seconds between broadcasts. A high value will be less likely to be noticed, but a low value will provide more accuracy -- especially if the server you're on has access to teleport commands.The hardest part: You'll need to make a reverse-gps cluster. Essentially, this uses four wireless modems in different positions to locate the source of a signal. How does it do this? Since modem messages return the exact distance from the sender when sent, you essentially draw a circle around each modem where the radius is the distance from the sender from that specific modem. From there, where all the circles overlap is the location of the sender. It uses some bit of math to figure this out, but I don't personally know it off the top of my head -- this'd be something you will need to research. Multilateration is what you'd want to google.
Alternatively: Make a very simple program that just listens for specific messages on the modem, then outputs the distance. You'll need to figure out what direction to go on your own (and will likely want a higher update rate).
Code: (Wireless Pocket Computer)
Alternatively part 2: You can also make the code of the tracker instead wait for a specific message and then reply to it. This will allow you to do the above, but only when you are actively looking for them. Or, you can combine both methods to have an active ping once every so often (so you can get records of locations they travel to), then have your location request ping spam messages when you absolutely need to know where they're at.
Method 2
Set up a basic GPS cluster, then put code on the pocket computer that requests its gps location then broadcasts it.
Code: (Wireless Pocket Computer)
Code: (Wireless Pocket Computer)
This method is much easier for someone new to programming and will output the raw coordinates out of the box, but it's going to be much more noticeable to someone who is savvy with CC.
1
u/Sufficient_Slide6134 Dec 13 '23
Do gps as a deamon style program and just make some usefull functions on top