There is more to this proc, the rest of it works. This part is supposed to check each user on each channel 3 times per hour, sending a status request to nickserv every 5 seconds between each user, as to not flood the bot or the server. This does not work because of the loop. How can I adjust this so that it will step through each nick every 5 seconds like I want?
bind time - "05 * * * *" check_reg
bind time - "20 * * * *" check_reg
bind time - "45 * * * *" check_reg
# check/attain
proc check_reg {min hr day mm yy} {
# reset purged list, empty
set ::reg_checklist [list]
# iterate channels
foreach c [channels] {
# create list of nicks from chan, including all from prior iterations
set ::reg_checklist [concat "$::reg_checklist" "[chanlist $c]"]
}
# sort list, remove dupes
set ::reg_checklist [lsort -unique $::reg_checklist]
# call purge
start_purging
}
# purge/invoke
proc start_purging {
# avoid endless timers, no timer created if no list present
if {![llength $::reg_checklist]} { return }
# attain 1st nick in the list
set nick [lindex $::reg_checklist 0]
# remove it from the list
set ::reg_checklist [lreplace $::reg_checklist 0 0]
# call auth with attained nick
auth_check $nick
# invoke start_purging again to purge list
utimer 5 [list start_purging]
}
# auth/push
proc auth_check {n} {
bind notc - * isreg
puthelp "PRIVMSG nickserv :status $n"
}
You almost had it all. You were missing the part which queues your list of nicks every 5 seconds. This script will take all the nicks in all your channels, mash them together into a list. Then it sorts them uniquely (to remove dupes) and makes them in alphabetical order. It then passes this to start_purging procedure which picks the first nick, deletes it from the list, calls your auth_check proc, then calls itself after 5 seconds. It will repeat this, every 5 seconds until the list is empty.
Ah, thanks, I see now! I had actually written a newer version of my OP after talking to someone on irc about it, but It was that purge section that I needed to make that work. I had the list part fine, but missed the magic involving that step.