# version:1.0 loader:pf # $Id: newnick.dsm,v 2.2 2010/01/22 19:44:49 brian Exp $ # Copyright (c) 2005 EPIC Software Labs # Written by BlackJac@EFNet # # Version: 1.0.2005.05.16.1 # # This script simulates the automatic nickname-mangling feature of epic4 for # epic5. # # Settings: # set auto_new_nick [on|off|toggle] # Enables or disables automatic nickname-mangling. If this is # on and your current nickname is already in use, it will at- # tempt to use the nicknames listed in auto_new_nick_list (if # specified) first, then try to append auto_new_nick_char to # the nickname, and finally try to "mangle" your nickname by # moving the last character to the front. # set auto_new_nick_char [] # Character to append to your current nickname if it is al- # ready in use and you are either not using auto_new_nick_list # or you are already at the end of the list. # set auto_new_nick_length [] # Maximum nickname length assumed for the network you are on. # set auto_new_nick_list [] # List of nicknames to try (in order) if your current nickname # is already in use. Leave a space between each nickname. # I will likely uncomment this once I begin using /package elsewhere in ds. -bmw #package newnick; queue cleanup.newnick { ^on new_nickname -"*"; delset auto_new_nick; delset auto_new_nick_char; delset auto_new_nick_length; delset auto_new_nick_list; }; alias newnick.mangle (nick, void) { @ :length = getset(auto_new_nick_length); return ${@nick < length ? nick ## getset(auto_new_nick_char) : right(1 $nick) ## mid(0 ${length - 1} $nick)}; }; ^on ^new_nickname "*" { if (getset(auto_new_nick) == [on]) { if (:nicklist = getset(auto_new_nick_list)) { if (!(:nick = word(${findw($2 $nicklist) + 1} $nicklist))) { @ :nick = newnick.mangle($2); }; } else { @ :nick = newnick.mangle($2); }; xeval -s $0 nick $nick; } else { input "Nickname: " { nick $0; }; }; }; addset auto_new_nick bool; set auto_new_nick on; addset auto_new_nick_char char; set auto_new_nick_char _; addset auto_new_nick_length int; set auto_new_nick_length 9; addset auto_new_nick_list str;