This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Problem in banchan3.4.tcl

Support & discussion of released scripts, and announcements of new releases.
Post Reply
c
calippo
Voice
Posts: 13
Joined: Mon Jan 19, 2009 3:53 pm

Problem in banchan3.4.tcl

Post by calippo »

hello everyone I have a problem; this tcl not recognize the channels like this: "#abbassa_il-perizoma_e-dammela:*tis*" thanks for any help

Code: Select all

#####################################################
# BanChan 3.4 TCL
#
#  This script is based on ChanBan, but it is not really a new version of it.  After having used ChanBan2.2b.tcl for a few
#  months, it started to really piss me off.  It had a weird timing bug that would start banning/kicking the wrong users.
#  I finally set out to squish the bug, and stared in wide-eye'd amazment at the mess of code.  I started trying to patch
#  it, but it was hopeless.  I started from stratch, and what we have here is a nice clean script.
#####################################################
# v3.0 - Clown-Man, fresh script
# v3.1 - Fixed bug where people with "{" or "}" in their nicks threw off the list functions!
# v3.2 - Fixed a bug where ANY chan the bot joined it would scan nicks!
# v3.3 - Fixed the multiple timer bug (after .rehash)
# v3.4 - Added a different banmask (*!*@host)
# Comments, Suggestions, Bug reports? ClownMan@cgocable.net
#####################################################
# Script by Clown-Man ClownMan@cgocable.net EFnet ( #Cracks #FreeISO #WarezCREW #Faith2000 )
#
# Big thanks goes out to H3llSp4wn for being such an awesome scripter who is willing to let me bug him all day for help :-P
######################################################
# TODO:
#  1) Maybe make a way to warn ppl b4 they get banned like in the old versions (this caused timeing errors b4 ....)
#  2) Add checking for all chans
#  3) A kick b4 the ban so chan ppl can see what's happening
#####################################################
# Options:

# Set the channels you want to check users on
# include the "#" and seperate them by a space.  EG set checkchans "#chan1 #chan3 #otherchan"
set checkchans "#mychan"

# Words of channels that will be banned, seperated by a space.  If you put set badchans "badc list" 
# the channels that would # be banned are #badchan #chanbadc #listchan #chanthatlists etc ......
set badchans "#abbassa_il-perizoma_e-dammela:*tis*"
# Minutes between each full check of a channel.  NOTE - do not set this low if you have a lot of people! 
# This is a huge load on the server/bot so don't be an idiot and check every 1 min on a chan with 100 people.  
# The bot will lag out (or get k-lined)
set intervalcheck 10

# Length of ban for being on the wrong chan (in minutes)
set idiotbantime 1

# The reason listed on the banlist.  This is also used when the bot msgs them saying how long they were banned for and why.
set banmsg "You are not allowed to be in any list channels while in #WarezCREW"

#####################################################
# END OF OPTIONS
# Do not edit anything below here unless you are making a version change!
#####################################################

bind JOIN - * banchan:join
bind RAW - 319 banchan:response
bind RAW - 353 banchan:names

if {[string match "*banchan:scan*" [timers]] == 0} {
  timer $intervalcheck banchan:scan
}

proc banchan:names {from keyword nicklist} {
  global checkchans
  set nicklist [banchan:charfilter $nicklist]
  set nicklist [lrange $nicklist 3 end]
  set chanfrom ""
  append chanfrom "*" [lindex $nicklist 2] "*"
  set chanfrom [string tolower $chanfrom]
  if {[string match $chanfrom $checkchans]} {
    return 1
  }
  set currnicknum 0
  set currentnick "b4"
  while {$currentnick != ""} {
    set currentnick [lindex $nicklist $currnicknum]
    if {[string range $currentnick 0 0] == "@" || [string range $currentnick 0 0] == "+" || [string range $currentnick 0 0] == ":"} {
      set currentnick [string range $currentnick 1 end]
    }
    if {[string range $currentnick 0 0] == "@" || [string range $currentnick 0 0] == "+" || [string range $currentnick 0 0] == ":"} {
      set currentnick [string range $currentnick 1 end]
    }
    putserv "WHOIS $currentnick"
    incr currnicknum
  }
}

proc banchan:scan { } {
  global checkchans intervalcheck
  set tocheck [string tolower $checkchans]
  set ccnum 0
  set total [llength $tocheck]
  while {$ccnum < $total} {
    putlog "BanChan: Scanning [lindex $tocheck $ccnum]"
    putserv "NAMES [lindex $tocheck $ccnum]"
    incr ccnum
  }
  if {[string match "*banchan:scan*" [timers]] == 0} {
    timer $intervalcheck banchan:scan
  }
}

proc banchan:join {nick uhost handle channel} {
  global checkchans
  set checkchans [string tolower $checkchans]
  set channel [string tolower $channel]
  set matchpattern "*$channel*"
  if {[string match $matchpattern $checkchans] == 1} {
    putserv "WHOIS $nick"
    return 0
  } else {
    return 0
  }
}

