AutomaticCoding
New Member
- Joined
- Dec 20, 2011
- Messages
- 1,091
- Reaction score
- 1
Need it to use the Battle.net API, yet, can't find a way.
I don't understand the question? You are checking what region a predefined character/realm is on?
I need to get the current user's realm, considering I'm making a AH bot (like a full bot, that requires it's own bot base) and I need to know what realm to get the AH data from...
Currently got:
string bnetReturn = client.DownloadString(String.Format("http://eu.battle.net/api/wow/auction/data/{0}/", Lua.GetReturnVal<string>("GetRealmName();", 0)));
But as you can guess, that just returns a realm name like "123", not the EU or US realm. Currently only supports EU ("http://EU").
API GetLocale - WoWWiki - Your guide to the World of Warcraft
This checks for the locale of the client, not for the realm, but hopefully should work for you anyway.![]()
Not much help, considering I'm running EU and when I typed this into chat:
/run DEFAULT_CHAT_FRAME:AddMessage(tostring(GetLocale()));
it threw back at me: "enUS"...
That's just the language, and by default, everyone runs enUS, even enGB people.
It works for every locale with the exception of enGB/enUS. There's no real way to query what region a server is in because server names are shared between regions. Your best bet is to have the user enter their region manually, or if you insist on automation, use GetLocale to find out the client locale and if the client is Russian, Chinese, etc., you can make an educated guess about the server's region.
var locale = Lua.GetReturnVal("return GetCVar('locale')", 0);






