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;
}