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

Is it possible to make a program that tells the computers coordinates?

Started by AmericanMuffin, 26 July 2012 - 07:59 PM
AmericanMuffin #1
Posted 26 July 2012 - 09:59 PM
I want to do this to keep people from stealing.
Noodle #2
Posted 26 July 2012 - 10:04 PM
No exactly sure what you are saying..
Turtles could use the GPS api.
Computers could print the coordinates.
OmegaVest #3
Posted 26 July 2012 - 10:27 PM
Oh. You're trying to get it so the computer will only turn on if the coordinates are correct, I take it.

Well, yes, it is possible, but there would be ways around it. So, to get you started on this, I would suggest you take a look at the wiki, specifically the APIs section, even more specifically, the GPS and Rednet sections.

Once you have done that, this will hopefully make a little more sense. You will need to open a specific modem. Then, do a quick GPS call. (gps.locate()) If something comes through, then check the numbers to make sure they are the same. If nothing comes through, shut down the computer. Otherwise, if it has a signal, and matches, the computer runs normally.



Now, this only works if there are other computers to give it a GPS location. Those, I would hide, if you are really worried about people stealing things. Like, bury them underground (shallowly) at different heights with the normal 64-block radius of the modem.



So, that should get you started. If you have any problems writing it, and you have some code, we will gladly help.