I am trying to make a script that will log you in to a set chat channel every time you connect. Sometimes WoW will not log you into a channel if you where in it before so that I why I am working on this.
This is the first thing that I tried but you can test it out in game and see that it just does not work. It will work the first time but after that it will join the channel but you can never see text or type text in to that channel.
Code:
JoinChannelByName("testtest")
DEFAULT_CHAT_FRAME:AddMessage("You are Joining The testtest chat channel now.",1,1,1)
Next I did this but every time you would have to go into the settings of ChatTab1 and set it up to display the text in that tab.
Code:
LeaveChannelByName("testtest")
JoinChannelByName("testtest")
DEFAULT_CHAT_FRAME:AddMessage("You are Joining The testtest chat channel now.",1,1,1)
So next I tried this out...
Code:
LeaveChannelByName("testtest")
JoinChannelByName("testtest" [,nil [,ChatTab1[, 1]]])
DEFAULT_CHAT_FRAME:AddMessage("You are Joining The testtest chat channel now.",1,1,1)
But I get this error and have tried many things to get it to work.
Date: 2009-01-02 22:00:19
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\testtest\testtest v1.lua line 2:
')' expected near '['
Debug:
[C]: ?
|
Any ideas about this?