proc banchan:response {from keyword arg} {
  global badchans banmsg idiotbantime checkchans
  set badchans [string tolower $badchans]
  set badchans [concat $badchans]
  set arg [banchan:charfilter $arg]
  set currentchannel "empty"
  set chanlistnum 2
  set nick [lindex $arg 1]
  set matchpattern ""
  while {$currentchannel != ""} {
    set currentchannel [lindex $arg $chanlistnum]
    set currentchannel [string tolower $currentchannel]
    if {$currentchannel == ""} {
      break
    }
    if {$chanlistnum == 2} {
      set currentchannel [string range $currentchannel 1 end]
    }
    if {[string range $currentchannel 0 0] == "@" || [string range $currentchannel 0 0] == "+"} {
      set currentchannel [string range $currentchannel 1 end]
    }
    set currentbannum 0
    while {[llength $badchans] > $currentbannum} {
      set matchpattern "*[lindex $badchans $currentbannum]*"
      if {[string match $matchpattern $currentchannel]} {
        set uhost [getchanhost $nick]
        if {$uhost == ""} {
           return 0
        }
        set tempi [expr [string first @ $uhost] + 1]
        set uhost "*!*@[string range $uhost $tempi end]"
        set chantomsglist [string tolower $checkchans]
        set chantomsgnum 0
        while {$chantomsgnum < [llength $chantomsglist]} {
          set currentchantomsg [lindex $chantomsglist $chantomsgnum]
          if {[onchan $nick $currentchantomsg] == 1} {
            putserv "PRIVMSG $currentchantomsg :$nick is being banned for being on $currentchannel"
          }
          incr chantomsgnum
        }
        utimer 5 [banchan:delayedban $uhost]
        putserv "PRIVMSG $nick :You have been banned for $idiotbantime minutes, because you were in a forbiddon channel ($currentchannel). Please part that channel and return when your ban time is up!"
        return 0
      }
      incr currentbannum
    }
    incr chanlistnum
  }
  return 0
}

proc banchan:delayedban { banhost } {
  global banmsg idiotbantime
  newban $banhost "BanChan3.2" "$banmsg" $idiotbantime
}

proc banchan:charfilter {x {y ""}} { 
 for {set i 0} {$i < [string length $x]} {incr i} { 
  switch -- [string index $x $i] { 
  "\"" {append y "\\\""}
  "\\" {append y "\\\\"}
  "\[" {append y "\\\["}
  "\]" {append y "\\\]"}
  "\{" {append y "\\\{"}
  "\}" {append y "\\\}"}
  default {append y [string index $x $i]} 
  } 
 } 
 return $y 
}

putlog "BanChan 3.4 By Clown-Man Loaded"
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

You should check the settings
# Words of channels that will be banned, seperated by a space. If you put set badchans "badc list"
# the channels that would # be banned are #badchan #chanbadc #listchan #chanthatlists etc ......
set badchans "#abbassa_il-perizoma_e-dammela:*tis*"
My example for this would be:

Code: Select all

set badchans "*tis* *e-dammela* *abbassa* *il-perizoma*"
This would ban any channels with the following words: tis, e-dammela, abbassa and il-perizoma in there names. (probably dont need the * btw)
c
calippo
Voice
Posts: 13
Joined: Mon Jan 19, 2009 3:53 pm

Post by calippo »

TCL_no_TK wrote:You should check the settings
# Words of channels that will be banned, seperated by a space. If you put set badchans "badc list"
# the channels that would # be banned are #badchan #chanbadc #listchan #chanthatlists etc ......
set badchans "#abbassa_il-perizoma_e-dammela:*tis*"
My example for this would be:

Code: Select all

set badchans "*tis* *e-dammela* *abbassa* *il-perizoma*"
This would ban any channels with the following words: tis, e-dammela, abbassa and il-perizoma in there names. (probably dont need the * btw)
no it doesn't work thanks for your help
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

I'd contact the writter of the script and ask him to fix it, simple cos thats the polite thing to do in this case. There's a few scripts in TCL Archive http://www.egghelp.org/tclhtml/3478-4-0 ... hannel.htm you could also try out. I can recommend a good one :P
c
calippo
Voice
Posts: 13
Joined: Mon Jan 19, 2009 3:53 pm

Post by calippo »

TCL_no_TK wrote:I'd contact the writter of the script and ask him to fix it, simple cos thats the polite thing to do in this case. There's a few scripts in TCL Archive http://www.egghelp.org/tclhtml/3478-4-0 ... hannel.htm you could also try out. I can recommend a good one :P
can you recommend a good one please? thank u very much
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Sure. MC_8's Ban Channel is the one i've used for a long time without any problems. Dont know if its in TCL Archive, but the url above will take u there.
c
calippo
Voice
Posts: 13
Joined: Mon Jan 19, 2009 3:53 pm

Post by calippo »

TCL_no_TK wrote:Sure. MC_8's Ban Channel is the one i've used for a long time without any problems. Dont know if its in TCL Archive, but the url above will take u there.
thank you very much could you give me a hand to set up this script i'm not practical to set the script thank you very much
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

The important thing to remenber is that once the script is set up and loaded in to eggdrop. You add, remove and list the "bad" channels from eggdrop's part line. So you dont need to edit them in script everytime you want to ban a channel.

Code: Select all

# What flagged users are able to utilize the 'ban_channels' DCC command?  Set
# this to "-|-" to allow anyone to access the command (provided they can DCC
# chat the bot).
set mc_banc(:config:access:ban_channels) "-|-"

# What flagged users are able to utilize the '+ban_channel' DCC command?  Set
# this to "-|-" to allow anyone to access the command (provided they can DCC
# chat the bot).
set mc_banc(:config:access:+ban_channel) "m|m"

# What flagged users are able to utilize the '-ban_channel' DCC command?  Set
# this to "-|-" to allow anyone to access the command (provided they can DCC
# chat the bot).
set mc_banc(:config:access:-ban_channel) "m|m"
The above is the first part of the configuration. If you not fussy its ok the leave them as they are. otherwise choise the flags you want to limit the access to, by default the above only allows Masters (users with the +m flag) to add and remove bad channels.

