12 posts
Location
A place
Posted 18 June 2015 - 08:46 PM
More JARVIS fun. I want my JARVIS AI to send a message when I die and tell me where I was. Is it possible to get the coordinates of a player through ComputerCraft or another mod that interfaces with ComputerCraft?
1426 posts
Location
Does anyone put something serious here?
Posted 18 June 2015 - 08:58 PM
It depends. You can use pocket computers and a GPS relay to track your position, a smaller range alternative would be to use OpenCCSensors' player sensor to track the position.
355 posts
Location
Germany
Posted 18 June 2015 - 09:24 PM
#CommandComputer
12 posts
Location
A place
Posted 18 June 2015 - 10:41 PM
I've never used any of those suggestions. Could I get a summary of how I would have to use each one and/or your personal preference?
957 posts
Location
Web Development
Posted 19 June 2015 - 12:54 AM
Well, for a command computer, you can use this function:
function getPlayerPos(name)
local state,result = commands.exec("/tp "..name.." ~ ~ ~")
if not state then return false end
return result[1]:match( "Teleported %S+ to (%d+%.?%d*),(%d+%.?%d*),(%d+%.?%d*)" )
end
It just takes advantage of the fact that running '/tp' says in chat 'teleported <player> to <location>'
3057 posts
Location
United States of America
Posted 19 June 2015 - 01:37 AM
One thing to keep in mind when using HPWebcamAble's suggestion, the player will notice themselves being teleported - especially if you do it rapidly. It's fine if you get their position once per second, but higher than that is annoying.