;#####################################################################
;# Name: Scan Joining Users (Beta dev 2)
;# Author: Epic (epicnet@mail.ru, http://epicnet.ru)
;# Idea: Robert
;# Description: Scans for all blacklisted users who join channels, or when the bot reconnects to channels, it will scan all users on the channels.
;# Note: You must create a file "globalkickdatabase.txt" in the mIRC root folder in this format for each line: [ID: 1234];*!*@Host;Reason kick
;#####################################################################
alias -l scanjoin_set {
%sj_work = yes
%sj_who_delay = 5000
%sj_ban_time = 10800
%sj_rem_nick = MyBotName
}
on *:JOIN:#:{
if (!$read(SCANBLACKLISTONMEJOIN_CHAN.txt,ntw,$chan)) { return }
scanjoin_set
if (%sj_work == yes) {
if ($nick == $me) {
%scanjoin = on
.timerSJWHOME $+ $chan -m 1 %sj_who_delay .who $chan
}
}
else {
var %ident $ial($nick).user
var %host $ial($nick).host
scanjoin $chan $nick %ident %host
}
}
raw 352:*: if (%scanjoin == on) { scanjoin $2 $6 $3 $4 | haltdef }
raw 315:*: if (%scanjoin == on) { unset %scanjoin | haltdef }
alias -l scanjoin {
if ($me !isop $1 && !$hget(scanjoin,stop)) {
.echo -s For further actions, I need the rights of the channel operator:12 $1
.hadd -mz scanjoin stop 30
halt
}
var %chan $1
var %nick $2
var %ident $3
var %host $4
var %file = globalkickdatabase.txt
if ($read(%file,ntw,$+(*,%ident,*))) {
var %str $read(%file,$readn)
if ($chr(35) == $left(%str,1)) goto next1
tokenize 59 %str
if ($+(*,%ident,*) iswm $2) {
var %idban $1
var %reason $3
.ban $+(-u,%sj_ban_time) %chan $+($gettok($address(%nick,0),1,64),@*)
.kick %chan %nick 04([Banned] (reason: %reason $+ ) %idban $+ )
goto next2
}
: next1
}
if ($read(%file,ntw,$+(*,%host,*))) {
var %str $read(%file,$readn)
if ($chr(35) == $left(%str,1)) goto next2
tokenize 59 %str
if ($+(*,%host,*) iswm $2) {
var %idban $1
var %reason $3
.ban $+(-u,%sj_ban_time) %chan $+(*!*@,$gettok($address(%nick,0),2,64))
.kick %chan %nick 04([Banned] (reason: %reason $+ ) %idban $+ )
}
:next2
}
}