[project @ 2002-11-04 23:42:01 by unknown_lamer]
authorunknown_lamer <unknown>
Mon, 4 Nov 2002 23:42:01 +0000 (23:42 +0000)
committerunknown_lamer <unknown>
Mon, 4 Nov 2002 23:42:01 +0000 (23:42 +0000)
Removed scripts/bobot-utils.scm (since it is generated from bobot-utils.scm.in), added bot: prefix to match-to-me and match-not-channel

ChangeLog
NEWS
configure.ac
scripts/bobot-utils.scm [deleted file]
source/Bot.C

index e894f61..40026ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-04  Clinton Ebadi  <clinton@unknownlamer.org>
+
+       * scripts/bobot-utils.scm: Added bot: to regex functions (yes,
+       this breaks existing scripts, this is the unstable tree after all)
+
 2002-11-03  Clinton Ebadi  <clinton@unknownlamer.org>
 
        * source/Mask.C (match): Made Mask::match case insensitive
diff --git a/NEWS b/NEWS
index 0ddbeb3..502d4d7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,7 +10,18 @@ IMPORTANT NOTES:
 ====== The News =====================================================
 =====================================================================
 
+Version 2.1.2: Llama
+
+- match-to-me and match-not-channel are now bot:match-to-me and
+  bot:match-not-channel. Just use perl -pi -e
+  "s/match-to-me/bot:match-to-me" SCRIPTS (change to match-not-channel
+  for match-not-channel).
+
 Version 2.1.1: foom
+
+- Host masks are now case insensitive when matched. At least one other
+  person thought this was a good idea since IRC is case preserving but
+  not case sensitive.
 - You can now "name" a hook using an extra arg to bot:addhook. This
   name can be used to have multiple hooks of the same type with the
   same regexp. The default name is "DEFAULT" so don't use that as the
index 3d9d67a..3c96d2a 100644 (file)
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PRERQ(2.50)
 dnl AC_INIT(source/Makefile.in)
-AC_INIT([Bobot++], [2.1.1], [clinton@unknownlamer.org], [bobotpp])
+AC_INIT([Bobot++], [2.1.2CVS], [clinton@unknownlamer.org], [bobotpp])
 AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(config.h)
 
