Why bother re-inventing the wheel when you got bind flud to trigger for whatever you wanted? Instead of: set lines [lindex [split $text_tolerance :] 0] set seconds [lindex [split $text_tolerance :] 1] I would go with: scan [split $text_tolerance :] {%d%d} lines seconds There are a couple of other th...
With this code in mind if {[info exists warn($host)]} { unset warn($host) } consider the following scenario: user dose a /me and triggers the action:avoid function. user is given 1 warning and has his warn(host) set to 1. in a short time frame, before the utimer (with whatever value you got set at w...
What TCL version do you have? Anyway, replacing: incr warn($host) 1 with: if {[info exists warn]} { set warn($host) 1 } else { incr warn($host) 1 } should take care of the issue. Next I would also replace this: utimer $warn(reset) {incr warn($host) -1 } with: utimer $warn(reset) [list action:reset $...
if {$nick == $::botnick} {return 0 } elseif {[isop $nick $chan]} {return 0 } elseif {[matchattr [nick2hand $nick] ofmn|ofmm ]} {return 0} could be made nicer like this: if {[isbotnick $nick]} return if {[matchattr $hand "ofmn|ofmm"]} return if {[isop $nick $chan]} return Notice the use of...
Here's my approach: we create a global variable to store the the function's state (locked/unlocked) and based on that the function can continue it's execution or halt it so you have only one instance running at any given time even if function is called multiple times within a small time frame. proc ...
Since there's no code to clear the array it will pile up and eat his RAM at some point. Apart this, he needs to add a piece of code to track nickname changes, parts, quits and maybe some flood control mechanism just to be on the safe side.
I guess the listen with script as argument would be your best bet. listen <port> script <proc> [flag] Description: accepts connections which are immediately routed to a proc. The proc is called with one parameter: the idx of the new connection. Flag may currently only be 'pub', which makes the bot a...
Actually I didn't. For argument sake let's say the following variables hold some values: $nick = John (bot's nick is Bot) $chan = #something We break this code: if {[isbotnick $nick] || ![string equal -nocase $chan "#chan2"] || ![botisop $chan]} return into 3 separate if statements so it's...
bind join - * voice proc voice {nick uhost hand chan} { if {[isbotnick $nick] || ![string equal -nocase $chan "#chan2"] || ![botisop $chan]} return pushmode $chan +v $nick } isbotnick - returns 0 or 1 if the nick is the bot itself string equal with the -nocase arg ument compares the chann...
You don't need to do if {statement} and then do the same if but negate it like here: if {[validchan $chan} { puthelp "NOTICE $nick :$::fzcom(logo): I'm already on $chan" return 0 } if {![validchan $chan]} { channel add $chan puthelp "NOTICE $nick :$fzcom(logo):$chan added in my chanli...