Top

blacklisted channels detection


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  7.6 (of 5 scores)
Date Added  Aug 10, 2004
Last Updated  Sep 04, 2008

Introduction

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

Grab the Code

;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.
 
 
 

Comments

  (17)  RSS
tsunamione
Comments: 1
 
mIRC Snippet:  blacklisted channels detection
Posted on Aug 10, 2004 4:37 pm
can it be set to have +s mode off? for an open channel visable in the /list
xtr
Comments: 18
 
mIRC Snippet:  blacklisted channels detection
Posted on Aug 10, 2004 5:18 pm
xtr
Comments: 18
 
mIRC Snippet:  blacklisted channels detection
Posted on Aug 10, 2004 5:18 pm
[|Red-X|]
Comments: 54
 
mIRC Snippet:  blacklisted channels detection
Posted on Aug 10, 2004 10:32 pm
channel mode can only be change by some one who access in that channel..
Maudit
Comments: 1
 
mIRC Snippet:  blacklisted channels detection
Posted on Aug 23, 2004 12:07 am
* /hsave: unable to open 'C:\RCI\badchannels\badchannels.htb' (line 93, badchan.mrc) <- I get this error when Trying to add a new channel, and It doesn't detect the add chanenl ( and the chan isn't on +s )
[|Red-X|]
Comments: 54
 
mIRC Snippet:  blacklisted channels detection
Posted on Aug 23, 2004 1:29 am
it's happened because you have no badchannels folder already exist in mirc directory.... so i add it to automatically created when the script loaded, repaste this snippet into your editor..
brake
Comments: 6
 
mIRC Snippet:  blacklisted channels detection
Posted on Sep 3, 2004 5:24 am
very good writer...
Corne
Comments: 69
 
mIRC Snippet:  blacklisted channels detection
Posted on Nov 7, 2004 1:06 am
If a person who is operator in a bad channel and he joins in a protected channel why he is not taking ban ?
Corne
Comments: 69
 
mIRC Snippet:  blacklisted channels detection
Posted on Nov 9, 2004 10:54 pm
[|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 ?
xwindows
Comments: 5
 
mIRC Snippet:  blacklisted channels detection
Posted on Feb 4, 2005 4:48 pm
nice Work Red-X
thurdy
Comments: 5
 
mIRC Snippet:  blacklisted channels detection
Posted on Oct 20, 2006 2:33 am
this snippet is very good and very useful. but is there a way to set a bantime? because in case the user decides to leave the blacklisted channel, he will be able to join my channel when his bantime expires.
thurdy
Comments: 5
 
mIRC Snippet:  blacklisted channels detection
Posted on Oct 20, 2006 9:06 am
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.

Lanten
Comments: 9
 
mIRC Snippet:  blacklisted channels detection
Posted on Aug 14, 2007 10:51 pm
i have the same question with Corne..
Anti
Comments: 317
 
mIRC Snippet:  blacklisted channels detection
Posted on Aug 14, 2007 10:54 pm
Looking at the most BEST scripts Laten :D?
Lanten
Comments: 9
 
mIRC Snippet:  blacklisted channels detection
Posted on Aug 14, 2007 11:00 pm
basically, i don't think i am in the position to say looking 'at'.. since i am not very good in script analysis, but, looking 'for'? LOL.
thamer
Comments: 1
 
mIRC Snippet:  blacklisted channels detection
Posted on May 9, 2009 4:38 am
how do i change it from *!~dennie@187.132.44.73 to *!*@187.132.44.73 bans IP only ?
Cheiron
Comments: 627
 
mIRC Snippet:  blacklisted channels detection
Posted on May 9, 2009 6:35 am
dont echo the whois to the active window. echo it to the status window using the echo -s

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom