Ident Based kick/ban upon joining

Platform:  mIRC
Published  Nov 22, 2009
Updated  Nov 22, 2009
The script compares the user's ident on joining, and checks that user's ident against other idents determined by the script. If the ident is flagged as "bad" the user is kicked and there is a ban placed on that user's ident. Other "bad idents" can be added, simply use the same format under the BadIdentCheck alias, where "Guest" is the bad ident. alias GetIdent {
var %nick-ident = $remove($gettok($address($1,3),1,$asc(@)),*!*)
return %nick-ident
}
alias BadIdentCheck {
if ($1 == badident) {
return $true
}
elseif ($1 == Guest) {
return $true
}
else {
return $false
}
}
ON 1:JOIN:#: {
if ($nick != $me) && ($me isop $chan) {
if ($BadIdentCheck($GetIdent($nick)) == $true) {
kick # $nick bad ident
mode # +b $+(*!,$GetIdent($nick),@*)
}
}
}

Comments

Sign in to comment.
gooshie   -  May 12, 2012
Jokabua
If you only need like a handfull do as Yawhatever explained.
If you needed like 20 or so then I would change the
line: if $istok(badident Guest,%ident,32) {
to: if $istok(%badident,%ident,32) {
then: /set %badident badident1 badindent2 etc3 etc4
Also, at this point I would add some simple scripting to
make these changes easier/quicker.

If it became necessary to have say 50 or more badidents
then I would think about storing them into a text or ini file
and maybe loading them into hash for quicker response.
 Respond  
Yawhatnever   -  May 10, 2012
@JoKabua
using gooshie's code you would add idents inside $istok(), separated by spaces

using the original code you would need to add additional "elseif ($1 == ident) { return $true }" inside the BadIdentCheck alias.
 Respond  
JoKabua   -  May 10, 2012
I like this but where should i add bad indet address at?
 Respond  
p0tat3rs   -  Nov 28, 2009
The idea of the aliases was if the user intended to add multiple "bad idents", also it simplifies the code a bit and makes it look cleaner rather than having multiple nestled function calls.
 Respond  
Master-Of-Death   -  Nov 23, 2009
brilliant, gooshie ur a legend.
 Respond  
Jethro   -  Nov 22, 2009
Lmao...all the aliases for nothing...lol Nice one, gooshie.
 Respond  
gooshie   -  Nov 22, 2009

Code

 
 Respond  
p0tat3rs   -  Nov 22, 2009
meh, syntax :P
 Respond  
Jethro   -  Nov 22, 2009
p0tat3rs, you can save yourself an if statement for your join event:

Code

 
The @ by the join event will take care of $nick != $me and $me isop $chan
 Respond  
Cracker200   -  Nov 22, 2009
Awesome Wog :D
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.