The next part Allows us to configure what happens when the bot finds someone in a "bad" channel. The syntax is alot like mIRC commands in my opinion so its easyer *least for me* :P

I found reading the default helps to understand what this part is about and helps when deciding what i wanted mine to do.

Code: Select all

# Warning command set:
set mc_banc(:config:warning_command_set) {
  /putlog Ban Channel: Found %nick%@%channel% in %banned_channel%, warning.

  /rescan 60
  /putlog_d Ban Channel: Re scanning %nick% in 60 seconds.

  /msg %nick% You have 1 min. to leave %banned_channel%.
  /putlog_d Ban Channel: [Msg %nick%] You have 1 min. to leave %banned_channel%.

  /msg %nick% Non cooperation will result in a ban.
  /putlog_d Ban Channel: [Msg %nick%] Non cooperation will result in a ban.
}

# Excessive warnings command set:
set mc_banc(:config:excessive_warnings_command_set) {
  /putlog Ban Channel: Found %nick%@%channel% in %banned_channel%, kick/banning.

  /ban %channel% %5 *3 %reason%
  /putlog_d Ban Channel: Banned %nick% on %channel% for 5 minutes.

  /kick %channel% %reason%
  /putlog_d Ban Channel: Kicked %nick% from %channel%.

  /msg %nick% You were warned to leave %banned_channel%.
  /putlog_d Ban Channel: [Msg %nick%] You were warned to leave %banned_channel%.

  /set_warning 0
  /putlog_d Ban Channel: Reset warnings for %nick% on %channel%
  /putlog_d Ban Channel: regarding %banned_channel%.
}
The Commands Are

Code: Select all

# If a user is found in a banned channel, this script can do two command sets.
# The first one is the warning command set, and the second one is the excessive
# warnings command set. If the user still has a warning left, warning command
# set is done, otherwise excessive warnings command set is done. The number of
# warnings are set in via dcc chanset command, see the Commands section (above).
# Separate each command with a new line.
# Valid commands are:
#   /msg <nick|channel> <text>
#   /notice <nick|channel> <text>
#   /ban <channel> [%<time>] [*<banmask_type>] [reason]
#     time:
#       If time is specified;
#         -1 = Server ban.
#          0 = Perm ban.
#         Any number greater than 0 is the ban expiration in min's.
#       If the time specified is not a server ban, the reason will be put into
#       the bot's internal ban list record as the reason for adding the ban.
#       Otherwise the ban is considered a server ban and reason is just ignored.
#       When you specify time, don't forget the % (ie: %20 is 20 minutes). In
#       addition to the time of the ban, you can set it to be sticky (read up
#       on '.help stick'). To make the ban sticky; append the time with a '!'
#       (exclamation point) (ie: %20! is 20 minute sticky ban).
#       This setting is optional, if not given then it will default to -1
#       (server ban).
#     banmask_type:
#       This will mask the users ban to the banmask_type number you
#       give. Don't forget the * when you specify the number (ie: *19 is banmask
#       type number 19).
#       Banmask types are:
#        -1 - nick!*@*
#         0 - *!user@host.domain
#         1 - *!*user@host.domain
#         2 - *!*@host.domain
#         3 - *!*user@*.domain
#         4 - *!*@*.domain
#         5 - nick!user@host.domain
#         6 - nick!*user@host.domain
#         7 - nick!*@host.domain
#         8 - nick!*user@*.domain
#         9 - nick!*@*.domain
#         You can also specify a type of 10 to 19 which correspond to masks 0 to
#         9.
#         But if the host.domain is a;
#           hostname = Instead of using a * wildcard to replace portions of the
#                      host.domain, it replaces the numbers in the host.domain
#                      with a '?' (question mark) wildcard.
#           ip       = It will mask as normal, with no '?' (question mark)
#                      replacements as does hostname.
#       This setting is optional, if not given then it will default to type 3.
#   /kick <channel> [reason]
#     If no reason is given, the script's name and version will be used.
#   /rescan <second>
#     This will have the script rescan the user in the specified second.
#     Normal use, used within a warning command set to ensure the user has
#     in fact left the banned channel.
#   /set_warning [number]
#     You can use this to reset the users current number of warnings to the
#     number given.  If you exempt the number, 0 will be assume -- effectively
#     resetting the warnings back to 0 (none).  Some people want to reset a
#     users warning number upon doing an excessive warnings command set as so
#     next time they are detected in a banned channel they will be warned again
#     instead of immediately being processed by the excessive warning command
#     set, and some do not.  I'll let the user decide by giving them this
#     command option.
#   /putlog <text>
#     This will dump <text> to the 'o' (other) console. Don't know what this is
#     exactly?  Play with it, you can't hurt anything.
#   /putlog_d <text>
#     This will dump <text> to the 'd' (debug) console. Don't know what this is
#     exactly?  Play with it, you can't hurt anything.
#   /raw <raw_irc_code>
#     See: http://www.user-com.undernet.org/documents/rfc1459.txt
#     Examples:
#       Deop:    /raw MODE %channel% -o %nick%
#       Devoice: /raw MODE %channel% -v %nick%
#   /tcl <coding>
#     This is for users that are somewhat failure with the TCL language, for a
#     somewhat more advanced way of process commands.  In addition to /tcl, I
#     have made tcl commands out of /msg, /notice, /ban, /kick, /rescan,
#     /set_warning, /putlog, /putlog_d, and /raw.
#     Examples:
#       Deop user only if opped;
#         /tcl if {[isop %nick% %channel%]} {/raw MODE %channel% -o %nick%}
#       Give users different warning messages depending on the current number of
#       warnings the user has received;
#         /tcl if {%warnings% == "0"} {/msg %nick% Leave %banned_channel%.}
#         /tcl if {%warnings% == "1"} {/msg %nick% You must leave that channel.}
#         /tcl if {%warnings% >= "2"} {/msg %nick% Your gonna get banned...}
# Replacement variables:
#   %nick%           - IRC nickname of the user that is in violation (last to
#                      trigger evaluation).
#   %channel%        - The channel that doesn't want this 'banned channel'
#                      associated with (simply put, the channel the user just
#                      joined).
#   %warning_limit%  - Maximum number of warnings allowed.
#   %warnings%       - Current number of warnings the user has received,
#                      counting this one.
#   %banned_mask%    - The banned channel mask the user triggered when being
#                      scanned.
#   %banned_channel% - The banned channel that was found with the banned
#                      channel mask (the exact channel name of the channel in
#                      question).
#   %reason%         - The reason for the banned channel mask, specified when
#                      the ban channel mask is added via dcc command.
If you get stuck here or are not to sure about what to put, just make a post saying what you want to do and i'll be happy to help you with it. :)

