What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

Check if on a EU, US, RUS or Asian realm?

I don't understand the question? You are checking what region a predefined character/realm is on?
 
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").
 
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.
 
Last edited:
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.

GetLocale returns the in-game data like quests spells etc. (Colour vs Color)
So enGB returns enUS since we use enUS Lua locale.


Guess this is a better alternative
PHP:
var locale = Lua.GetReturnVal("return GetCVar('locale')", 0);
 
Back
Top