this snippet is to detect blaklisted channels to a user who are trying to join your protected channels. if it;s detected than users will be kick + ban from your channel. Pls be notice that such a script can only be effective if blacklisted channels do not set to +s, and if you have identical raw events like in group #visible already in your existing remote scripts, in order to avoid conflicting i suggest to remove the existing identical raw codes
;Black-listed channels detection addon coded by [|Red-X|] at: m_aditya@kaskus.com
on !*:join:%protchannels: {
if (%detectchannel == 1) { _whois $cid $chan $nick }
}
alias -l _whois {
.timervis off
if ($group(#visible) == on) _setvisible
%_cid = $1 | %_chan = $2
set %chan [ $+ [ $+(%_cid,%_chan) ] ] $2
whois $3
}
#visible on
raw 301:*: recho :: $2 is Away > $3- | halt
raw 311:*:{
recho ::Start /Whois $2
recho ::Nick-Name > $2
recho ::Real-Name > $6-
recho ::Address: $3 $+ @ $+ $4
var %aNc = $AClones($2)
if (!%aNc) recho ::Clones: 4(none4)
else recho ::Clones: %aNc Total: 4( $+ $numtok(%aNc,59) $+ 4)
halt
}
raw 312:*: recho ::Server > $3 | halt
raw 310:*: recho ::Helper > Yes | halt
raw 313:*: recho ::IRCop > Yes | halt
raw 309:*: recho ::Services Admin > Yes | halt
raw 307:*: recho ::Registered > Yes | halt
raw 308:*: recho ::Server Admin > Yes | halt
raw 317:*: recho ::Idle > $3 second(s) | halt
raw 319:*: recho ::Channels > $3- | halt
#visible end
#rawchannels off
raw 319:*:{
haltdef
if ($checkchan($3-) == $true) {
if ($me isop %chan [ $+ [ $+(%_cid,%_chan) ] ]) { kick %chan [ $+ [ $+(%_cid,%_chan) ] ] $2 $+(%badchan,<-,%reason) | scid %_cid mode %chan [ $+ [ $+(%_cid,%_chan) ] ] +b %badadd }
_asslog | .aline -p @Bad-Channels 12 $timestamp 12[ $+ $2 $+ 12] [ $+ %badadd $+ 12] %chan [ $+ [ $+(%_cid,%_chan) ] ] is also on %badchan 4[badchannel4] | unset %badchan %badadd %chan [ $+ [ $+(%_cid,%_chan) ] ]
goto end
}
elseif (%c_whois [ $+ [ $+($cid,$2) ] ]) { unset %c_whois* | recho ::Blacklisted-channels unable to resolve on $2 }
:end
.timervis -i 1 3 _setvisible
}
raw 301:*: { halt }
raw 312:*: { halt }
raw 311:*: { %badadd = $3 $+ @ $+ $4 | halt }
raw 313:*: { halt }
raw 317:*: { halt }
raw 318:*: { halt }
raw 307:*: { halt }
#rawchannels end
alias recho echo $color(info) -a $1-
alias AClones {
if ($ial($address($1,2),0) == 1) return
var %nc = 1, %aClones = $1
while (%nc < $ial($address($1,2),0)) {
%aClones = $addtok(%aClones,$ial($address($1,2),%nc).nick,59)
inc %nc
}
return %aClones
}
alias _setvisible { $iif($group(#visible) == on,.disable,.enable) #visible | $iif($group(#visible) == off,.enable,.disable) #rawchannels }
alias -l thisspam {
if ($hfind($1,$2, 1, n)) { %badchan = $v1 | %reason = $hget($1,$v1) | return 1 }
return 0
}
alias -l checkchan {
var %n = $numtok($1-,32)
while (%n) {
if ($thisspam(badchannels,$gettok($1-,%n,32))) { return $true }
dec %n
}
return $false
}
alias _asslog {
if ($window(@Bad-Channels)) { return }
window -elk0 @Bad-Channels Tahoma 11
aline -p @Bad-Channels ---------------------------------------------------------------------------
aline -p @Bad-Channels :: Black-Listed Channels Detection log in here...
aline -p @Bad-Channels ---------------------------------------------------------------------------
.timerasslog 1 2 window -b @Bad-Channels
}
alias -l viewchans {
_asslog
aline -p @Bad-Channels Black-Listed Channels:
var %n = $hget(badchannels,0).item, %i = 1
while (%i <= %n) {
aline -p @Bad-Channels [ $+ %i $+ ] $hget(badchannels,%i).item : $hget(badchannels,%i).data
inc %i
}
aline -p @Bad-Channels -----end------
}
alias bcsave hsave -o badchannels badchannels\badchannels.htb
on *:start: if (!$hget(badchannels)) .hmake badchannels 10 | if ($exists(badchannels\badchannels.htb)) { .hload badchannels badchannels\badchannels.htb }
on *:load:{ if ($version >= 6.16) { if (!$isdir(badchannels)) { mkdir badchannels } } | else { echo -s * This addon can only be loaded into mIRC 6.16 or greater. Please upgrade | .unload -rs $script } }
on *:exit::hfree -w *
menu menubar,channel {
$iif($active ischan,#,Channel to protect)
.$iif($istok(%protchannels,#,44),[Del],[Add]) # : $iif($istok(%protchannels,#,44),set %protchannels $remtok(%protchannels,#,1,44),set %protchannels $addtok(%protchannels,#,44)) | recho ::Protected Channels (channels which are not accepting users who also joined blacklisted channels) : $+ $replace(%protchannels,$chr(44),$chr(32))
-
&Black-Listed Channels
.Detect Channels ( $+ $iif(%detectchannel,On,Off) $+ )
..&Turn $iif(%detectchannel,Off,On):%detectchannel = $iif(%detectchannel == 1,0,1)
.-
.&Channel list
..$iif(!$hget(badchannels,0).item, $style(2)) View: viewchans
..&Add : var %chan = $$input(Type #channel name that you want to add. for i.e: #sex , e, Add Blacklisted-Channel?), %what = $input(Type Description of the channel and it's also to be your kick message for.i.e: Get out from this sex channel be4 joining our room, e, Channel description/kick-messages) | hadd -ms badchannels %chan %what | bcsave
..&Del. : var %chan = $$input(Type #channel name that you want to delete for i.e: #sex, e, Delete Blacklisted-Channel?) | hdel -s badchannels %chan | bcsave
..-
..$iif(!$hget(badchannels,0).item, $style(2)) &Clear All: hdel -sw badchannels * | bcsave
}
menu nicklist {
Whois: .enable #visible | whois $$*
Check $snick($active,1) : %c_whois [ $+ [ $+($activecid,$$1) ] ] = 1 | _whois $activecid $active $$1
}
menu @Bad-Channels {
dclick window -c @Bad-Channels
Copy: clipboard $sline($active,1)
Clear screen: dline -s 4 $+ -
-
$iif($left($gettok($sline($active,1),2,32),1) == $chr(35), del. $gettok($sline($active,1),2,32)):var %ln = $sline($active,1).ln | hdel -s badchannels $gettok($sline($active,1),2,32) | dline -s %ln $+ - $+ %ln
-
Close: .window -c $active
}
;eos
;notes : if you have identical raw events like in group #visible already in your existing remote scripts, in order to avoid conflicting i suggest to remove the existing raw codes, and if you use older version than mIRC 6.16 pls replace $v1 with $ifmatch on alias thisspam
;a script like this one will only be effective if blacklisted channel doesn't set to +s that whois raw reply on a user can show all channels currently joined.
also, is there a way for the whois of each user to not really show up on my windows? coz i have several chans protected and all those windows usually get filled up with just the whois of all the users showing up on the windows.. i really need some help, im not really that good at analyzing the script.. thanks.
[|Red-X|] Can you answer me pls ? why your code for bad channels doesn`t ban persons who are in bad channels but they have OP or VOICE ? what should i modify in there to work ? and ..... can i set a bad channel like this : #channel* ..... all channels who starts with \"channeL\" to be bad channels ?