Easy macro for getting your coordinates
Here's an awesome tip from amib over on WoW LJ. Sometimes, we all could use a little location check from time to time. While I usually am OK with finding quest coordinates, every once in a while, I'd just kind of like to know where I am. So here's amib's tip-- a macro that will easily and simply tell you (no addons required) where you are in game./script px,py=GetPlayerMapPosition("player")
/script DEFAULT_CHAT_FRAME:
AddMessage(format("( %s ) %i,%i",
GetZoneText(),px *100,py *100));
(As commenters have noted, the formatting is weird here on the blog-- it's meant to be two lines, both starting with script. The other line breaks will need to be taken out.)
Just put that on a button, call it "Where am I?" or something like that, and then click it to get your current ingame coordinates in the chat channel. Considering how poor my addon-updating abilities are, that's perfect.
Of course, there are lots and lots of addons floating around that will do this even better-- showing your coordinates and cursor coordinates in the window, and all kinds of other ways. But if you only use coordinates every once in a while, and never remember to update your addons, this little macro could be pretty useful to have.
Filed under: Analysis / Opinion, How-tos, Odds and ends, Add-Ons






Reader Comments (Page 1 of 1)
Chris Anthony Oct 25th 2007 7:47PM
This post's screenshot clearly shows WoWInsider's Horde bias.
(Just kidding, Mike! And - much belated - I'm sorry for going off on you in my comment on your roleplaying post earlier this week; it's been a rough week, and I was harsher than I should have been.)
This is a great tip. I downloaded Titan Panel specifically to get the coordinates function; if I'd known about this, I wouldn't have needed to!
I wonder if there's a way to get a WoW macro to write text to the clipboard; it'd be great if this macro also let you paste the coordinates into chat. (Granted that at this point I'm just being greedy and/or lazy. ;)
-Chris A.
http://www.etherjammer.com/blog/
klink-o Oct 25th 2007 7:48PM
First macro I ever made back in the day. Great when your questing.
skoh.fley Oct 25th 2007 9:23PM
I'm not one bit a macro expert, but does
/script px,py=GetPlayerMapPosition("player")
mean that you can get the position of other things beside "player"?
Enaress Oct 25th 2007 10:21PM
I thought /script macros were removed a long time ago. I might be wrong...
A Man In Black Oct 25th 2007 10:37PM
Woo! I'm famous on teh intarwebs!
/script macros are now very heavily restricted, but you can still use them. They're just limited to giving you messages in your chat window, or speaking in chat channels, or doing other very limited things.
I didn't write this macro, but I can't remember where I got it. Probably WOWWiki (www.wowwiki.com) somewhere.
Chris Anthony Oct 25th 2007 11:22PM
@3: GetPlayerMapPosition works with "player", "partyN", or "raidN", where N is a number from 1-4 for "party" or 1-40 for "raid". It doesn't work for anything else - including pets.
Because of the way Unit IDs work, you can also use a party member's name - which means that you might be able to do something like
/script px,py=GetPlayerMapPosition(UnitName("target"));
as long as you had a party member targeted. Unfortunately, this is going to cause trouble with the output, since I can't find a way to display the target's zone name - but some more intrepid modster might be able to.
@4: /script was disabled for many commands, but not all of them.
Hone Melgren Oct 26th 2007 12:42AM
Yep ..takes any unitid apparently
http://www.wowwiki.com/API_GetPlayerMapPosition
http://www.wowwiki.com/UnitId
Prauche Oct 26th 2007 10:09AM
Miiiiike.... /sigh. With the use of Wow UI Updater (WUU) and Ace Updater, it's SOOO easy to update addons now. Just run each once or twice a week and you're done.
Jovany Jan 13th 2008 4:47AM
I cant get my macro to work i printed the macro and copied it as written but i just cant get it to work.