I want to create a timer that every xx minutes loop over nicks in channel
and count users with specific realname and write it to a file.
Code: Select all
foreach nick [chanlist $chan] {
if {match nick!REALNAME "mibbit"}{
count++
}
};
Code: Select all
foreach nick [chanlist $chan] {
if {match nick!REALNAME "mibbit"}{
count++
}
};
Code: Select all
bind time - "?5 *" checknicks ; #every 10 min
bind RAW - 311 checkrealname
set mibbit 0
set total 0
proc checknicks {args} {
global mibbit total
set chan "#chan"
set file "stats.txt"
set time_now [clock seconds]
set time_formated [clock format $time_now -format {%Y-%m-%d %H:%M:%S} -gmt true]
set fs [open $file a+]
puts $fs "$time_formated;$mibbit;$total"
close $fs
set mibbit 0
putlog "perform checknick"
foreach nick [chanlist $chan] {
putquick "WHOIS $nick $nick"
}
return 1
}
proc checkrealname { from keyword arguments } {
global mibbit total
set fullname [string range [join [lrange $arguments 5 end]] 1 end]
set realname3 "*www.mibbit.com*"
if {[string match $realname3 $fullname]} {
incr kiwi
}
incr total
}
putlog "CheckNicks is loaded"
The short answer is: Increase the time between each of the calls to proc checknickserderiko wrote:I'v solved by the above code but It only counts 300 nicknames how can I increase the queue?
Code: Select all
incr kiwi
Code: Select all
incr mibbit