diff --git a/plugins/DigDeep.rb b/plugins/DigDeep.rb index df01805e..a1db39ba 100644 --- a/plugins/DigDeep.rb +++ b/plugins/DigDeep.rb @@ -34,7 +34,7 @@ class DigDeep resp = "" puts "recs = #{recs.inspect}" puts "recs.include? rec.upcase: #{(recs.include? rec.upcase).inspect}" - ns ||= Resolv::DNS::Config.default_config_hash[:nameserver] + ns ||= Resolv::DNS::Config.default_config_hash[:nameserver].sample puts "rec upcase: #{rec.upcase}" puts "dig #{rec} #{host} via namserver #{ns}" begin diff --git a/plugins/Markovian.rb b/plugins/Markovian.rb index 80c68ca1..dea23bce 100644 --- a/plugins/Markovian.rb +++ b/plugins/Markovian.rb @@ -60,6 +60,7 @@ class Markovian re = /[^[:print:]]/ #ignore nonprintable characters schemes = %w{http https ftp gemini gopher irc ssh} urxp = URI.regexp(schemes) + text = Sanitize(Unformat(text)) [ [urxp, ''], [re, ''], diff --git a/plugins/PrivMsg.rb b/plugins/PrivMsg.rb new file mode 100644 index 00000000..cee03b93 --- /dev/null +++ b/plugins/PrivMsg.rb @@ -0,0 +1,25 @@ +require 'cinch' +require_relative '../classes/Util.rb' +class PrivMsg + include Cinch::Plugin + include Hooks::ACLHook + include Util::PluginHelper + set :prefix, /^:/ + @@levelRequired = 10 + match /msg (\#?.+?) (.+)$/, method: :msg + + def msg(m, target, words) + puts "\ttarget: #{target}\nwords: #{words}\n\n\n" + return unless aclcheck(m) + to = Target(target) + if(target.match /^\#/) # target is channel + puts "sending message to #{target} as chamel" + #to = Channel(target) + else + puts "treating #{target} as a nick" + #to = User(target) + end + puts "target.to: #{to.inspect}\n"*6 + to.send(words) + end +end diff --git a/plugins/SocialEyes.rb b/plugins/SocialEyes.rb index f1164a0c..9439fe84 100644 --- a/plugins/SocialEyes.rb +++ b/plugins/SocialEyes.rb @@ -20,7 +20,7 @@ class SocialEyes #{ :match => /r(eally|ly)/i, :response => "big if tru" , :offset => 10 }, #{ :match => /^\bn(o(pe)?|ah)\b/i, :method => :deny , :offset => 10 }, { :match => /^the$/i, :response => "the" , :offset => 60 }, - { :match => /^(5 *|(5 )+)$/, :method => :five_alive , :offset => 2 }, + { :match => /^(5 *|(5 )+)$/, :method => :five_alive , :offset => 0 }, { :match => /good bot/i, :method => Util::Util.instance.method(:getSuccess), :offset => 10 }, { :match => /bad bot/i, :method => Util::Util.instance.method(:getExcuse), :offset => 10 }, #{ :match => /crime/i, :response => "we meddle in mcgirt, ONLINE" , :offset => 10 }, diff --git a/plugins/wip/PrivMsg.rb b/plugins/wip/PrivMsg.rb new file mode 100644 index 00000000..a812bcd7 --- /dev/null +++ b/plugins/wip/PrivMsg.rb @@ -0,0 +1,21 @@ +require 'cinch' +require_relative '../classes/Util.rb' +class PrivMsg + include Cinch::Plugin + include Util::PluginHelper + set :prefix, /^:/ + extend Hooks::ACLHook + @@levelRequired = 10 + match /msg ([^\s]+) (.+)/, method: :msg + + def msg(m, target, words) + return unless aclcheck(m) + to = nil + if(target.match /^\#/) # target is channel + to = Channel(target) + else + to = User(target) + end + to.send(words) + end +end