The next bit decided what to call the file to keep all the "bad" channels in, will be called.

Code: Select all

# This script will accumulate data. That data is to be stored into a data
# file. Where and what do you want to call that file?
set mc_banc(:config:datafile) "./.badc.data"
I use "badchans.db" since all my user/channel/note files are .db files :)

Finally, the bit which i often have problems with. This is the SVS Server settings. I cant say for 100% if this works, but for mind it didn't. So if you find you get warning from your bot about this, it would be best to disable this here.

Code: Select all

## SVS Client (Script Version Service) v4.1.3 ##
# Once a day, the SVS Client will connect to MC_8's SVS Server to determine if
# there is a newer version of this script available.  If a newer version is
# found, the script will be auto updated.

# [0=no/1=yes] Do you want to enable auto updating?  If you chose to disable
# auto updating, it will not automatically update the script upon finding a
# newer version.
set mc_banc(:config:svs:enable) 1
Good Luck :D
c
calippo
Voice
Posts: 13
Joined: Mon Jan 19, 2009 3:53 pm

Post by calippo »

TCL_no_TK wrote:The important thing to remenber is that once the script is set up and loaded in to eggdrop. You add, remove and list the "bad" channels from eggdrop's part line. So you dont need to edit them in script everytime you want to ban a channel.

Code: Select all

# What flagged users are able to utilize the 'ban_channels' DCC command?  Set
# this to "-|-" to allow anyone to access the command (provided they can DCC
# chat the bot).
set mc_banc(:config:access:ban_channels) "-|-"

# What flagged users are able to utilize the '+ban_channel' DCC command?  Set
# this to "-|-" to allow anyone to access the command (provided they can DCC
# chat the bot).
set mc_banc(:config:access:+ban_channel) "m|m"

# What flagged users are able to utilize the '-ban_channel' DCC command?  Set
# this to "-|-" to allow anyone to access the command (provided they can DCC
# chat the bot).
set mc_banc(:config:access:-ban_channel) "m|m"
The above is the first part of the configuration. If you not fussy its ok the leave them as they are. otherwise choise the flags you want to limit the access to, by default the above only allows Masters (users with the +m flag) to add and remove bad channels.

The next part Allows us to configure what happens when the bot finds someone in a "bad" channel. The syntax is alot like mIRC commands in my opinion so its easyer *least for me* :P

I found reading the default helps to understand what this part is about and helps when deciding what i wanted mine to do.

Code: Select all

# Warning command set:
set mc_banc(:config:warning_command_set) {
  /putlog Ban Channel: Found %nick%@%channel% in %banned_channel%, warning.

  /rescan 60
  /putlog_d Ban Channel: Re scanning %nick% in 60 seconds.

  /msg %nick% You have 1 min. to leave %banned_channel%.
  /putlog_d Ban Channel: [Msg %nick%] You have 1 min. to leave %banned_channel%.

  /msg %nick% Non cooperation will result in a ban.
  /putlog_d Ban Channel: [Msg %nick%] Non cooperation will result in a ban.
}

# Excessive warnings command set:
set mc_banc(:config:excessive_warnings_command_set) {
  /putlog Ban Channel: Found %nick%@%channel% in %banned_channel%, kick/banning.

  /ban %channel% %5 *3 %reason%
  /putlog_d Ban Channel: Banned %nick% on %channel% for 5 minutes.

  /kick %channel% %reason%
  /putlog_d Ban Channel: Kicked %nick% from %channel%.

  /msg %nick% You were warned to leave %banned_channel%.
  /putlog_d Ban Channel: [Msg %nick%] You were warned to leave %banned_channel%.

  /set_warning 0
  /putlog_d Ban Channel: Reset warnings for %nick% on %channel%
  /putlog_d Ban Channel: regarding %banned_channel%.
}
The Commands Are

Code: Select all

