*!*ident@*.host.com but not like *!~ident@host.com or *!ident@host.com
???

After that, an adress without a ~ in the ident will be set as *!ident@host.com else it will be *!*ident@host.com# Set this to 1 if you don't want your the bot to strip a leading '~' on
# user@hosts.
set strict-host 0
Code: Select all
proc my_procedure {nick uhost arg1 arg2....argn}
global bla bla .................
.............................................
...................................................
#stuff here (what ever your script is doing!)
...................................................................
#for getting the banmask of the user in *!*ident@*.host.com
#you can use something like this if you have the uhost:
set banmask "*!*[string trimleft [lindex [split $uhost "@"] 0] "~"]@[lindex [split [maskhost $uhost] "@"] 1]"
.............................................
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $nick :Bye bye!"
........................
................................
}
}
Code: Select all
set nick [lindex [split $from "!"] 0]
set uhost [getchanhost $nick]
bind pub B|B ban Banyti
proc Banyti {Kikintojas uhost hand Kanalas rest} {
if {$rest == ""} {
putserv "NOTICE $Kikintojas :Vartojimas: cya <nikas> (priezhastis)"
return 0
}
set Kikinamasis [lindex $rest 0]
set reas [lrange $rest 1 end]
if {[getchanhost $Kikinamasis $Kanalas] == ""} {
putserv "NOTICE $Kikintojas :Ko norejai?"
return 0
}
if {[matchattr $hand m|m $Kanalas]} {
putserv "MODE $Kanalas -o+b $Kikinamasis [getchanhost $Kikinamasis $Kanalas]"
putserv "KICK $Kanalas $Kikinamasis :$reas"
return 1
}
if {[matchattr [nick2hand $Kikinamasis $Kanalas] mn|mn $Kanalas] || [matchattr $Kikinamasis b]} {
putserv "NOTICE $Kikintojas :suka zhiurek ka darai!"
return 0
}
if {[matchattr $hand o|o $Kanalas]} {
putserv "MODE $Kanalas -o+b $Kikinamasis [getchanhost $Kikinamasis $Kanalas]"
putserv "KICK $Kanalas $Kikinamasis :$reas"
return 1
}
}
This was already answered...guest wrote:and i want this lil script to man bans like *!*ident@*host.com as well so maybe u could help me with this one as well?
As a side observation, you might wish to update this script a bit, seems a tad out-dated. For example -awyeah wrote:for getting the banmask of the user in *!*ident@*.host.com you can use something like this if you have the uhost:Code: Select all
set banmask "*!*[string trimleft [lindex [split $uhost "@"] 0] "~"]@[lindex [split [maskhost $uhost] "@"] 1]"
Code: Select all
...
set Kikinamasis ...
set reas ...
set banmask ...
...
Code: Select all
bind pub B|B ban Banyti
proc Banyti {Kikintojas uhost hand Kanalas rest} {
if {$rest == ""} {
putquick "NOTICE $Kikintojas :Vartojimas: cya <nikas> (priezhastis)" -next
return 0
}
set Kikinamasis [lindex $rest 0]
set reas [lrange $rest 1 end]
if {[getchanhost $Kikinamasis $Kanalas] == ""} {
putquick "NOTICE $Kikintojas :Ko norejai?" -next
return 0
}
if {[matchattr $hand m|m $Kanalas]} {
putquick "MODE $Kanalas -o+b $Kikinamasis *!*[string trimleft [lindex [split $uhost "@"] 0] "~"]@[lindex [split [maskhost $uhost] "@"] 1]" -next
putquick "KICK $Kanalas $Kikinamasis :$reas" -next
return 1
}
if {[matchattr [nick2hand $Kikinamasis $Kanalas] mn|mn $Kanalas] || [matchattr $Kikinamasis b]} {
putquick "NOTICE $Kikintojas :suka zhiurek ka darai!" -next
return 0
}
if {[matchattr $hand o|o $Kanalas]} {
putquick "MODE $Kanalas -o+b $Kikinamasis *!*[string trimleft [lindex [split $uhost "@"] 0] "~"]@[lindex [split [maskhost $uhost] "@"] 1]" -next
putquick "KICK $Kanalas $Kikinamasis :$reas" -next
return 1
}
If you take a look at alltools.tcl putserv "NOTICE $chan..." has been remapped to putnotc $chan, it is the same I guess.• replace putserv "NOTICE $channel with putnotc $chan
• replace putserv "KICK $channel $nick with the putkick command.
I wouldn't see why there would be a need for newchanban, putserv "MODE $chan +b $banmask" in the script does the banning part, and once when the user is banned he cannot rejoin back hence there will be no kick flood at all.• I would suggest altering your procedure to include the bot setting a newchanban immediately before the victim is kicked from the channel, otherwise you run the risk of kick-flood (if the victim had "auto-rejoin" enabled in thier script, for example). Or you could email it to me and I'll do it for you![]()
Code: Select all
bind pub B|B ban Banyti
proc Banyti {Kikintojas uhost hand Kanalas rest} {
if {$rest == ""} {
putserv "NOTICE $Kikintojas :Vartojimas: cya <nikas> (priezhastis)" -next
return 0
}
set Kikinamasis [lindex $rest 0]
set reas [lrange $rest 1 end]
if {[getchanhost $Kikinamasis $Kanalas] == ""} {
putquick "NOTICE $Kikintojas :Ko norejai?" -next
return 0
}
if {[matchattr $hand m|m $Kanalas]} {
putquick "MODE $Kanalas -o+b $Kikinamasis *!*[string trimleft [lindex [split $uhost "@"] 0] "~"$
putquick "KICK $Kanalas $Kikinamasis :$reas" -next
return 1
}
if {[matchattr [nick2hand $Kikinamasis $Kanalas] mn|mn $Kanalas] || [matchattr $Kikinamasis b]}$
putquick "NOTICE $Kikintojas :suka zhiurek ka darai!" -next
return 0
}
if {[matchattr $hand o|o $Kanalas]} {
putquick "MODE $Kanalas -o+b $Kikinamasis *!*[string trimleft [lindex [split $uhost "@"] 0] "~"$
putquick "KICK $Kanalas $Kikinamasis :$reas" -next
return 1
}
}
it kicks zoro but sets ban on me[18:18] >< Mode (@nevykes:#audi -o+b Zoro *!*bnc@*.velniai.net)
>< [Banned]: Hooligan
[18:18] >< Zoro was kicked by @nevykes (nevykes)
Code: Select all
bind pub B|B ban Banyti
proc Banyti {Kikintojas uhost hand Kanalas rest} {
if {$rest == ""} {
putserv "NOTICE $Kikintojas :Vartojimas: cya <nikas> (priezhastis)" -next
return 0
}
set Kikinamasis [lindex $rest 0]
set reas [lrange $rest 1 end]
set uhost [getchanhost $Kikinamasis]
if {[getchanhost $Kikinamasis $Kanalas] == ""} {
putquick "NOTICE $Kikintojas :Ko norejai?" -next
return 0
}
if {[matchattr $hand m|m $Kanalas]} {
putquick "MODE $Kanalas -o+b $Kikinamasis *!*[string trimleft [lindex [split $uhost "@"] 0] "~"]@[lindex [split [maskhost $uhost] "@"] 1]" -next
putquick "KICK $Kanalas $Kikinamasis :$reas" -next
return 1
}
if {[matchattr [nick2hand $Kikinamasis $Kanalas] mn|mn $Kanalas] || [matchattr $Kikinamasis b]}$
putquick "NOTICE $Kikintojas :suka zhiurek ka darai!" -next
return 0
}
if {[matchattr $hand o|o $Kanalas]} {
putquick "MODE $Kanalas -o+b $Kikinamasis *!*[string trimleft [lindex [split $uhost "@"] 0] "~"]@[lindex [split [maskhost $uhost] "@"] 1]" -next putquick "KICK $Kanalas $Kikinamasis :$reas" -next
return 1
}
}
Code: Select all
bind pub B|B ban pub:kick:ban
proc pub:kick:ban {nick uhost hand chan text} {
set person [lindex $text 0]; set reason [lrange $text 1 end]
set host [getchanhost $person]; set handle [nick2hand $person $chan]
if {($text == "")} { putserv "NOTICE $nick :Vartojimas: cya <nikas> (priezhastis)"; return 0 }
if {($host == "")} { putserv "NOTICE $nick :Ko norejai?"; return 0 }
if {([matchattr $handle mn|mn $chan]) || ([matchattr $handle b|b $chan])}
putquick "NOTICE $nick :suka zhiurek ka darai!" -next; return 0
}
if {([matchattr $hand m|m $chan]) || ([matchattr $hand o|o $chan])} {
putquick "MODE $nick -o+b $person *!*[string trimleft [lindex [split $host "@"] 0] "~"]@[lindex [split [maskhost $host] "@"] 1]" -next
putquick "KICK $chan $person :$reason" -next; return 0
}
}
[20:58] Tcl error in file 'eggdrop.conf':
[20:58] can't read "hand": no such variable
while executing
"matchattr $hand m|m $chan"
(file "scripts/chancmd.tcl" line 1)
(file "eggdrop.conf" line 1)
[20:58] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)