updated readme, changed some shit

This commit is contained in:
oz modic 2016-03-14 23:18:26 -06:00
parent 46add55e5b
commit ed96bb7963
6 changed files with 47 additions and 4 deletions

View File

@ -2,3 +2,22 @@ extendobot
==========
a magical extensible bot written in ruby
mongo database configuration:
chans.channels
{channel: 'channelname', server: 'servername', autojoin: true|false}
chans.servers
{host: 'host.name', name: 'servername', autoconnect: true|false}
extendobot.config
{key: "key", server: "servername", val: "value"}
eg: {key: "nick", server: "servername", val: "nick4server"}
acl.users
{user: "username", server: "servername", level: "access level"}
note that acl is very naive and makes no assumptions about auth status or user host, etc; it just matches on the username

View File

@ -6,6 +6,7 @@ class DynPlug
include Hooks::ACLHook
include Util::PluginHelper
set :prefix, /^:/
@clist = %w{dynload reload unload load}
@@commands["dynload"] = ":dynload <plugname> <url> - dynamically load a plugin from <url> using <plugname> as plugin name"
@@commands["reload"] = ":reload <plugname> - reload plugin source"
@@commands["unload"] = ":unload <plugname> - unload plugin source"

View File

@ -4,6 +4,7 @@ class Helo
include Cinch::Plugin
include Util::PluginHelper
set :prefix, /^:/
@clist = %w{helo}
@@commands["helo"] = ":helo - say helo"
match /helo/;

View File

@ -3,6 +3,7 @@ require_relative '../classes/Util.rb'
class Help
include Cinch::Plugin
include Util::PluginHelper
@clist = %w{help}
@@commands["help"] = ":help [<cmd>] - produce help for <cmd>"
set :prefix, /^:/
match /help( .+)?/, method: :gethelp

View File

@ -3,10 +3,11 @@ require_relative '../classes/Util.rb'
class PlugTool
include Cinch::Plugin
include Util::PluginHelper
@clist = %w{plugs commands}
@@commands["plugs"] = ":plugs - produce list of plugins available"
@@commands["commands"] = ":commands - produce list of commands"
@@commands["commands"] = ":commands <plugin> - produce commands for <plugin>, or list of all commands if no plugin is given"
set :prefix, /^:/
match /commands/, method: :pluginfo
match /commands( .+)?/, method: :pluginfo
match /plugs( .+)?/, method: :interstitial
def interstitial(m, filter = nil)
@ -48,8 +49,27 @@ class PlugTool
}
m.reply(msg)
end
def pluginfo(m)
cmds = self.class.class_eval { @@commands }
def pluginfo(m, modname = nil)
cmds = ""
if(modname != nil)
puts modname
modname.strip!
if(File.exist?("/var/src/ruby/extendobot/plugins/#{modname}.rb"))
ibot = Util::BotFamily.instance.get(Util::Util.instance.hton(m.bot.config.server)).bot
kc = Kernel.const_get(modname)
i = ibot.plugins.find_index { |x| x.class == kc }
if(i == nil)
m.reply("#{modname} not loaded currently")
else
cmds = kc.class_eval { @clist }
end
end
else
puts "no MODULE"
cmds = self.class.class_eval { @@commands }
end
str = ""
cmds.each { |k, v|
str << "#{k} "

View File

@ -4,6 +4,7 @@ class Say
include Cinch::Plugin
include Util::PluginHelper
set :prefix, /^:/
@clist = %w{say}
@@commands["say"] = ":say :shyt - say :shyt bro!"
extend Hooks::ACLHook
match /say (.+)/;