Note: This FAQ answer was written by someone else, but I do not know who.
If you know who originally wrote this, please e-mail me.

Applying these changes to the source code for your ircII client and
recompiling gives you a new ircII command: /NEWUSER. This new command
can be used as follows:

  • /NEWUSER <new_username> [new_IRCNAME]
  • <new_username> is a new username to use and is required
  • [new_IRCNAME] is a new IRCNAME string to use and is optional
  • This will disconnect you from your server and reconnect using
  • the new information given. You will rejoin all channel you
  • are currently on and keep your current nickname.

The effect is basically changing your username/IRCname on the fly.
Although you are disconnected from your server and reconnected, the
ircII client is never exited, thus keeping all your state information
and aliases intact. This is ideal for bots that wish to be really
obnoxious in ban evasion. 😉

As this is now a new command in ircII, it can be used in scripts. Be
aware that the reconnect associated with the NEWUSER command takes time,
so TIMER any commands that must immediately follow the NEWUSER. For
example… ban evasion made easy (but beware infinite reconnects when
your site is banned):

on ^474 * {
 echo *** Banned from channel $1
 if ($N == [AnnMurray]) {
 nick $randomstring
 join $1
 } {
 nick AnnMurray
 newuser $randomstring
 timer 5 join $1
 }
 }

 

Or just to be annoying… a /BE <nickname> alias that will assume a
person’s username and IRCNAME:

alias be {
 ^on ^311 * {
 ^on 311 -*
 newuser $2 $5-
 }
 whois $0
 }

 

Now… in order to add this command to your ircII client, get the latest
client source (or whatever client source you are using). Cd into the
source directory and edit the file “edit.c”. Make the following
changes:

Locate the line which reads:

extern void server();

Insert the following line after it:

static void newuser();

 

This pre-defines a new function “newuser()” that we’ll add later.

Now, locate the line which reads:

"NAMES", "NAMES", funny_stuff, 0,

Insert the following line after it:

"NEWUSER", NULL, newuser, 0,

 

This adds a new command NEWUSER to the list of valid IRCII commands, and
tells it to call our new function newuser() to perform it.

Finally, go the bottom of the file and add the following code as our new
function “newuser()”:

/*
 * newuser: the /NEWUSER command. Added by Hendrix
 * Parameters as follows:
 * /NEWUSER <new_username> [new_IRCNAME]
 * <new_username> is a new username to use and is required
 * [new_IRCNAME] is a new IRCNAME string to use and is optional
 * This will disconnect you from your server and reconnect using
 * the new information given. You will rejoin all channels you
 * are currently on and keep your current nickname.
 */
static void newuser(command, args)
char *command,
 *args;
{
 char *newuname;
 if (newuname = next_arg(args, &args))
 {
 strmcpy(username, newuname, NAME_LEN);
 if (*args)
 strmcpy(realname, args, REALNAME_LEN);
 say("Reconnecting to server...
 close_server(from_server);
 if (connect_to_server(server_list[from_server].name,
 server_list[from_server].port, primary_server) != -1)
 {
 change_server_channels(primary_server, from_server);
 set_window_server(-1, from_server, 1);
 }
 else
 say("Unable to reconnect. Use /SERVER to connect.
 }
 else
 say("You must specify a username and, optionally, an IRCNAME
}

/NEWUSER will not hid you from a CTCP query. To do that, modify ctcp.c
as shown in the following diff and set an environment variable named
CTCPFINGER with the information you would like to display when queried.

*** ctcp.old
--- ctcp.c
***************
*** 334 ****
! char c;
--- 334 ---
! char c, *fing;
***************
*** 350,354 ****
! if (pwd = getpwuid(uid))
 {
 char *tmp;
--- 350,356 ----
! if (fing = getenv("CTCPFINGER"))
! send_ctcp_reply(from, ctcp->name, fing, diff, c);
! else if (pwd = getpwuid(uid))
 {
 char *tmp;