# If a user is found in a banned channel, this script can do two command sets.
# The first one is the warning command set, and the second one is the excessive
# warnings command set. If the user still has a warning left, warning command
# set is done, otherwise excessive warnings command set is done. The number of
# warnings are set in via dcc chanset command, see the Commands section (above).
# Separate each command with a new line.
# Valid commands are:
#   /msg <nick|channel> <text>
#   /notice <nick|channel> <text>
#   /ban <channel> [%<time>] [*<banmask_type>] [reason]
#     time:
#       If time is specified;
#         -1 = Server ban.
#          0 = Perm ban.
#         Any number greater than 0 is the ban expiration in min's.
#       If the time specified is not a server ban, the reason will be put into
#       the bot's internal ban list record as the reason for adding the ban.
#       Otherwise the ban is considered a server ban and reason is just ignored.
#       When you specify time, don't forget the % (ie: %20 is 20 minutes). In
#       addition to the time of the ban, you can set it to be sticky (read up
#       on '.help stick'). To make the ban sticky; append the time with a '!'
#       (exclamation point) (ie: %20! is 20 minute sticky ban).
#       This setting is optional, if not given then it will default to -1
#       (server ban).
#     banmask_type:
#       This will mask the users ban to the banmask_type number you
#       give. Don't forget the * when you specify the number (ie: *19 is banmask
#       type number 19).
#       Banmask types are:
#        -1 - nick!*@*
#         0 - *!user@host.domain
#         1 - *!*user@host.domain
#         2 - *!*@host.domain
#         3 - *!*user@*.domain
#         4 - *!*@*.domain
#         5 - nick!user@host.domain
#         6 - nick!*user@host.domain
#         7 - nick!*@host.domain
#         8 - nick!*user@*.domain
#         9 - nick!*@*.domain
#         You can also specify a type of 10 to 19 which correspond to masks 0 to
#         9.
#         But if the host.domain is a;
#           hostname = Instead of using a * wildcard to replace portions of the
#                      host.domain, it replaces the numbers in the host.domain
#                      with a '?' (question mark) wildcard.
#           ip       = It will mask as normal, with no '?' (question mark)
#                      replacements as does hostname.
#       This setting is optional, if not given then it will default to type 3.
#   /kick <channel> [reason]
#     If no reason is given, the script's name and version will be used.
#   /rescan <second>
#     This will have the script rescan the user in the specified second.
#     Normal use, used within a warning command set to ensure the user has
#     in fact left the banned channel.
#   /set_warning [number]
#     You can use this to reset the users current number of warnings to the
#     number given.  If you exempt the number, 0 will be assume -- effectively
#     resetting the warnings back to 0 (none).  Some people want to reset a
#     users warning number upon doing an excessive warnings command set as so
#     next time they are detected in a banned channel they will be warned again
#     instead of immediately being processed by the excessive warning command
#     set, and some do not.  I'll let the user decide by giving them this
#     command option.
#   /putlog <text>
#     This will dump <text> to the 'o' (other) console. Don't know what this is
#     exactly?  Play with it, you can't hurt anything.
#   /putlog_d <text>
#     This will dump <text> to the 'd' (debug) console. Don't know what this is
#     exactly?  Play with it, you can't hurt anything.
#   /raw <raw_irc_code>
#     See: http://www.user-com.undernet.org/documents/rfc1459.txt
#     Examples:
#       Deop:    /raw MODE %channel% -o %nick%
#       Devoice: /raw MODE %channel% -v %nick%
#   /tcl <coding>
#     This is for users that are somewhat failure with the TCL language, for a
#     somewhat more advanced way of process commands.  In addition to /tcl, I
#     have made tcl commands out of /msg, /notice, /ban, /kick, /rescan,
#     /set_warning, /putlog, /putlog_d, and /raw.
#     Examples:
#       Deop user only if opped;
#         /tcl if {[isop %nick% %channel%]} {/raw MODE %channel% -o %nick%}
#       Give users different warning messages depending on the current number of
#       warnings the user has received;
#         /tcl if {%warnings% == "0"} {/msg %nick% Leave %banned_channel%.}
#         /tcl if {%warnings% == "1"} {/msg %nick% You must leave that channel.}
#         /tcl if {%warnings% >= "2"} {/msg %nick% Your gonna get banned...}
# Replacement variables:
#   %nick%           - IRC nickname of the user that is in violation (last to
#                      trigger evaluation).
#   %channel%        - The channel that doesn't want this 'banned channel'
#                      associated with (simply put, the channel the user just
#                      joined).
#   %warning_limit%  - Maximum number of warnings allowed.
#   %warnings%       - Current number of warnings the user has received,
#                      counting this one.
#   %banned_mask%    - The banned channel mask the user triggered when being
#                      scanned.
#   %banned_channel% - The banned channel that was found with the banned
#                      channel mask (the exact channel name of the channel in
#                      question).
#   %reason%         - The reason for the banned channel mask, specified when
#                      the ban channel mask is added via dcc command.
If you get stuck here or are not to sure about what to put, just make a post saying what you want to do and i'll be happy to help you with it. :)

The next bit decided what to call the file to keep all the "bad" channels in, will be called.

Code: Select all

# This script will accumulate data. That data is to be stored into a data
# file. Where and what do you want to call that file?
set mc_banc(:config:datafile) "./.badc.data"
I use "badchans.db" since all my user/channel/note files are .db files :)

Finally, the bit which i often have problems with. This is the SVS Server settings. I cant say for 100% if this works, but for mind it didn't. So if you find you get warning from your bot about this, it would be best to disable this here.

Code: Select all

