1 ;;; Activate or desactivate the bot
6 (bot-addcommand "shutup" shutup #f 0 2)
10 (bot-addcommand "talk" dotalk #f 0 2)
12 ;;; Miscellaneous list functions
13 (define (removeChannel c l)
17 (if (string-ci=? c (car deb))
19 (append (list deb) (removeChannel c (cdr l)))
25 (define (changeChannel c n l)
29 (if (string-ci=? c (car deb))
30 (append (list (list c n)) (cdr l))
31 (append (list deb) (changeChannel c n (cdr l)))
37 (define (addChannel c n l)
38 (append l (list (list c n)))
41 ;;; When someone joins a channel
42 (define dumbTimer (list))
43 (define (joinLourd n c)
44 (if (string-ci=? n (bot-getnickname))
46 (if (= 1 talk) (bot-say c "salut les gars, vous parlez de quoi ?"))
47 (set! dumbTimer (addChannel c (bot-addtimer (+ 600 (bot-random 3000)) (dumbLourd c)) dumbTimer))
49 (if (= 1 talk) (bot-say c (string-append "euh humm euh..., " n "... une ptite question...")))
52 (bot-addhook hooks/join ".*" joinLourd)
54 ;;; When someone leaves the channel
55 (define (partLourd n c)
57 (if (not (string-ci=? n (bot-getnickname)))
58 (if (= 1 talk) (bot-msg n "hey, reviens, on s'amusait bien"))
59 (let* ((timer (assoc c dumbTimer)))
60 (bot-deltimer (cadr timer))
61 (set! dumbTimer (removeChannel c dumbTimer))
65 (bot-addhook hooks/part ".*" partLourd)
67 ;;; Random action to say something dumb
69 (list "errr... umm umm !!"
70 "ahum. err... p'tite question !"
71 "putain, php c'est vraiment de la merde"
72 "quelle daube mysql !"
73 "xml ça sert vraiment à rien..."
74 "c'est moi ou orion ne marche pas ?"
75 "mais euh ça sert à quoi le palm pilot ?"
76 "je ne comprends pas, j'ai fait copier coller, et ça ne marche pas..."
77 "dites les gars, c'est quoi l'avenir d'internet ?")
81 (if (= 1 talk) (bot-say c (list-ref dumbList (bot-random (length dumbList)))))
82 (set! dumbTimer (changeChannel c (bot-addtimer (+ 600 (bot-random 3000)) (dumbLourd c)) dumbTimer))
87 (bot-addhook hooks/public "oracle" (lambda (f t p) (if (= 1 talk) (bot-say t "oracle ! Un truc de dinosaures, ça !"))))
88 (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")))))
89 (bot-addhook hooks/public "boulet" (lambda (f t p) (if (= 1 talk) (bot-say t "on parle de moi ?"))))
90 (bot-addhook hooks/public "lourd" (lambda (f t p) (if (= 1 talk) (bot-say t "vous le dites si je suis lourd !"))))
91 (bot-addhook hooks/public "csn" (lambda (f t p) (if (= 1 talk) (bot-say t "ahahah, je ne partirai jamais !"))))
92 (bot-addhook hooks/public "manger|pizza|pasta" (lambda (f t p) (if (= 1 talk) (bot-say t "je peux venir manger avec vous ?"))))
93 (bot-addhook hooks/public "regarde" (lambda (f t p) (if (= 1 talk) (bot-action t "se lève pour regarder..."))))
95 ;;; 9h00, on arrive au boulot
99 (bot-say (caar l) "Bonjour les gars")
104 (bot-addhook hooks/timer "09:00" (lambda (h) (newDay dumbTimer) (talk)))
106 ;;; 18h00, il est temps de rentrer
110 (bot-say (caar l) "à demain !")
111 (bot-action (caar l) "rentre chez lui...")
116 (bot-addhook hooks/timer "18:00" (lambda (h) (timeToGo dumbTimer) (shutup)))