Cleaned up examples and scripts
authorclinton <clinton@unknownlamer.org>
Thu, 13 Nov 2008 00:43:49 +0000 (00:43 +0000)
committerclinton <clinton@unknownlamer.org>
Thu, 13 Nov 2008 00:43:49 +0000 (00:43 +0000)
* Config example is in examples/config now
* Example scripts are in examples/scripts instead of interspersed with
  the installed bobot++ modules
* Removed broken and crappy example

22 files changed:
Makefile.am
examples/config/bot.autoexec [moved from examples/bot.autoexec with 100% similarity]
examples/config/bot.conf [moved from examples/bot.conf with 100% similarity]
examples/config/bot.help [moved from examples/bot.help with 100% similarity]
examples/config/bot.init [moved from examples/bot.init with 100% similarity]
examples/config/bot.shit [moved from examples/bot.shit with 100% similarity]
examples/config/bot.users [moved from examples/bot.users with 100% similarity]
examples/config/scripts.load [moved from examples/scripts.load with 100% similarity]
examples/scripts/boulet [moved from scripts/boulet with 100% similarity]
examples/scripts/country [moved from scripts/country with 100% similarity]
examples/scripts/eval [moved from scripts/eval with 100% similarity]
examples/scripts/hello [moved from scripts/hello with 100% similarity]
examples/scripts/log.scm [moved from scripts/log.scm with 100% similarity]
examples/scripts/scheme_add_user [moved from scripts/scheme_add_user with 100% similarity]
examples/scripts/tamere [moved from scripts/tamere with 100% similarity]
examples/scripts/uname [moved from scripts/uname with 100% similarity]
examples/scripts/uptime [moved from scripts/uptime with 100% similarity]
scripts/scripts.load [deleted file]
scripts/stupid_stuff/insert_saying.scm [deleted file]
scripts/stupid_stuff/sayings [deleted file]
scripts/stupid_stuff/sayings.sh [deleted file]
scripts/stupid_stuff/stupid_stuff [deleted file]

index 8947b24..bf76bed 100644 (file)
@@ -1,5 +1,5 @@
 SUBDIRS = documentation source scripts
 
-EXTRA_DIST = examples m4 scripts
+EXTRA_DIST = examples m4
 
 ACLOCAL_AMFLAGS = -I m4