## SVS Client (Script Version Service) v4.1.3 ##
# Once a day, the SVS Client will connect to MC_8's SVS Server to determine if
# there is a newer version of this script available.  If a newer version is
# found, the script will be auto updated.

# [0=no/1=yes] Do you want to enable auto updating?  If you chose to disable
# auto updating, it will not automatically update the script upon finding a
# newer version.
set mc_banc(:config:svs:enable) 1
Good Luck :D
Thanks for your help i can''t understan this step The Commands Are

Code: Select all

# If a user is found in a banned channel, this script can do two command sets.
# The first one is the warning command set, and the second one is the excessive
# warnings command set. If the user still has a warning left, warning command
# set is done, otherwise excessive warnings command set is done. The number of
# warnings are set in via dcc chanset command, see the Commands section (above).
# Separate each command with a new line.
# Valid commands are:
#   /msg <nick|channel> <text>
#   /notice <nick|channel> <text>
#   /ban <channel> [%<time>] [*<banmask_type>] [reason]
#     time:
#       If time is specified;
#         -1 = Server ban.
#          0 = Perm ban.
#         Any number greater than 0 is the ban expiration in min's.
#       If the time specified is not a server ban, the reason will be put into
#       the bot's internal ban list record as the reason for adding the ban.
#       Otherwise the ban is considered a server ban and reason is just ignored.
#       When you specify time, don't forget the % (ie: %20 is 20 minutes). In
#       addition to the time of the ban, you can set it to be sticky (read up
#       on '.help stick'). To make the ban sticky; append the time with a '!'
#       (exclamation point) (ie: %20! is 20 minute sticky ban).
#       This setting is optional, if not given then it will default to -1
#       (server ban).
#     banmask_type:
#       This will mask the users ban to the banmask_type number you
#       give. Don't forget the * when you specify the number (ie: *19 is banmask
#       type number 19).
#       Banmask types are:
#        -1 - nick!*@*
#         0 - *!user@host.domain
#         1 - *!*user@host.domain
#         2 - *!*@host.domain
#         3 - *!*user@*.domain
#         4 - *!*@*.domain
#         5 - nick!user@host.domain
#         6 - nick!*user@host.domain
#         7 - nick!*@host.domain
#         8 - nick!*user@*.domain
#         9 - nick!*@*.domain
#         You can also specify a type of 10 to 19 which correspond to masks 0 to
#         9.
#         But if the host.domain is a;
#           hostname = Instead of using a * wildcard to replace portions of the
#                      host.domain, it replaces the numbers in the host.domain
#                      with a '?' (question mark) wildcard.
#           ip       = It will mask as normal, with no '?' (question mark)
#                      replacements as does hostname.
#       This setting is optional, if not given then it will default to type 3.
#   /kick <channel> [reason]
#     If no reason is given, the script's name and version will be used.
#   /rescan <second>
#     This will have the script rescan the user in the specified second.
#     Normal use, used within a warning command set to ensure the user has
#     in fact left the banned channel.
#   /set_warning [number]
#     You can use this to reset the users current number of warnings to the
#     number given.  If you exempt the number, 0 will be assume -- effectively
#     resetting the warnings back to 0 (none).  Some people want to reset a
#     users warning number upon doing an excessive warnings command set as so
#     next time they are detected in a banned channel they will be warned again
#     instead of immediately being processed by the excessive warning command
#     set, and some do not.  I'll let the user decide by giving them this
#     command option.
#   /putlog <text>
#     This will dump <text> to the 'o' (other) console. Don't know what this is
#     exactly?  Play with it, you can't hurt anything.
#   /putlog_d <text>
#     This will dump <text> to the 'd' (debug) console. Don't know what this is
#     exactly?  Play with it, you can't hurt anything.
#   /raw <raw_irc_code>
#     See: http://www.user-com.undernet.org/documents/rfc1459.txt
#     Examples:
#       Deop:    /raw MODE %channel% -o %nick%
#       Devoice: /raw MODE %channel% -v %nick%
#   /tcl <coding>
#     This is for users that are somewhat failure with the TCL language, for a
#     somewhat more advanced way of process commands.  In addition to /tcl, I
#     have made tcl commands out of /msg, /notice, /ban, /kick, /rescan,
#     /set_warning, /putlog, /putlog_d, and /raw.
#     Examples:
#       Deop user only if opped;
#         /tcl if {[isop %nick% %channel%]} {/raw MODE %channel% -o %nick%}
#       Give users different warning messages depending on the current number of
#       warnings the user has received;
#         /tcl if {%warnings% == "0"} {/msg %nick% Leave %banned_channel%.}
#         /tcl if {%warnings% == "1"} {/msg %nick% You must leave that channel.}
#         /tcl if {%warnings% >= "2"} {/msg %nick% Your gonna get banned...}
# Replacement variables:
#   %nick%           - IRC nickname of the user that is in violation (last to
#                      trigger evaluation).
#   %channel%        - The channel that doesn't want this 'banned channel'
#                      associated with (simply put, the channel the user just
#                      joined).
#   %warning_limit%  - Maximum number of warnings allowed.
#   %warnings%       - Current number of warnings the user has received,
#                      counting this one.
#   %banned_mask%    - The banned channel mask the user triggered when being
#                      scanned.
#   %banned_channel% - The banned channel that was found with the banned
#                      channel mask (the exact channel name of the channel in
#                      question).
#   %reason%         - The reason for the banned channel mask, specified when
#                      the ban channel mask is added via dcc command
and this step

Code: Select all

