this is proc join where need this raw 340 code to be add to check userip on join
Code: Select all
proc whitelist:join {nickname hostname handle channel} {
if { ![channel get $channel whitelist] } { return 0 }
global whitelist
if {![botisop $channel]} {return}
set userhost [whitelist:weirdclean "$nickname![getchanhost $nickname]"]
set iswhite 0
foreach entry [array names whitelist] {
# set reason [lrange [whitelist:clean $whitelist($entry)] 2 end]
set whitehost [whitelist:weirdclean $entry]
if {[string match -nocase $whitehost $userhost]} {
set iswhite 1
break
}
}
if {$iswhite == 0} {
putquick "MODE $channel +b [maskhost $userhost 4]"
putquick "KICK $channel $nickname :This Channel Is Restricted"
}
}
Here is other code who need 1 code in proc join to lock unlock channel for massjoin, but is lock the chanel on 1 join single, not in 5:2
need a target code to match 5 join in 2 sec
if someone can help how to make it work to match target massjoin 5:2 to set mode chan in 5 joins not at 1 join only.
here is a example how is work now the massjoin set channel mode
Code: Select all
* Joins: adeline ~nbfvbevk@BD4256E3.445C1F8F.340F9594.IP
* Bot-test sets mode: +i
* adeline was kicked by Bot-test (This Channel Is Restricted)
* Bot-test sets mode: +b *!*@*.445C1F8F.340F9594.IP
* Bot-test sets mode: -i
<@Stef> .t *!*@*.340F9594.IP
-Bot-test- Done. *!*@*.340F9594.IP added on whitelist.
* Stef sets mode: -b *!*@*.445C1F8F.340F9594.IP
* Joins: adeline (~nbfvbevk@BD4256E3.445C1F8F.340F9594.IP
* Parts: adeline (~nbfvbevk@BD4256E3.445C1F8F.340F9594.IP
Code: Select all
### Mass joins,set channel mode on joins:seconds #
set mj 5:2
## Set the Lock Modes
# Bot will change channel mode to the modes you will specify below in case the bot will detect join flood
# To Disable Mode change set it to ""
set mjmode "i"
## Set the time in seconds to Unlock Modes
# The Bot will Unlock the channel after the specified time you will set below
set unlocktime "15"
bind join - * joinflood:massjoin
proc joinflood:massjoin {nickname userhost handle channel} {
global mjmode unlocktime whitelist
if {![botisop $channel] || [matchattr $handle of]} { return 0 }
set userhost [whitelist:weirdclean "$nickname![getchanhost $nickname]"]
set iswhite 0
foreach entry [array names whitelist] {
set whitehost [whitelist:weirdclean $entry]
if {[string match -nocase $whitehost $userhost]} {
set iswhite 1
break
}
}
if {$iswhite == 0} {
putquick "MODE $channel +$mjmode"
utimer $unlocktime [list putquick "MODE $channel -$mjmode"]
}
}