Code: Select all
set ident [string trimleft [lindex [split $uhost "@"] 0] "~"]
if {([expr $ident] > 7)} { set ident [string trimleft [string trimright [string range $ident 7 end]] "~"] }
#Then you can go ahead and ban the user like "*!*$ident@[lindex [split $uhost "@"] 1]"
Did you meanawyeah wrote:Code: Select all
if {([expr $ident] > 7)} {
Code: Select all
if {[string len $ident]>7} {
Code: Select all
if {([string match -nocase *$quitmsg* $reason])} {
set host [lindex [split $uhost "@"] 1]
set ident *![string trimleft [lindex [split $uhost "@"] 0] "~"]
if {([string len $ident] > 7)} { set ident *![string trimleft [string trimright [string range $ident 7 end]] "~"] }
newchanban $chan $ident@$host quitban $qb_reason $qb_bantime
return 0
}
}
Code: Select all
[lindex [split $uhost "@"] 1]
Code: Select all
# Specify the list of quit messages to ban on. Use lower case characters
# only. You can use standard wildcards (? and *) in the list.
set qb_quitmsgs {
"*www.*"
"*http://*"
"*ftp.*"
"*ftp://*"
}
# Channels in which to enable the script. This can be one channel like
# "#red", a list of channels like "#red #green #blue", or "*" for all
# channels.
set qb_chans "*"
# Length of time to ban for (in minutes).
set qb_bantime 14440
# Ban reason.
set qb_reason "Смени quit message."
# Don't edit below unless you know what you're doing.
bind sign - * qb_quit
proc qb_quit {nick uhost hand chan reason} {
global qb_bantime qb_chans qb_quitmsgs qb_reason
if {(($qb_chans != "*") && ([lsearch -exact [split [string tolower $qb_chans]] [string tolower $chan]] == -1))} { return 0 }
if {[matchattr $hand fmnROo|fmnROo $chan]} { return 0 }
set reason [string tolower $reason]
foreach quitmsg $qb_quitmsgs {
if {([string match -nocase *$qb_quitmsg* $reason])} {
set host [lindex [split $uhost "@"] 1]
set ident *!*[string trimleft [lindex [split $uhost "@"] 0] "~"]*
if {([string length $ident] > 7)} { set ident *!*[string trimright [string range $ident 7 end]]* }
newchanban $chan $ident@$host quitban $qb_reason $qb_bantime
return 0
}
}
}
By not using wildcards in the ident and trimming it will not ban the ident technically, so you would have to use * after trimming it if I know what I am saying. If you don't know try it and let me know, heh.Example:
*** awyeah (longident@DAL.net) has joined #drugs
*** Bot sets mode: +b awyeah *!longide@DAL.net
*** awyeah was kicked by Bot (bad user)
*** awyeah (longident@DAL.net) has joined #drugs
#Will not set the correct ban
If you still want todo it that way. Here is the code, go and use it as you like your ban to be placed as: *!ident@host.com*** awyeah (longident@DAL.net) has joined #drugs
*** Bot sets mode: +b awyeah *!longide*@DAL.net
*** awyeah was kicked by Bot (bad user)
#Will set the correct ban
Code: Select all
set ident *![lindex [split $uhost "@"] 0]
if {([string length $ident] > 7)} { set ident *![string trimright [string range $ident 7 end]] }