Is there any tcl out there that voice users when they say about 5lines of text in under 1 min instead of juz a line.
If there isn't any, what will I need to do? Pls give pointers cos I'm new with this tcl stuff.
Thanks
Code: Select all
set cNv(msgs:time) 5:60
bind pubm - "#chan *" cNv
proc cNv {n u h c a} {
if {[isvoice $n $c]||[isop $n $c]} return
global cNv
scan $cNv(msgs:time) %i:%i num sec
lappend cNv($c,$u) [expr {[clock seconds]+$sec}]
if {[llength $cNv($c,$u)]>=$num} {
set ts $cNv($c,$u); set cNv($c,$u) {}
foreach ts $ts {
if {$ts>[clock seconds]} {lappend cNv($c,$u) $ts}
}
if {[llength $cNv($c,$u)]>=$num} {
pushmode $c +v $n; unset cNv($c,$u)
}
}
}
Code: Select all
scan $cNv(msgs:time) %i:%i num sec
lappend cNv($c,$u) [expr {[clock seconds]+$sec}]
if {[llength $cNv($c,$u)]>=$num} {
set ts $cNv($c,$u); set cNv($c,$u) {}
foreach ts $ts {
if {$ts>[clock seconds]} {lappend cNv($c,$u) $ts}
}
Code: Select all
if {[isvoice $n $c]||[isop $n $c]||[onchan $n #abc]} return
Code: Select all
if {([string match $c "#chan"])} {return 0}
If your bot is not on the channel, 'onchan' won't work. The only way to find out is by doing a /whois on the user and that would be an entirely different matter. This can't be done on-the-fly inside the cNv proc because you have to send the whois request and then wait for the response from the irc server. The best thing would be to add a whois proc that does /whois on the last joiners on a set time interval then check if they're in the banned channel(s) and exempt them from voicing some how.DeadGuy wrote:if I'm going to make the bot not to +v users that are on certain channel (ban channel that the bot is not in) should i add these?
The scan extracts the integers from the string stored in the variable and put them into 'num' and 'sec' for easy access later in the script.DeadGuy wrote:I'm not sure what some of the lines does esp these few lines.Code: Select all
scan $cNv(msgs:time) %i:%i num sec lappend cNv($c,$u) [expr {[clock seconds]+$sec}] if {[llength $cNv($c,$u)]>=$num} { set ts $cNv($c,$u); set cNv($c,$u) {} foreach ts $ts { if {$ts>[clock seconds]} {lappend cNv($c,$u) $ts} }