[project @ 2002-07-12 03:27:05 by unknown_lamer]
[clinton/bobotpp.git] / scripts / boulet
index 47b5a4a..4172b70 100644 (file)
@@ -3,11 +3,11 @@
 (define (shutup)
   (set! talk 0)
   )
-(bot-addcommand "shutup" shutup #f 0 2)
+(bot:addcommand "shutup" shutup #f 0 2)
 (define (dotalk)
   (set! talk 1)
   )
-(bot-addcommand "talk" dotalk #f 0 2)
+(bot:addcommand "talk" dotalk #f 0 2)
 
 ;;; Miscellaneous list functions
 (define (removeChannel c l)
 ;;; When someone joins a channel
 (define dumbTimer (list))
 (define (joinLourd n c)
-  (if (string-ci=? n (bot-getnickname))
+  (if (string-ci=? n (bot:getnickname))
       (begin
-        (if (= 1 talk) (bot-say c "salut les gars, vous parlez de quoi ?"))
-        (set! dumbTimer (addChannel c (bot-addtimer (+ 600 (bot-random 3000)) (dumbLourd c)) dumbTimer))
+        (if (= 1 talk) (bot:say c "salut les gars, vous parlez de quoi ?"))
+        (set! dumbTimer (addChannel c (bot:addtimer (+ 600 (bot:random 3000)) (dumbLourd c)) dumbTimer))
         )
-      (if (= 1 talk) (bot-say c (string-append "euh humm euh..., " n "... une ptite question...")))
+      (if (= 1 talk) (bot:say c (string-append "euh humm euh..., " n "... une ptite question...")))
       )
   )
-(bot-addhook hooks/join ".*" joinLourd)
+(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 "hey, reviens, on s'amusait bien"))
+  (bot:flushport)
+  (if (not (string-ci=? n (bot:getnickname)))
+      (if (= 1 talk) (bot:msg n "hey, reviens, on s'amusait bien"))
       (let* ((timer (assoc c dumbTimer)))
-        (bot-deltimer (cadr timer))
+        (bot:deltimer (cadr timer))
         (set! dumbTimer (removeChannel c dumbTimer))
         )
       )
   )
-(bot-addhook hooks/part ".*" partLourd)
+(bot:addhook hooks/part ".*" partLourd)
 
 ;;; Random action to say something dumb
 (define dumbList
   )
 (define (dumbLourd c)
   (lambda ()
-    (if (= 1 talk) (bot-say c (list-ref dumbList (bot-random (length dumbList)))))
-    (set! dumbTimer (changeChannel c (bot-addtimer (+ 600 (bot-random 3000)) (dumbLourd c)) dumbTimer))
+    (if (= 1 talk) (bot:say c (list-ref dumbList (bot:random (length dumbList)))))
+    (set! dumbTimer (changeChannel c (bot:addtimer (+ 600 (bot:random 3000)) (dumbLourd c)) dumbTimer))
     )
   )
 
 ;;; Misc
-(bot-addhook hooks/public "oracle" (lambda (f t p) (if (= 1 talk) (bot-say t "oracle ! Un truc de dinosaures, ça !"))))
-(bot-addhook hooks/public "linux" (lambda (f t p) (if (= 1 talk) (bot-say t (string-append f ", j'ai installé une Mandrake chez moi ce week-end, et j'ai réussi à faire marcher l'imprimante")))))
-(bot-addhook hooks/public "boulet" (lambda (f t p) (if (= 1 talk) (bot-say t "on parle de moi ?"))))
-(bot-addhook hooks/public "lourd" (lambda (f t p) (if (= 1 talk) (bot-say t "vous le dites si je suis lourd !"))))
-(bot-addhook hooks/public "csn" (lambda (f t p) (if (= 1 talk) (bot-say t "ahahah, je ne partirai jamais !"))))
-(bot-addhook hooks/public "manger|pizza|pasta" (lambda (f t p) (if (= 1 talk) (bot-say t "je peux venir manger avec vous ?"))))
-(bot-addhook hooks/public "regarde" (lambda (f t p) (if (= 1 talk) (bot-action t "se lève pour regarder..."))))
+(bot:addhook hooks/public "oracle" (lambda (f t p) (if (= 1 talk) (bot:say t "oracle ! Un truc de dinosaures, ça !"))))
+(bot:addhook hooks/public "linux" (lambda (f t p) (if (= 1 talk) (bot:say t (string-append f ", j'ai installé une Mandrake chez moi ce week-end, et j'ai réussi à faire marcher l'imprimante")))))
+(bot:addhook hooks/public "boulet" (lambda (f t p) (if (= 1 talk) (bot:say t "on parle de moi ?"))))
+(bot:addhook hooks/public "lourd" (lambda (f t p) (if (= 1 talk) (bot:say t "vous le dites si je suis lourd !"))))
+(bot:addhook hooks/public "csn" (lambda (f t p) (if (= 1 talk) (bot:say t "ahahah, je ne partirai jamais !"))))
+(bot:addhook hooks/public "manger|pizza|pasta" (lambda (f t p) (if (= 1 talk) (bot:say t "je peux venir manger avec vous ?"))))
+(bot:addhook hooks/public "regarde" (lambda (f t p) (if (= 1 talk) (bot:action t "se lève pour regarder..."))))
 
 ;;; 9h00, on arrive au boulot
 (define (newDay l)
   (if (not (null? l))
       (begin
-        (bot-say (caar l) "Bonjour les gars")
+        (bot:say (caar l) "Bonjour les gars")
         (newDay (cdr l))
         )
       )
 )
-(bot-addhook hooks/timer "09:00" (lambda (h) (newDay dumbTimer) (talk)))
+(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) "à demain !")
-        (bot-action (caar l) "rentre chez lui...")
+        (bot:say (caar l) "à demain !")
+        (bot:action (caar l) "rentre chez lui...")
         (timeToGo (cdr l))
         )
       )
 )
-(bot-addhook hooks/timer "18:00" (lambda (h) (timeToGo dumbTimer) (shutup)))
\ No newline at end of file
+(bot:addhook hooks/timer "18:00" (lambda (h) (timeToGo dumbTimer) (shutup)))
\ No newline at end of file