tcldrop-commits
[Top][All Lists]
Advanced

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

[Tcldrop/CVS] tcldrop/modules dcc.tcl


From: Philip Moore
Subject: [Tcldrop/CVS] tcldrop/modules dcc.tcl
Date: Tue, 04 Nov 2003 14:34:10 -0500

CVSROOT:        /cvsroot/tcldrop
Module name:    tcldrop
Branch:         
Changes by:     Philip Moore <address@hidden>   03/11/04 14:34:10

Modified files:
        modules        : dcc.tcl 

Log message:
        Added [putbot] and [putallbots] Tcl commands.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/tcldrop/tcldrop/modules/dcc.tcl.diff?tr1=1.12&tr2=1.13&r1=text&r2=text

Patches:
Index: tcldrop/modules/dcc.tcl
diff -u tcldrop/modules/dcc.tcl:1.12 tcldrop/modules/dcc.tcl:1.13
--- tcldrop/modules/dcc.tcl:1.12        Tue Nov  4 12:22:20 2003
+++ tcldrop/modules/dcc.tcl     Tue Nov  4 14:34:08 2003
@@ -1,6 +1,6 @@
 # dcc.tcl --
 #
-# $Id: dcc.tcl,v 1.12 2003/11/04 17:22:20 fireegl Exp $
+# $Id: dcc.tcl,v 1.13 2003/11/04 19:34:08 fireegl Exp $
 #
 # Copyright (C) 2003 FireEgl (Philip Moore) <address@hidden>
 #
@@ -32,10 +32,10 @@
        # Provide the users module:
        variable version {0.2}
        package provide tcldrop::dcc $version
-       variable rcsid {$Id: dcc.tcl,v 1.12 2003/11/04 17:22:20 fireegl Exp $}
+       variable rcsid {$Id: dcc.tcl,v 1.13 2003/11/04 19:34:08 fireegl Exp $}
        #checkmodule console
        # Export all the commands that should be available to 3rd-party 
scripters:
-       namespace export dcclist listen putdcc getchan setchan console echo 
strip idx2hand hand2idx link bots islinked
+       namespace export dcclist listen putdcc getchan setchan console echo 
strip idx2hand hand2idx link bots islinked putbot putallbots
        ::tcldrop::SetDefault open-telnets 1
        ::tcldrop::SetDefault console-autosave 1
        ::tcldrop::SetDefault force-channel 0
@@ -585,6 +585,21 @@
 
 proc ::tcldrop::dcc::bots {} {
        foreach idx [::tcldrop::idx::List {type BOT}] { lappend bots [idx2hand 
$idx] }
+}
+
+proc ::tcldrop::dcc::putbot {bot message} {
+       if {[set idx [hand2idx $bot]] != -1} {
+               putidx $idx "z ${::botnet-nick} $bot $message"
+               return 1
+       } else {
+               return 0
+       }
+}
+
+proc ::tcldrop::dcc::putallbots {message} {
+       foreach idx [::tcldrop::idx::List {type BOT}] {
+               putidx $idx "z ${::botnet-nick} [idx2hand $idx] $message"
+       }
 }
 
 proc ::tcldrop::dcc::link {viabot {bot {}}} {




reply via email to

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