Thread Tools Display Modes
01-02-09, 09:04 PM   #1
herbycanopy
A Defias Bandit
Join Date: Dec 2008
Posts: 2
auto channel script...

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?

Last edited by herbycanopy : 01-02-09 at 09:07 PM.
  Reply With Quote
01-02-09, 09:13 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Take out the square brackets.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
01-03-09, 12:06 PM   #3
herbycanopy
A Defias Bandit
Join Date: Dec 2008
Posts: 2
Originally Posted by Seerah View Post
Take out the square brackets.
The first time I loaded without the square brackets it worked great, but every time after that the channel name is in the chat tab but it shows that I am not in it. Also I can not type or read text from that channel. Another thing that is odd is that if I try to leave or join that channel manually then nothing happens.

Maybe something like this but I would have to do some work to try to find the right way to code it.

Code:
GetChannelName("testtest");
   if GetChannelName=nil;
      then JoinChannelByName("testtest");
      DEFAULT_CHAT_FRAME:AddMessage("You are Joining The testtest chat channel now.",1,1,1);

   else if DEFAULT_CHAT_FRAME:AddMessage("You are Joining The testtest chat channel now.",1,1,1)

Last edited by herbycanopy : 01-03-09 at 12:14 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » auto channel script...


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