Jump to content
  • 0

Channel Controller


Brahms

Question


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.02
  • Content Count:  149
  • Reputation:   3
  • Joined:  07/29/16
  • Last Seen:  

Hi rathena. As the title said, i want to request a channel system controller npc where players can turn on/off channels. Thank you so much. Have a bless day everyone. 

Thanks. 

Edited by Brahms
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

Players can already join and leave channels, what would make the npc different? 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.02
  • Content Count:  149
  • Reputation:   3
  • Joined:  07/29/16
  • Last Seen:  

On 11/14/2018 at 4:44 PM, Normynator said:

Players can already join and leave channels, what would make the npc different? 

Its because everytime a player logs in, they automatically joined a channel. I just want it to be like these same in the image below where they can manage fully each channel players wanted to see announcing in there screens..

1.JPG

 

Bump! Can anyone help me with this? 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.02
  • Content Count:  149
  • Reputation:   3
  • Joined:  07/29/16
  • Last Seen:  

2 hours ago, Emistry said:

Thank You so much emistry..

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   13
  • Joined:  11/17/12
  • Last Seen:  

How could I embed it into the code so I can put the @listenbg command also, to disable Battleground messages? Just like this pic:

1.JPG

Remembering that by default the BG announcements are always shown, that is, by default BG messages are [On]. To disable the messages, you have to give the @listenbg command.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

I have a script which I haven't released because... more than 1 year without test server. I hope it works, though. Tell me how it goes. It also has commands.

