Send a link

pzs-ng



Homepage

See http://www.pzs-ng.com(external link)

How to auto announce after SOME_EVENT

Insert 1 line into dZSbot.conf
set pre_announce_bw         "SECTIONS DELIMITERED BY SPACE"


Patch for dZSbot.tcl:
--- dZSbot.tcl.before   2009-02-19 18:50:13.000000000 +0100
+++ dZSbot.tcl  2009-02-19 18:49:29.000000000 +0100
@@ -264,6 +264,14 @@
        return 1
 }

+proc auto_bw {} {
+       global staffchan mainchan spamchan
+       putlog "DEBUG: Saying ng_bw 3 times."
+       ng_bw one two three $staffchan ""
+       ng_bw one two three $mainchan ""
+       ng_bw one two three $spamchan ""
+}
+
 proc readlogtimer {} {
        global dZStimer errorInfo
        if {[catch {readlog}]} {
@@ -273,7 +281,7 @@
 }

 proc readlog {} {
-       global defaultsection disable glversion lastread loglist max_log_change msgreplace msgtypes variables
+       global defaultsection disable glversion lastread loglist max_log_change msgreplace msgtypes variables pre_announce_bw
        set lines ""

        foreach {logtype logid logpath} $loglist {
@@ -332,6 +340,11 @@
                        foreach {nick user group flags} $line {break}
                        ng_inviteuser $nick $user $group $flags
                }
+                if {[lsearch -exact $pre_announce_bw $event] != -1} {
+                       utimer 15 auto_bw
+                       utimer 30 auto_bw
+                       utimer 45 auto_bw
+                }
                if {[lsearch -exact $msgtypes(SECTION) $event] != -1} {
                        set path [lindex $line 0]
                        if {[denycheck $path]} {continue}