This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Replacing $nick with ???

Old posts that have not been replied to for several years.
Locked
t
tradergt

Replacing $nick with ???

Post by tradergt »

I wrote a script to ban certain users and have one thing left I want it to do and not sure how to go about it..

I have the $nick and I create a type 2 ban. and ban the user in the bot. But I would like to add ??? for the nick.. For example... I would like to have Lamer@111.111.111.111 be ?????!*@111.111.111.111 in the bot.. How do I get the question marks the same number as the nick length???

Thanks,
Jeff
d
darko``
Op
Posts: 121
Joined: Sun Sep 08, 2002 5:33 pm
Location: Malta

Post by darko`` »

Variable $nick can be processed using regsub

regsub -all . $nick ? $maskednick

So, $nick=Lamer will become $maskednick=?????.
Ignorant and lazy people will save 30 minutes by chosing simple config file. Smart ones will save 3000 minutes of *everyone's* time by opting for complete config file.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

A quicker solution would be to use string repeat.

Code: Select all

set masked [string repeat ? [string length $nick]]
Note, the above regsub is formatted wrong, the last variable should not contain the $ at the begining.
t
tradergt

Post by tradergt »

They both worked perfectly, thanks
Locked