tcldrop-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tcldrop/CVS] tcldrop/modules core.tcl channels/channels.tcl ...


From: Philip Moore
Subject: [Tcldrop/CVS] tcldrop/modules core.tcl channels/channels.tcl ...
Date: Tue, 25 Nov 2003 19:05:07 -0500

CVSROOT:        /cvsroot/tcldrop
Module name:    tcldrop
Branch:         
Changes by:     Philip Moore <address@hidden>   03/11/25 19:05:06

Modified files:
        modules        : core.tcl 
        modules/channels: channels.tcl 
        modules/users  : users.tcl 

Log message:
        Added the "save" event binding, which gets called every $hourly-updates.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/tcldrop/tcldrop/modules/core.tcl.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/tcldrop/tcldrop/modules/channels/channels.tcl.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/tcldrop/tcldrop/modules/users/users.tcl.diff?tr1=1.14&tr2=1.15&r1=text&r2=text

Patches:
Index: tcldrop/modules/channels/channels.tcl
diff -u tcldrop/modules/channels/channels.tcl:1.6 
tcldrop/modules/channels/channels.tcl:1.7
--- tcldrop/modules/channels/channels.tcl:1.6   Tue Nov 25 18:17:14 2003
+++ tcldrop/modules/channels/channels.tcl       Tue Nov 25 19:05:06 2003
@@ -1,6 +1,6 @@
 # channels.tcl --
 #
-# $Id: channels.tcl,v 1.6 2003/11/25 23:17:14 fireegl Exp $
+# $Id: channels.tcl,v 1.7 2003/11/26 00:05:06 fireegl Exp $
 #
 # Copyright (C) 2003 FireEgl (Philip Moore) <address@hidden>
 #
@@ -140,8 +140,13 @@
                        set Channels($lowerchannel) [array get chaninfo]
                }
                {info} {
-                       # Note, tcl-commands.doc doesn't mention any specific 
order to return the channel info in..
-                       # FixMe: Complete this.
+                       # COMPATIBILITY WARNING: Because Eggdrop doesn't return 
the info in any documented or understandable order,
+                       #                        Tcldrop will return a list of 
each channel setting and it's value.  This way makes the info MUCH easier to 
use by Tcl scripters.
+                       if {[info exists Channels($lowerchannel)]} {
+                               return $Channels($lowerchannel)
+                       } else {
+                               return -code error "no such channel record: 
$channel"
+                       }
                }
                {get} {
                        if {[info exists Channels($lowerchannel)]} {
@@ -374,3 +379,6 @@
 # After Tcldrop loads, we (re)load the chanfile:
 bind evnt - loaded ::tcldrop::channels::Loaded 0
 proc ::tcldrop::channels::Loaded {type} { loadchannels }
+
+bind evnt - save ::tcldrop::channels::SaveChannels 0
+proc ::tcldrop::channels::SaveChannels {type} { savechannels }
\ No newline at end of file
Index: tcldrop/modules/core.tcl
diff -u tcldrop/modules/core.tcl:1.21 tcldrop/modules/core.tcl:1.22
--- tcldrop/modules/core.tcl:1.21       Sat Nov 22 00:01:56 2003
+++ tcldrop/modules/core.tcl    Tue Nov 25 19:05:05 2003
@@ -1,6 +1,6 @@
 # core.tcl --
 #
-# $Id: core.tcl,v 1.21 2003/11/22 05:01:56 fireegl Exp $
+# $Id: core.tcl,v 1.22 2003/11/26 00:05:05 fireegl Exp $
 #
 # Copyright (C) 2003 FireEgl (Philip Moore) <address@hidden>
 #
@@ -47,7 +47,7 @@
        # Provide the users module:
        variable version {0.3}
        package provide tcldrop::core $version
-       variable rcsid {$Id: core.tcl,v 1.21 2003/11/22 05:01:56 fireegl Exp $}
+       variable rcsid {$Id: core.tcl,v 1.22 2003/11/26 00:05:05 fireegl Exp $}
        # Initialize variables:
        variable Binds
        variable Timers
@@ -87,6 +87,7 @@
 ::tcldrop::SetDefault owner {}
 ::tcldrop::SetDefault nick {Tcldrop}
 ::tcldrop::SetDefault lang-path {language}
+::tcldrop::SetDefault hourly-updates {00}
 
 proc unixtime {} { clock seconds }
 
@@ -452,6 +453,10 @@
        }
 }
 
+# Every $hourly-updates we call the "save" event:
+proc ::tcldrop::HourlyUpdates {minute hour day month year} { callevent save }
+bind evnt - loaded {event} { bind time - "${::hourly-updates} * * * *" 
::tcldrop::HourlyUpdates }
+
 #  maskhost <address@hidden>
 #    Returns: masked hostmask for the string given ("address@hidden" -> 
"address@hidden",
 #      "address@hidden" -> "address@hidden", "address@hidden" -> 
"address@hidden")
@@ -702,3 +707,4 @@
        # We wanna display how many channels and users there are (like Eggdrop):
        if {[catch { ::tcldrop::Stdout o - "=== ${::botnet-nick}: 
[countchannels] channels, [countusers] users." }]} { ::tcldrop::Stdout o - "=== 
${::botnet-nick}: [countusers] users." }
 }
+
Index: tcldrop/modules/users/users.tcl
diff -u tcldrop/modules/users/users.tcl:1.14 
tcldrop/modules/users/users.tcl:1.15
--- tcldrop/modules/users/users.tcl:1.14        Fri Nov 21 17:27:39 2003
+++ tcldrop/modules/users/users.tcl     Tue Nov 25 19:05:06 2003
@@ -1,6 +1,6 @@
 # users.tcl --
 #
-# $Id: users.tcl,v 1.14 2003/11/21 22:27:39 fireegl Exp $
+# $Id: users.tcl,v 1.15 2003/11/26 00:05:06 fireegl Exp $
 #
 # Copyright (C) 2003 FireEgl (Philip Moore) <address@hidden>
 #
@@ -538,3 +538,6 @@
 # After Tcldrop loads, we (re)load the userfile:
 bind evnt - loaded ::tcldrop::users::Loaded 0
 proc ::tcldrop::users::Loaded {type} { reload }
+
+bind evnt - save ::tcldrop::users::Save 0
+proc ::tcldrop::users::Save {type} { save }
\ No newline at end of file




reply via email to

[Prev in Thread] Current Thread [Next in Thread]