\ No newline at end of file
similarity index 100%
rename from examples/bot.conf
rename to examples/config/bot.conf
similarity index 100%
rename from examples/bot.help
rename to examples/config/bot.help
similarity index 100%
rename from examples/bot.init
rename to examples/config/bot.init
similarity index 100%
rename from examples/bot.shit
rename to examples/config/bot.shit
similarity index 100%
rename from examples/bot.users
rename to examples/config/bot.users
similarity index 100%
rename from scripts/boulet
rename to examples/scripts/boulet
similarity index 100%
rename from scripts/country
rename to examples/scripts/country
similarity index 100%
rename from scripts/eval
rename to examples/scripts/eval
similarity index 100%
rename from scripts/hello
rename to examples/scripts/hello
similarity index 100%
rename from scripts/log.scm
rename to examples/scripts/log.scm
similarity index 100%
rename from scripts/tamere
rename to examples/scripts/tamere
similarity index 100%
rename from scripts/uname
rename to examples/scripts/uname
similarity index 100%
rename from scripts/uptime
rename to examples/scripts/uptime
diff --git a/scripts/scripts.load b/scripts/scripts.load
deleted file mode 100644 (file)
index 7c2a397..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-(stupid_stuff stupid_stuff)
-(country)
-(hello)
-(tamere)
-(uname)
-(uptime)
-(eval)
\ No newline at end of file
diff --git a/scripts/stupid_stuff/insert_saying.scm b/scripts/stupid_stuff/insert_saying.scm
deleted file mode 100644 (file)
index 005f44d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/local/bin/guile -s
-!#
-
-(use-modules (database simplesql)
-            (ice-9 rdelim))
-
-(display "Enter one saying per line. End the list with EOF\n")
-
-(define db (simplesql-open 'postgresql "bot_sayings"))
-
-(let loop ((saying (read-line)))
-  (cond ((not (eof-object? saying))
-        (simplesql-query 
-         db
-         (string-append "INSERT INTO sayings VALUES ('"
-                        (simplesql-escape saying) "');"))
-        (loop (read-line)))
-       (else
-        (simplesql-close db))))
\ No newline at end of file
diff --git a/scripts/stupid_stuff/sayings b/scripts/stupid_stuff/sayings
deleted file mode 100644 (file)
index a7e33a5..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-Arf!
-errr... umm umm !!
-I think the real issue here is how do you make juice-juice?
-I like to eat cows.
-MySQL is stupid
-I used to speak french
-c'est moi ou orion ne marche pas ?
-1 4m m0r3 l33t th4n j00!
-BITCH, WUT?
-vergil gives wicked hummers!
-Ahh! Snakes!
-I like limos and people who drive them.
-Eat Cows today!
-Over [5] customers served since 1996!
-I think I'll go and hang myself now!
-I'd leap off a third floor balcony for ice cream!
-I am immune to all forms of temptation and seduction. Except for Cute.
-I am a kernel whore.
-Doesn't is just suck when you get soap in your orange juice?
diff --git a/scripts/stupid_stuff/sayings.sh b/scripts/stupid_stuff/sayings.sh
deleted file mode 100644 (file)
index 4cc0a26..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-createdb bot_sayings
-psql bot_sayings -c "CREATE TABLE sayings ( saying text, id serial);"
\ No newline at end of file
diff --git a/scripts/stupid_stuff/stupid_stuff b/scripts/stupid_stuff/stupid_stuff
deleted file mode 100644 (file)
index 35f29bd..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-;;; -*- guile-scheme -*-
-;;; this shows off some interesting things...(based on boulet)
-;;; This is unknown_lamer's bot DumbBot
-
-;;; To use this run:
-;;; sh sayings.sh
-;;; cat sayings | guile -s insert_saying.scm
-;;; Then load this file.
-;;; To add a new saying to the bot db just run insert_saying.scm
-
-;;; yes, this uses a sql db!
-(use-modules (database simplesql)
-            (ice-9 debug))
-(load "../bobot:utils.scm")
-
-;;; Activate or desactivate the bot
-(define talk 1)
-
-(define (shutup)
-  (set! talk 0))
-(bot:addcommand "shutup" shutup #f 0 2)
-
-(define (dotalk)
-  (set! talk 1))
-(bot:addcommand "talk" dotalk #f 0 2)
-
-
-;;; Miscellaneous list functions
-(define (removeChannel c l)
-  (if (null? l)
-      (list)
-      (let ((deb (car l)))
-        (if (string-ci=? c (car deb))
-            (cdr l)
-            (append (list deb) (removeChannel c (cdr l)))))))
-
-(define (changeChannel c n l)
-  (if (null? l)
-      (list)
-      (let ((deb (car l)))
-        (if (string-ci=? c (car deb))
-            (append (list (list c n)) (cdr l))
-            (append (list deb) (changeChannel c n (cdr l)))))))
-
-(define (addChannel c n l)
-  (append l (list (list c n))))
-
-;;; When someone joins a channel
-(define dumbTimer (list))
-(define (joinLourd n c)
-  (if (string-ci=? n (bot:getnickname))
-    (begin
-      (if (= 1 talk) (bot:say c "I like limos"))
-      (set! dumbTimer 
-           (addChannel c (bot:addtimer (+ 600 (bot:random 300)) 
-                                       (dumbLourd c)) dumbTimer)))
-    (if (= 1 talk) (bot:say c (string-append "Arf Moo Arf! " n
-                                            " I like pizza...")))))
-(bot:addhook hooks/join ".*" joinLourd)
-
-;;; When someone leaves the channel
-(define (partLourd n c)
-  (bot:flushport)
-  (if (not (string-ci=? n (bot:getnickname)))
-      (if (= 1 talk) (bot:msg n "I HATED YOU ANYWAY"))
-      (let* ((timer (assoc c dumbTimer)))
-        (bot:deltimer (cadr timer))
-        (set! dumbTimer (removeChannel c dumbTimer)))))
-(bot:addhook hooks/part ".*" partLourd)
-
-;;; Random action to say something dumb
- (define (dumbLourd c)
-   (lambda ()
-   (if (= 1 talk) 
-     (bot:say 
-      c 
-      (vector-ref (list-ref dumbList (bot:random (length dumbList))) 0)))
-   (set! dumbTimer 
-       (changeChannel 
-        c
-        (bot:addtimer (+ 600 (bot:random 300)) (dumbLourd c)) dumbTimer))))
-
-
-(define dumbDB (simplesql-open 'postgresql "bot_sayings"))
-;(define dumbList #f)
-; (define (reload-sayings)
-;   (set! dumbList (cdr (simplesql-query dumbDB "SELECT saying FROM sayings")))
-;   (display "Reloaded sayings from db\n" (bot:logport))
-;   (bot:flushport))
-; (bot:addcommand "reloadsayings" reload-sayings #f 0 4)
-; (reload-sayings)
-
-(define (_length db)
-  (let ((length (+ 1 
-                  (vector-ref 
-                   (list-ref (cdr 
-                              (simplesql-query 
-                               db
-                               "SELECT count(saying) FROM sayings")) 0) 0))))
-    length ))
-
-(define (_select db entry)
-  (list-ref
-   (cdr
-    (simplesql-query db 
-                    (str-app "SELECT saying FROM sayings "
-                             "WHERE id = " 
-                             (number->string entry)))) 0))
-              
-  
-
-
-(define (random-saying)
-  (vector-ref (_select dumbDB (bot:random (_length dumbDB))) 0))
-
-;;; Misc
-;;; note that public hooks match the channel name too!
-;;; match-not-channel prevents this
-
-;;; this should be the first so it doesn't clobber the other hooks
-(bot:addhook 
- hooks/public (match-to-me "")
- (lambda (f t p)
-   (if (= 1 talk)
-     (bot:say t
-             (string-append f ": " (random-saying))))) -50 #f)
-
-
-(bot:addhook hooks/public (match-not-channel "oracle")
-            (lambda (f t p) 
-              (if (= 1 talk) 
-                (bot:say t "Oracle is evil! Use Postgres instead!"))))
-
-(define (add-gnu word)
-  (bot:addhook hooks/public (match-not-channel word)
-            (lambda (f t p) 
-              (if (= 1 talk)
-                (bot:say t 
-                         (string-append f ": I hope you meant GNU!"))))))
-(map add-gnu '("[^/g]linux" "microsoft" "bsd"))
-
-(bot:addhook hooks/public (match-not-channel "boulet")
-            (lambda (f t p) 
-              (if (= 1 talk) (bot:say t "on parle de moi ?"))))
-
-(bot:addhook hooks/public (match-not-channel "arf")
-            (lambda (f t p) 
-              (if (= 1 talk) 
-                (bot:say t (random-saying)))))
-
-(bot:addhook hooks/public (match-not-channel "csn")
-            (lambda (f t p) 
-              (if (= 1 talk) (bot:say t "???"))))
-
-(bot:addhook hooks/public (match-not-channel "pizza|pasta|soda")
-            (lambda (f t p)
-              (if (= 1 talk) 
-                (bot:say t (string-append f ": give me one too!")))))
-
-(define (add-foul word)
-  (bot:addhook hooks/public (match-not-channel word)
-            (lambda (f t p) 
-              (if (= 1 talk)
-                (bot:action 
-                 t (string-append "hits " f 
-                                  " for having a potty mouth"))))))
-(map add-foul '("bitch" "fuck" "whore" "cunt" "tit" "shit" "dick" "cock"))
-
-(bot:addhook hooks/public (match-not-channel "anal sex")
-            (lambda (f t p) 
-              (if (= 1 talk)
-                (if (not (string-match "unknown_lamer" f))
-                  (bot:action 
-                   t (string-append "grabs " f 
-                                    " and buggers " f " up the ass"))))))
-
-(bot:addhook 
- hooks/public (match-not-channel "[[:space:]]*lame[[:space:]]+")
- (lambda (f t p)
-   (if (= 1 talk)
-     (bot:say t
-             (string-append f ": NO NO YOU ARE THE LAMER")))))
-
-(bot:addhook hooks/public (match-to-me "burn")
-            (lambda (f t p)
-              (if (= 1 talk)
-                (bot:say
-                 t
-                 (string-append "How about you burn " f "?")))))
-            
-
-;;; 9h00, on arrive au boulot
-;(define (newDay l)
-;  (if (not (null? l))
-;      (begin
-;        (bot:say (caar l) "What is up my homey g-d0g?")
-;        (newDay (cdr l))
-;        )
-;      )
-;)
-
-;(bot:addhook hooks/timer "09:00" (lambda (h) (newDay dumbTimer) (talk)))
-
-;;; 18h00, il est temps de rentrer
-;(define (timeToGo l)
-;  (if (not (null? l))
-;      (begin
-;        (bot:say (caar l) "Give me food")
-;        (bot:action (caar l) "I'm bored")
-;        (timeToGo (cdr l))
-;        )
-;      )
-;)
-;(bot:addhook hooks/timer "18:00" (lambda (h) (timeToGo dumbTimer) (shutup)))
\ No newline at end of file