Remember that %BadUserIDs contains a list of "words", tokenized on the ! character, such as:

%BadUserIDs = pitch!clay!dirt!mud!slime!gross!horrid!yukky!realbad!worse

Obviously, the ! character cannot be used in an ident, so it's a good choice to separate them.
Code:
;  Chop off the nick!
var %userid = $gettok($fulladdress, 2, 33)
 
;  Chop off @host 
%userid = $gettok(%userid, 1, 64)
 
;  And remove any leading ~ from the userid
%userid = $remove(%userid, ~)
 
;  Find a matching token number, if present
var %N = $findtok(%BadUserIDs, %userid, 1, 33)
 
;  And finally, grab the token from %BadUserIDs
var %BadUserID = $gettok(%BadUserIDs, %N, 33)
 
;  After all that, see if %BadUserID contains anything
if %BadUserID != $null {

All of that is exactly the same as this:
Code:

;  Doing it in one fell swoop
if $gettok(%BadUserIDs, $findtok(%BadUserIDs, $remove($gettok($gettok($fulladdress,2,33),1,64),~), 1, 33), 1, 33) != $null {

$istok() returns $true or $false, perfect for a conditional statement. Either their userid is present in its full form in %BadUserIDs or it's not. There is no need to $gettok() it at all - you don't really care which one they matched. If you did, you could have the same functionality by using $findtok() to get the token number and using that inside your $gettok(). However, if $istok() matches in my original way, then you can simply use their userid to ban with. You will have the same effect.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C