diff --git a/scripts/bobot-utils.scm b/scripts/bobot-utils.scm
deleted file mode 100644 (file)
index 97b9404..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-;;; this is a library of stuff that bobot++ scripts would probably
-;;; want to use. This file is autoloaded by bobot++
-
-;;; This file is covered by the GPL version 2 or (at your option) any
-;;; later version 
-
-;;; Why the GPL? Technically anything that uses Bobot++'s functions
-;;; 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
-                      (string-append (getenv "HOME")
-                                     "/.bobotpp/scripts/")
-                      bot:sys-scripts-dir))
-
-(define (bot:load file)
-  (let loop ((load-path %bot:loadpath))
-    (if (not (null? load-path))
-      (if (catch 'system-error
-            (lambda ()
-              (load
-               (string-append (car load-path)
-                              file)))
-            (lambda args
-              #f ))
-        #t
-        (loop (cdr load-path)))
-      (begin (bot:log "ERROR: File " file " Not Found!\n") #f))))
-
-;;; REGEX UTILS
-
-;;; match-not-channel adds a prefix regex to your regex so it doesn't
-;;; match the sender or channel in a PUBLIC message
-(define (match-not-channel regex)
-  (string-append "^[[:graph:]]* [&#+!][^ ,\a]+ [[:graph:][:space:]]*" regex))
-
-;;; match-to-me matches text that was addressed to the bot with a
-;;; ':',',', or nothing after the bot name
-(define (match-to-me regex)
-  (string-append (match-not-channel (bot:getnickname))
-                "[[:space:][:graph:]]*" regex))
-
-
-;;;; string-utils
-(define str-app string-append) ; shorter
-
-
-;;;; Misc UTILS
-
-;;; bot-log: Write as many messages as you want to the log.  If the
-;;; arg is a thunk it will be executed and it's output will be
-;;; written to the log
-(define (bot:log . messages)
-  (for-each
-   (lambda (x)
-     (if (thunk? x)
-       (display (x) (bot-logport))
-       (display x (bot-logport))))
-   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
-(define (ctcp-quote message)
-  message) ; FIXME: fill me in
-
-;;; DEPRECATED FUNCTION NAMES
-;;; These are provided for backwards compatibility
-;;; and will be removed in the 2.3 dev tree
-
-(define bot-load bot:load)
-(define bot-action bot:action)
-(define bot-adduser bot:adduser)
-(define bot-addserver bot:addserver)
-(define bot-addshit bot:addshit)
-(define bot-ban bot:ban)
-(define bot-cycle bot:cycle)
-(define bot-deban bot:deban)
-(define bot-delserver bot:delserver)
-(define bot-deluser bot:deluser)
-(define bot-delshit bot:delshit)
-(define bot-deop bot:deop)
-(define bot-die bot:die)
-(define bot-do bot:do)
-(define bot-invite bot:invite)
-(define bot-join bot:join)
-(define bot-keep bot:keep)
-(define bot-kick bot:kick)
-(define bot-kickban bot:kickban)
-(define bot-lock bot:lock)
-(define bot-logport bot:logport)
-(define bot-mode bot:mode)
-(define bot-msg bot:msg)
-(define bot-nextserver bot:nextserver)
-(define bot-nick bot:nick)
-(define bot-op bot:op)
-(define bot-part bot:part)
-(define bot-reconnect bot:reconnect)
-(define bot-say bot:say)
-(define bot-server bot:server)
-(define bot-setversion bot:setversion)
-(define bot-tban bot:tban)
-(define bot-tkban bot:tkban)
-(define bot-topic bot:topic)
-(define bot-unlock bot:unlock)
-(define bot-getnickname bot:getnickname)
-(define bot-getserver bot:getserver)
-(define bot-getserverlist bot:getserverlist)
-(define bot-flush bot:flush)
-(define bot-flushport bot:flushport)
-(define bot-random bot:random)
-(define bot-addcommand bot:addcommand)
-(define bot-delcommand bot:delcommand)
-(define bot-addhook bot:addhook)
-(define bot-addtimer bot:addtimer)
-(define bot-deltimer bot:deltimer)
\ No newline at end of file
index 44da508..f1c4c30 100644 (file)
@@ -119,11 +119,11 @@ Bot::Bot(String filename, bool debug_on)
       if (!userFunctions[alias])
        {
          if (userFunction *u = userFunctions[command])
-           userFunctions[alias] = 
-             new
-             userFunction(u->function,
-                          u->minLevel,
-                          u->needsChannelName);
+           userFunctions[alias] = 
+             new
+             userFunction(u->function,
+                          u->minLevel,
+                          u->needsChannelName);
        }
     }
   }
@@ -371,8 +371,8 @@ Bot::waitForInput()
     dccConnections->checkInput (rd);
   }
 
-  if (currentTime < std::time(NULL)) { // Actions that we do each second
-    currentTime = std::time(NULL);
+  if (currentTime < std::time(0)) { // Actions that we do each second
+    currentTime = std::time(0);
     for (std::map<String, unsigned int, std::less<String> >::iterator
            it = ignoredUserhosts.begin();
          it != ignoredUserhosts.end(); ++it)
@@ -391,9 +391,10 @@ Bot::waitForInput()
     tm *thisTime = localtime(&currentTime);
     if (thisTime->tm_sec == 0) {
       char s[6];
-      sprintf(s, "%2d:%2d", thisTime->tm_hour, thisTime->tm_min);
+      std::sprintf(s, "%2d:%2d", thisTime->tm_hour, thisTime->tm_min);
       botInterp->RunHooks(Hook::TIMER, String(s),
-                          gh_list(Utils::string2SCM(String(s)), SCM_UNDEFINED));
+                          gh_list(Utils::string2SCM(String(s)), 
+                                 SCM_UNDEFINED));
     }
 #endif