WeeChat – Random nickname

WeeChat - Random nickname

So you want to change your nickname to a random one? If I’m right, there is no script available for this purpose. When there is no script available for something you can either write one or use the perlexec.pl script. In this post, I use the latter written by ArZa. Let’s start!

Install the script

/script install perlexec.pl

Use this one liner

/perlexec weechat::command('',"/nick a" . join'', map +(0..9,'a'..'z','A'..'Z')[rand(10+26*2)], 1..8)

Create an alias

/alias rnick /perlexec weechat::command('',"/nick a" . join'', map +(0..9,'a'..'z','A'..'Z')[rand(10+26*2)], 1..8)

Bind it to a key

/key bind ctrl-V /perlexec weechat::command('',"/nick a" . join'', map +(0..9,'a'..'z','A'..'Z')[rand(10+26*2)], 1..8)

It would change your nick to a random one containing 9 alphanumeric character. However, do not remove the letter at start cause it must begin with a letter to be a valid nickname.

I found the perl code here on stackoverflow. Also a special thanks to nils_2.

That’s it. Enjoy!

Leave a Reply