SetSelectedBattlefield / GetSelectedBattlefield maybe not sure. Im gonna sleep now it's 4 in the morning here
SetSelectedBattlefield / GetSelectedBattlefield maybe not sure. Im gonna sleep now it's 4 in the morning here
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
Didn't they add the possiblity to join a battleground from everywhere? What about looking up the functions used by them?
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
It's in the pvp frame (see Warcraft: Legends - Dan Jolley - WoW.com ).
Might be worth looking at the LUA/frame xml
Its already been implemented. Also you may be able to select(API JoinBattlefield - WoWWiki - Your guide to the World of Warcraft). I can't test it, my highest level character on a test account is 14
JoinBattlefield works fine for me on a fresh login. :S
Ok, so Blizzards UI doe this:
When you choose your Battlground type,
RequestBattlegroundInstanceInfo(BGindex)
is called. (id is probably like 0=wsg, 1=ab, 2=ab ... but i cant confirm these yet).
EDIT
names can be got with
localizedName, canEnter, isHoliday, minlevel = GetBattlegroundInfo(BGindex);
END EDIT
Then the isntance list is populated when an event is recieved.
Then the usual
JoinBattlefield(instance);
is done. So
RequestBattlegroundInstanceInfo(battlegroundid);
Sleep(100);
JoinBattlefield(0);
should queue you for your selected BG.
Source of PVPBattlegroundFrame.lua:
FrameXML/PVPBattlegroundFrame.lua at 3191e048d861341b042320f18b0d1853c0bc95a5 from tekkub's wow-ui-source - GitHub
Please give rep if this helps. Been contributing for ages n still a "site n00b"
Last edited by testout; 06-04-2009 at 07:56 AM.
Has any of you guys been able to run a piece of code like this with DoString and get the result with GetLocalizedText?
Whenever I query the found variable I get an empty string, no matter if it finds or not what I'm looking for. :-PCode:found = false for bag = 0,4 do for slot = 1,GetContainerNumSlots(bag) do item = GetContainerItemLink(bag,slot) if item and item:find(""{0}"") then found = true end end end
I know for certain that my found variable becomes true at some point because if I put something like a DoEmote("dance") in there I'll see it acting. So I guess the script runs fine but I can't seem to be able to read that global variable :-P
Why are you using getlocalized text? :S
Not only are you polluting the global scope by creating non-local named variables (which in turn could lead to UI taint), theres a much better alternative already documented which is to register a callback and pass all your LUA calls through it. Your callback then grabs all the return values off the LUA stack and passes them back to your module.
Faster and safer.
I've been using global variables because GetLocalizedText can return only global variables. I don't like it either but I didn't know there was any alternative without having to redo all the LUA functions and have my own stack management for it.
To be honest I've never heard of being able to register a callback to route all the LUA calls. Time to do some research then