-	script	Login_Config	-1,{

OnInit:

	// Names of channels to show.
	setarray .channel_name$[0],"Global","Support","Trading";
	// Channels names to join.
	setarray .channel$[0],"global","support","trade";

	// Commands.
	setarray .command$[0],"autoloot","noask","noks","showdelay","showexp","showzeny";

	bindatcmd "channels", "Login_Config::OnChannels";
	bindatcmd "loginconf","Login_Config::OnConfig";
	end;

OnChannels:

	.@n$ = "^3227cd[Channel Manager]^000000";
	mes .@n$;
	mes "Here you can change which channels you'll join when you log in.";
	mes "Remember the configuration is shared between all your characters.";
	.@size = getarraysize(.channel$);
	next;
	do {
		.@menu$ = "";
		for(.@i = 0;.@i < .@size;.@i++) {
			if(#config & (1 << .@i))
				.@menu$+= "^539c36["+.channel_name$[.@i]+"]^000000:";
			else
				.@menu$+= "^b6101b["+.channel_name$[.@i]+"]^000000:";
		}
		.@s = select("Finish.",.@menu$) - 1;
		if(.@s)
			#config^= (1 << (.@s - 1));
	} while(.@s);
	close;

OnConfig:

	.@n$ = "^3227cd[Login Manager]^000000";
	mes .@n$;
	mes "Here you can change your login config.";
	mes "Remember the configuration is shared between all your characters.";
	.@size = getarraysize(.command$);
	.@offset = getarrayzize(.channel$) - 1;
	next;
	do {
		.@menu$ = "";
		for(.@i = 0;.@i < .@size;.@i++) {
			if(#config & (1 << (.@i + .@offset + 1)))
				.@menu$+= "^539c36@"+.command$[.@i]+" "+((.command$[.@i] == "autoloot")? "("+((#rate_at)? #rate_at : 100)+"%)" : "")+".^000000:";
			else
				.@menu$+= "^b6101b@"+.command$[.@i]+".^000000:";
		}
		.@s = select("Finish.",.@menu$) - 1;
		if(.command$[.@s - 1] == "autoloot" && !(#config & (1 << (.@s + .@offset)))) {
			input .@n;
			if(.@n && .@n < 100)
				#rate_at = .@n;
			else if(!.@n)
				continue;
		} else if(.command$[.@s - 1] == "autoloot") {
			#rate_at = 0;
		}
		if(.@s)
			#config^= (1 << (.@s + .@offset));
	} while(.@s);
	close;

OnPCLoginEvent:

	if(#config) {
		.@size1 = getarraysize(.channel$);
		.@size2 = getarraysize(.command$) + .@size1;
		for(;.@i < .@size2;.@i++) {
			if(#config & (1 << .@i)) {
				if(.@i < .@size1)
					atcommand "@join #"+.channel$[.@i];
				else
					atcommand "@"+.command$[.@i - .@size1]+" "+((.command$[.@i - .@size1] == "autoloot" && #rate_at)? #rate_at+"" : "");
			}
		}
	}
	end;

}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.01
  • Content Count:  66
  • Reputation:   10
  • Joined:  11/15/17
  • Last Seen:  

On 1/8/2019 at 1:05 AM, n0tttt said:

I have a script which I haven't released because... more than 1 year without test server. I hope it works, though. Tell me how it goes. It also has commands.


-	script	Login_Config	-1,{

OnInit:

	// Names of channels to show.
	setarray .channel_name$[0],"Global","Support","Trading";
	// Channels names to join.
	setarray .channel$[0],"global","support","trade";

	// Commands.
	setarray .command$[0],"autoloot","noask","noks","showdelay","showexp","showzeny";

	bindatcmd "channels", "Login_Config::OnChannels";
	bindatcmd "loginconf","Login_Config::OnConfig";
	end;

OnChannels:

	.@n$ = "^3227cd[Channel Manager]^000000";
	mes .@n$;
	mes "Here you can change which channels you'll join when you log in.";
	mes "Remember the configuration is shared between all your characters.";
	.@size = getarraysize(.channel$);
	next;
	do {
		.@menu$ = "";
		for(.@i = 0;.@i < .@size;.@i++) {
			if(#config & (1 << .@i))
				.@menu$+= "^539c36["+.channel_name$[.@i]+"]^000000:";
			else
				.@menu$+= "^b6101b["+.channel_name$[.@i]+"]^000000:";
		}
		.@s = select("Finish.",.@menu$) - 1;
		if(.@s)
			#config^= (1 << (.@s - 1));
	} while(.@s);
	close;

OnConfig:

	.@n$ = "^3227cd[Login Manager]^000000";
	mes .@n$;
	mes "Here you can change your login config.";
	mes "Remember the configuration is shared between all your characters.";
	.@size = getarraysize(.command$);
	.@offset = getarrayzize(.channel$) - 1;
	next;
	do {
		.@menu$ = "";
		for(.@i = 0;.@i < .@size;.@i++) {
			if(#config & (1 << (.@i + .@offset + 1)))
				.@menu$+= "^539c36@"+.command$[.@i]+" "+((.command$[.@i] == "autoloot")? "("+((#rate_at)? #rate_at : 100)+"%)" : "")+".^000000:";
			else
				.@menu$+= "^b6101b@"+.command$[.@i]+".^000000:";
		}
		.@s = select("Finish.",.@menu$) - 1;
		if(.command$[.@s - 1] == "autoloot" && !(#config & (1 << (.@s + .@offset)))) {
			input .@n;
			if(.@n && .@n < 100)
				#rate_at = .@n;
			else if(!.@n)
				continue;
		} else if(.command$[.@s - 1] == "autoloot") {
			#rate_at = 0;
		}
		if(.@s)
			#config^= (1 << (.@s + .@offset));
	} while(.@s);
	close;

OnPCLoginEvent:

	if(#config) {
		.@size1 = getarraysize(.channel$);
		.@size2 = getarraysize(.command$) + .@size1;
		for(;.@i < .@size2;.@i++) {
			if(#config & (1 << .@i)) {
				if(.@i < .@size1)
					atcommand "@join #"+.channel$[.@i];
				else
					atcommand "@"+.command$[.@i - .@size1]+" "+((.command$[.@i - .@size1] == "autoloot" && #rate_at)? #rate_at+"" : "");
			}
		}
	}
	end;

}

your version gives errors.

grafik.png.e80162d250104a2658aa52ae087fe067.png

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  547
  • Reputation:   270
  • Joined:  11/08/11
  • Last Seen:  

There is no getarrayZize - it is called getarraySize

  • Upvote 1
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...