From bff2d6aaa572ec73c986304b18e21581d511663a Mon Sep 17 00:00:00 2001 From: encrypt Date: Thu, 18 Feb 2016 15:46:48 +0100 Subject: [PATCH] plugins! --- tubiabot.rb | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/tubiabot.rb b/tubiabot.rb index 6154ffc..530b22f 100644 --- a/tubiabot.rb +++ b/tubiabot.rb @@ -60,6 +60,37 @@ class Salvino end end +class Jops + include Cinch::Plugin + + match /jops/ + + def execute(m) + cibo = ["tigelle", "crescentine"] + m.reply "jops: andiamo a mangiare le "+cibo.sample+" ?" + end +end + +class Qup + include Cinch::Plugin + + match /qup/ + + def execute(m) + m.reply "qup, ora ti vengo a menare" + end +end + +class Vergogna + include Cinch::Plugin + + match /vergogna/ + + def execute(m) + m.reply "vergogna vergogna settimo reparto" + end +end + logger = File.open("./logs.txt", 'a+') markov = MarkyMarkov::TemporaryDictionary.new markov.parse_file './logs.txt' @@ -69,7 +100,7 @@ bot = Cinch::Bot.new do c.server = "irc.mufhd0.net" c.nick = "TubiaBot" c.channels = ["#indivia"] - c.plugins.plugins = [Caffe, ToniNegri, Amici, JS, Salvino] + c.plugins.plugins = [Caffe, ToniNegri, Amici, JS, Salvino, Jops, Qup, Vergogna] end end @@ -77,9 +108,15 @@ bot.on :message do |m| if m.user.nick == "Tubia87" logger.write(m.message+"\n") end - if m.message.include?(@bot.nick) and !@bot.user_list.include?("Tubia87") + if m.message.include?(@bot.nick) m.reply markov.generate_n_sentences 1 end + if m.message.include?("encrypt") + File.open('/tmp/lucine', 'w') do |f| + f.puts('blink 3 0.3') + f.flush + end + end end bot.start