Jump to content
  • 0

Auto join channel


Talaysen

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

With the new channel system, how does one go about making it to where users automatically join a particular channel on login? I'm thinking it'd be nice if people automatically joined the #main, #support, and #trade channels.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Both would involve setting and checking a variable upon executing your commands.

 

-If the user leaves the channel, they will not automatically rejoin again, they have to manually rejoin each time.

You can set a bit variable via source upon executing "@channel leave <>", or bind the atcommand to a script and set the variable that way.

 

or -an @command that will disable autojoining channels for that user.

Much easier. Bind an atcommand that sets the variable.

-	script	#chan_control	-1,{
OnInit:
	bindatcmd("channeljoin",strnpcinfo(0)+"::OnChannelJoin");
	end;
OnChannelJoin:
	set channel_join_off, !channel_join_off;
	message strcharinfo(0),"Channel auto-join is now "+((channel_join_off)?"disabled":"enabled")+".";
	end;
OnPCLoginEvent:
	if (!channel_join_off) {
		atcommand "@join #main";
		atcommand "@join #support";
		atcommand "@join #trade";
	}
	end;
}
  • Upvote 2
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

-	script	autojoin	-,{

OnPCLoginEvent:
	atcommand "@join #main";
	atcommand "@join #support";
	atcommand "@join #trade";
end;
}

I'm currently using the above code.

How can I make it to where either:

 

Could anyone point me in the direction of either:

-If the user leaves the channel, they will not automatically rejoin again, they have to manually rejoin each time.

or -an @command that will disable autojoining channels for that user.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  


- script autojoin -,{

OnPCLoginEvent:

atcommand strcharinfo(0) + "join #main";

atcommand strcharinfo(0) + "join #support";

atcommand strcharinfo(0) + "join #trade";

end;

}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

Thanks Anakid! :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

That worked perfectly. Does exactly what it says on the tin.

Thanks so much! ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...