added approx. a number new things. [0] out of comission for now. gonna go commit ded for a while bbl

This commit is contained in:
oz 2021-12-31 21:23:38 +00:00
parent 599a78ca93
commit 75935a5ac7
5 changed files with 49 additions and 2 deletions

View File

@ -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

View File

@ -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, ''],

25
plugins/PrivMsg.rb Normal file
View File

@ -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

View File

@ -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 },

21
plugins/wip/PrivMsg.rb Normal file
View File

@ -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