Thread Tools Display Modes
08-05-05, 09:58 AM   #1
Savant
A Defias Bandit
Join Date: Aug 2005
Posts: 2
Chat Mod (automatically join chats on startup)

Hi there,

i made a (very) little script that should join an ally-chat channel right after firing up the game. So far the thingie works, _but_ only after i did a /console reloadui after restart.

Heres the code in the LUA file which is startet at loadup (usual xml/toc-file construction):

Code:
function Join_Chat()

JoinChannelByName("AllyChat")
ChatFrame_AddChannel(ChatFrame1, "AllyChat")

end
Like i said, when i trigger /console reloadui after startup it works like a charm. But it will not join the channel right after logging in. What could be wrong??
  Reply With Quote
08-05-05, 11:42 AM   #2
Littlejohn
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 90
Your code probably runs before the client knows the available channels (or some other sort of race condition between the client and server).

Have you tried registering an event and then subscribing to the channel in an event handler? PLAYER_ENTERING_WORLD world is probably a good event to respond to.
  Reply With Quote
08-06-05, 02:07 AM   #3
Savant
A Defias Bandit
Join Date: Aug 2005
Posts: 2
This sounds good, and it might also be the right solution, because it really looks like this could be the cause. This is my very, very first try to do a "mod" so i'm not sure how to do that, but theres some addons on my HD where i'm sure i can take a look at to see how event triggers work =) Thx for the help so far.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Chat Mod (automatically join chats on startup)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off