[project @ 2002-08-02 04:31:30 by unknown_lamer]
[clinton/bobotpp.git] / scripts / bobot-utils.scm
index d1963a3..97b9404 100644 (file)
@@ -8,6 +8,8 @@
 ;;; must be GPLed, so all of your scripts have to be GPLed anyway
 ;;; because you are really linking with Bobot++, a GPLed program.
 
+(use-modules (ice-9 syncase))
+
 ;;; Bot load (loads a file from %bot:loadpath)
 
 (define %bot:loadpath (list
    messages )
   (bot:flushport))
 
+;;; executes body if not from the bot
+(define-syntax not-from-me
+  (syntax-rules ()
+    ((_ from (not-body1 ...)
+       (from-body1 ...))
+     (cond ((not (string=? from (bot:getnickname)))
+           not-body1 ...)
+          (else from-body1 ...)))
+    ((_ from (not-body1 ...))
+     (cond ((not (string=? from (bot:getnickname)))
+           not-body1 ...)))))
+
+
 ;;; Message sending utils
 
 ;;; returns the CTCP quoted message