##
# Installation
##
# Step 1:
#   Read from the top of this script all the way down to where it says to
#   'Edit no further, tcl coding below.'.  At the very bottom of this script is
#   the history section, if you want to see what's changed from version to
#   version.
#
#   Lines that begin with a # (pound sign) are considered comments, the way
#   of giving the user, you, information within a script such as this.  You
#   don't have to mess with lines that are "commented" because it's only
#   informational and not used by the script in it's functionality.
#
#   Configure things that need to be configured.  Lines that begin with 'set'
#   are considered configurable variables for you to change as needed.  As to
#   what you should set that variable to, read the comment lines before it.  A
#   set is structured in 2 ways.
#   Single line:
#     set Configuration_name "You change this"
#   Multi line:
#     set Configuration_name {
#       You change this.
#       And this too.
#     }
#   In both examples, 'Configuration_name' should never be changed, only what
#   comes after it.  In the single line example, the "" (quotes) should be used
#   at all times (unless you know TCL).
#
#   For single line configuration variable values, you must escape special
#   characters.  But for multi line configuration variable values, you do not
#   escape special characters, unless told otherwise in the commented lines
#   above it.
#   Special characters are any of: ], [, $, ", }, and {
#   What does it mean to escape one of these special characters?
#   To escape something in TCL is to put a \ (back slash) before that character.
#   Example:
#     set Configuration name "You change "this"."
#   The example will actually be set correctly (as: You change "this".), but so
#   it doesn't interfere with TCL parsing you must escape it.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

The first bit you have these variables that respresent differant things, like %nick% would be used as $nick is in most TCL Scripts or even in mIRC.

The ones called %banned_mask% %banned_channel% and %reason% are taken from when you add a channel via DCC/chat with the bot.

This means that:

%reason% would be reason you gave to say why the channel was banned.

%banned_mask% would be the "wildcard" mask you used aka (the banned channel you added its self).

and finally %banned_channel% would be come the "bad" channel the %nick% was found to be by the bot.

Code: Select all

# Replacement variables: 
#   %nick%           - IRC nickname of the user that is in violation (last to 
#                      trigger evaluation). 
#   %channel%        - The channel that doesn't want this 'banned channel' 
#                      associated with (simply put, the channel the user just 
#                      joined). 
#   %warning_limit%  - Maximum number of warnings allowed. 
#   %warnings%       - Current number of warnings the user has received, 
#                      counting this one. 
#   %banned_mask%    - The banned channel mask the user triggered when being 
#                      scanned. 
#   %banned_channel% - The banned channel that was found with the banned 
#                      channel mask (the exact channel name of the channel in 
#                      question). 
#   %reason%         - The reason for the banned channel mask, specified when 
#                      the ban channel mask is added via dcc command
Then we are given a list of commands to use

Code: Select all

# Valid commands are: 
#   /msg <nick|channel> <text> 
#   /notice <nick|channel> <text> 
#   /ban <channel> [%<time>] [*<banmask_type>] [reason] 
#     time: 
#       If time is specified; 
#         -1 = Server ban. 
#          0 = Perm ban. 
#         Any number greater than 0 is the ban expiration in min's. 
#       If the time specified is not a server ban, the reason will be put into 
#       the bot's internal ban list record as the reason for adding the ban. 
#       Otherwise the ban is considered a server ban and reason is just ignored. 
#       When you specify time, don't forget the % (ie: %20 is 20 minutes). In 
#       addition to the time of the ban, you can set it to be sticky (read up 
#       on '.help stick'). To make the ban sticky; append the time with a '!' 
#       (exclamation point) (ie: %20! is 20 minute sticky ban). 
#       This setting is optional, if not given then it will default to -1 
#       (server ban). 
#     banmask_type: 
#       This will mask the users ban to the banmask_type number you 
#       give. Don't forget the * when you specify the number (ie: *19 is banmask 
#       type number 19). 
#       Banmask types are: 
#        -1 - nick!*@* 
#         0 - *!user@host.domain 
#         1 - *!*user@host.domain 
#         2 - *!*@host.domain 
#         3 - *!*user@*.domain 
#         4 - *!*@*.domain 
#         5 - nick!user@host.domain 
#         6 - nick!*user@host.domain 
#         7 - nick!*@host.domain 
#         8 - nick!*user@*.domain 
#         9 - nick!*@*.domain 
#         You can also specify a type of 10 to 19 which correspond to masks 0 to 
#         9. 
#         But if the host.domain is a; 
#           hostname = Instead of using a * wildcard to replace portions of the 
#                      host.domain, it replaces the numbers in the host.domain 
#                      with a '?' (question mark) wildcard. 
#           ip       = It will mask as normal, with no '?' (question mark) 
#                      replacements as does hostname. 
#       This setting is optional, if not given then it will default to type 3. 
#   /kick <channel> [reason] 
#     If no reason is given, the script's name and version will be used. 
#   /rescan <second> 
#     This will have the script rescan the user in the specified second. 
#     Normal use, used within a warning command set to ensure the user has 
#     in fact left the banned channel. 
#   /set_warning [number] 
#     You can use this to reset the users current number of warnings to the 
#     number given.  If you exempt the number, 0 will be assume -- effectively 
#     resetting the warnings back to 0 (none).  Some people want to reset a 
#     users warning number upon doing an excessive warnings command set as so 
#     next time they are detected in a banned channel they will be warned again 
#     instead of immediately being processed by the excessive warning command 
#     set, and some do not.  I'll let the user decide by giving them this 
#     command option. 
#   /putlog <text> 
#     This will dump <text> to the 'o' (other) console. Don't know what this is 
#     exactly?  Play with it, you can't hurt anything. 
#   /putlog_d <text> 
#     This will dump <text> to the 'd' (debug) console. Don't know what this is 
#     exactly?  Play with it, you can't hurt anything. 
#   /raw <raw_irc_code> 
#     See: http://www.user-com.undernet.org/documents/rfc1459.txt 
#     Examples: 
#       Deop:    /raw MODE %channel% -o %nick% 
#       Devoice: /raw MODE %channel% -v %nick% 
#   /tcl <coding> 
#     This is for users that are somewhat failure with the TCL language, for a 
#     somewhat more advanced way of process commands.  In addition to /tcl, I 
#     have made tcl commands out of /msg, /notice, /ban, /kick, /rescan, 
#     /set_warning, /putlog, /putlog_d, and /raw. 
#     Examples: 
#       Deop user only if opped; 
#         /tcl if {[isop %nick% %channel%]} {/raw MODE %channel% -o %nick%} 
#       Give users different warning messages depending on the current number of 
#       warnings the user has received; 
#         /tcl if {%warnings% == "0"} {/msg %nick% Leave %banned_channel%.} 
#         /tcl if {%warnings% == "1"} {/msg %nick% You must leave that channel.} 
#         /tcl if {%warnings% >= "2"} {/msg %nick% Your gonna get banned...}
This allows us using the above variables to creat things which we would like to be done. My Example would be:

