-# maintains local list of users to userv-slurp config from
-# each user provides list of
-# monitors
-# devicesets
-#
-# a monitor specifies
-# name
-# IRC channel(s)
-# nicks ignore totally
-# nicks ignore presence
-# nicks prefer speech
-# time for `a while ago'
-# time for `very-recently'
-# syntax
-# nick ignore|nopresence|prefer <glob-pattern> [...]
-# times <very-recently> <a-while-ago> (default 120 450)
-# (affect subsequent `monitor' directives)
-# monitor <monname> <#chan>[,<#chan>...]
-# <monname> must start with <username>:
-#
-# a deviceset specifies
-# monitor
-# led-group
-# led states
-# syntax
-# leds <led-group> <monname> <state>=<value>
-# where state is one of
-# [pref]talk[now] any non-ignored (with `pref', only any preferred)
-# nick(s) spoke at least somewhat recently
-# (with `now', only if they spoke very recently)
-# present at least some non-nopresence nicks present
-# default always matches
-# where the first matching state wins; if none, no LEDs are set
+# see ledbot.html
+# $Id$
set helpfile ledhelp
string match $gl {}
lappend cc($kind) $gl
}
- } elseif {[regexp {^times\s+(\d+)\s+(\d+)$} $l dummy r rnow]} {
+ } elseif {[regexp {^times\s+(\d+)\s+(\d+)$} $l dummy rnow r]} {
foreach cv {{} now} { set cc(time-recent$cv) [set r$cv] }
} elseif {[regexp {^monitor\s+(\S+)\s+(\S.*)$} $l dummy m cl]} {
set cc(chans) {}
}
foreach d [list_objs deviceset] {
upvar #0 deviceset/$d dd
- lappend r "sending $dd(monname) to [dset_visibledest $d]"
+ set m $dd(monname)
+ upvar #0 monitor/$m mm
+ if {![info exists mm(chans)]} continue
+ lappend r "sending $m to [dset_visibledest $d]"
}
ucmdr [join $r "\n"] {}
}
lappend l [dset_visibledest $d]
}
if {[llength $l]} {
- sendprivmsg $nl "LEDs are watching on [\
+ sendprivmsg $nl "LEDs are watching you on [\
join [lsort [array names wch]] ","]: [join $l " "]"
}
}