diff options
Diffstat (limited to 'data/rbot')
-rw-r--r-- | data/rbot/plugins/autoop.rb | 2 | ||||
-rw-r--r-- | data/rbot/plugins/freshmeat.rb | 20 | ||||
-rw-r--r-- | data/rbot/plugins/markov.rb | 8 | ||||
-rw-r--r-- | data/rbot/plugins/seen.rb | 2 |
4 files changed, 21 insertions, 11 deletions
diff --git a/data/rbot/plugins/autoop.rb b/data/rbot/plugins/autoop.rb index 6187cf4d..cc1e11a9 100644 --- a/data/rbot/plugins/autoop.rb +++ b/data/rbot/plugins/autoop.rb @@ -1,6 +1,6 @@ class AutoOP < Plugin def help(plugin, topic="") - "perform autoop based on hostmask - usage: addop <hostmask> [channel channel ...], rmop <hostmask> [channel], list - list current ops. If you don't specify which channels, all channels are assumed" + "perform autoop based on hostmask - usage: add <hostmask> [channel channel ...], rm <hostmask> [channel], list - list current ops. If you don't specify which channels, all channels are assumed" end def join(m) diff --git a/data/rbot/plugins/freshmeat.rb b/data/rbot/plugins/freshmeat.rb index 20fa7248..eb2dbdf7 100644 --- a/data/rbot/plugins/freshmeat.rb +++ b/data/rbot/plugins/freshmeat.rb @@ -58,16 +58,22 @@ class FreshmeatPlugin < Plugin def freshmeat(m, params) max = params[:limit].to_i max = 8 if max > 8 - xml = @bot.httputil.get(URI.parse("http://images.feedstermedia.com/feedcache/ostg/freshmeat/fm-releases-global.xml")) - unless xml - m.reply "freshmeat news parse failed" - return - end - doc = Document.new xml - unless doc + begin + xml = @bot.httputil.get(URI.parse("http://images.feedstermedia.com/feedcache/ostg/freshmeat/fm-releases-global.xml")) + unless xml + m.reply "freshmeat news parse failed" + return + end + doc = Document.new xml + unless doc + m.reply "freshmeat news parse failed" + return + end + rescue m.reply "freshmeat news parse failed" return end + matches = Array.new max_width = 60 title_width = 0 diff --git a/data/rbot/plugins/markov.rb b/data/rbot/plugins/markov.rb index 6c51af51..e06753fa 100644 --- a/data/rbot/plugins/markov.rb +++ b/data/rbot/plugins/markov.rb @@ -50,7 +50,10 @@ class MarkovPlugin < Plugin end def ignore?(user=nil) - return @registry['ignore_users'].include?(user) + @registry['ignore_users'].each do |mask| + return true if Irc.netmaskmatch mask, user + end + return false end def ignore(m, params) @@ -154,7 +157,7 @@ class MarkovPlugin < Plugin message = clean_str m.message wordlist = message.split(/\s+/) - return unless wordlist.length > 2 + return unless wordlist.length >= 2 @lastline = message word1, word2 = :nonword, :nonword wordlist.each do |word3| @@ -163,6 +166,7 @@ class MarkovPlugin < Plugin end @registry["#{word1}/#{word2}"] = [:nonword] + return if m.replied? random_markov(m, message) end end diff --git a/data/rbot/plugins/seen.rb b/data/rbot/plugins/seen.rb index cc0c1792..aec5a064 100644 --- a/data/rbot/plugins/seen.rb +++ b/data/rbot/plugins/seen.rb @@ -79,7 +79,7 @@ class SeenPlugin < Plugin when "JOIN" ret += "joining #{saw.where}" when "QUIT" - ret += "quiting IRC (#{saw.message})" + ret += "quitting IRC (#{saw.message})" when "TOPIC" ret += "changing the topic of #{saw.where} to #{saw.message}" end |