Code: Select all

 /putlog Found %nick% in bad channel %banned_channel% (warned him %warnings% number of times so far about this!)
This Adds a "log" message in case you need to make a note of how many times this person (here as %nick%) has been found in this banned channel.

Code: Select all

 /msg %nick% Please don't join this channel if you are in %banned_channel%! Thank You.
This bit sends a message to the nick tell them not to join this channel if they are going to be in the "banned" channel.

Code: Select all

 /kick %channel% %nick% %reason%
This kicks the %nick% from the (current) %channel% with the %reason% (that we set) for being in a banned channel.

Code: Select all

 /notice %nick% If you are found to be in %banned_channel% again, I will ban You.
This then sends a notice to the nickname warning them that if they are found in a banned channel again, they will be banned. :) This can go in the following "parts"

Code: Select all

# Warning command set:
set mc_banc(:config:warning_command_set) {
  /putlog Ban Channel: Found %nick%@%channel% in %banned_channel%, warning.

  /rescan 60
  /putlog_d Ban Channel: Re scanning %nick% in 60 seconds.

  /msg %nick% You have 1 min. to leave %banned_channel%.
  /putlog_d Ban Channel: [Msg %nick%] You have 1 min. to leave %banned_channel%.

  /msg %nick% Non cooperation will result in a ban.
  /putlog_d Ban Channel: [Msg %nick%] Non cooperation will result in a ban.
}
Or The part where we set what to do after someone has used all there "warnings" if any.

Code: Select all

# Excessive warnings command set:
set mc_banc(:config:excessive_warnings_command_set) {
  /putlog Ban Channel: Found %nick%@%channel% in %banned_channel%, kick/banning.

  /ban %channel% %5 *3 %reason%
  /putlog_d Ban Channel: Banned %nick% on %channel% for 5 minutes.

  /kick %channel% %reason%
  /putlog_d Ban Channel: Kicked %nick% from %channel%.

  /msg %nick% You were warned to leave %banned_channel%.
  /putlog_d Ban Channel: [Msg %nick%] You were warned to leave %banned_channel%.

  /set_warning 0
  /putlog_d Ban Channel: Reset warnings for %nick% on %channel%
  /putlog_d Ban Channel: regarding %banned_channel%.
}
As for this bit
##
# Installation
##
# Step 1:
# Read from the top of this script all the way down to where it says to
# 'Edit no further, tcl coding below.'. At the very bottom of this script is
# the history section, if you want to see what's changed from version to
# version.
#
# Lines that begin with a # (pound sign) are considered comments, the way
# of giving the user, you, information within a script such as this. You
# don't have to mess with lines that are "commented" because it's only
# informational and not used by the script in it's functionality.
#
# Configure things that need to be configured. Lines that begin with 'set'
# are considered configurable variables for you to change as needed. As to
# what you should set that variable to, read the comment lines before it. A
# set is structured in 2 ways.
# Single line:
# set Configuration_name "You change this"
# Multi line:
# set Configuration_name {
# You change this.
# And this too.
# }
# In both examples, 'Configuration_name' should never be changed, only what
# comes after it. In the single line example, the "" (quotes) should be used
# at all times (unless you know TCL).
#
# For single line configuration variable values, you must escape special
# characters. But for multi line configuration variable values, you do not
# escape special characters, unless told otherwise in the commented lines
# above it.
# Special characters are any of: ], [, $, ", }, and {
# What does it mean to escape one of these special characters?
# To escape something in TCL is to put a \ (back slash) before that character.
# Example:
# set Configuration name "You change \"this\"."
# The example will actually be set correctly (as: You change "this".), but so
# it doesn't interfere with TCL parsing you must escape it.
This is explaining about setting up the script, in "general" sense. It may be easyer to see this part of the script as a referance than anything else. :idea:
c
calippo
Voice
Posts: 13
Joined: Mon Jan 19, 2009 3:53 pm

Post by calippo »

thank u for your help :-)
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Anytime bud :D
Post Reply