Code: Select all
proc daddy_ban_warn {nick hand ban chan victims} {
global daddy botnick
if {![botisop $chan] || [strlwr $hand] == [string trimright [strlwr $victims] " "] || $daddy(ban_protect) == 0} {return 0}
if {$hand == "*"} {
if {[string first +userbans [channel info $chan]] != -1} {
if {$nick == $botnick} {return 0}
putserv "MODE $chan -o+b $nick $nick"
putserv "KICK $chan $nick :Don't ban my friends, bud"
newchanban $chan $nick Friendprotection "Friend was banned off $chan"
adduser $nick $nick!*@*
chattr $nick +d
return 0
}
return 0
}
set remove 0
foreach user $victims {
if {([matchattr $user f|f $chan] || [matchattr $user b]) && !([matchattr $hand f|f $chan] || ([matchattr $hand f|f $chan] && [matchattr $hand b]))} {
set remove 1
break
}
if {([matchattr $user f|f $chan] || [matchattr $user f|f $chan]) && ![matchattr $hand f|f $chan]} {
set remove 1
break
}
}
if {$remove == 1} {putserv "MODE $chan -b $ban"}
if {![matchattr $hand b]} {
if {[llength $victims] > 1} {
if {$nick == $botnick} {return 0}
putserv "MODE $chan -o+b $nick $nick"
putserv "KICK $chan $nick :Don't ban my friends, bud"
newchanban $chan $nick Friendprotection "Friend was banned off $chan"
adduser $nick $nick!*@*
chattr $nick +d
return 0
}
}
return 0
}
He states he gets this message, when adds host to the proc decliration.TCL error [daddy_watch_mode]: no value given for parameter "victims" to "daddy_ban_warn"
Here is the script
Code:
proc daddy_ban_warn {nick hand ban chan victims} {
read it carefully. after you fixt all errors resulting of ignoring these documents you can come back and ask further ^-^.tcl-commands - binds (14) mode wrote:MODE (stackable)
bind mode <flags> <mask> <proc>
proc-name <nick> <user@host> <handle> <channel> <mode-change> <victim>
Description: mode changes are broken down into their component
parts before being sent here, so the <mode-change> will always
be a single mode, such as "+m" or "-o". victim will show the
argument of the mode change (for o/v/b/e/I) or "" if the set
mode does not take an argument. Flags are ignored. The bot's
automatic response to a mode change will happen AFTER all
matching Tcl procs are called. The mask will be matched against
'#channel +/-modes' and can contain wildcards.
If it is a server mode, nick will be "", user@host is the server
name, and handle is *.
Note that "victim" was added in 1.3.23 and that this will break
Tcl scripts that were written for pre-1.3.23 versions and use this
binding. An easy fix (by guppy) is as follows (example):
Old script looks as follows:
bind mode - * mode_proc
proc mode_proc {nick uhost hand chan mc} { ... }
To make it work with 1.3.23+ and stay compatible with older bots, do:
bind mode - * mode_proc_fix
proc mode_proc_fix {nick uhost hand chan mc {victim ""}} {
if {$victim != ""} {append mc " $victim"}
mode_proc $nick $uhost $hand $chan $mc
}
proc mode_proc {nick uhost hand chan mc} { ... }
Module: irc