summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-08-04 22:44:35 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-08-04 22:44:35 +0000
commit83fd5d3b11539a07b740048ad93c09e31e8d6701 (patch)
tree3a9a69f1c76e8c5e6b2c4c0221f0ad7461c2e27f /data
parente7558ab501d89ed4d04ff69b58344aec8de50844 (diff)
Thu Aug 04 23:03:30 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
* Improved ircd recognition of rfc2812.rb * de-string'd, de-cap'd rfc2812.rb, looks less shouty now * moved the Q auth stuff (for quakenet) into a new qauth plugin (untested!) * finish fixing the httputil
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/quakeauth.rb51
1 files changed, 51 insertions, 0 deletions
diff --git a/data/rbot/plugins/quakeauth.rb b/data/rbot/plugins/quakeauth.rb
new file mode 100644
index 00000000..8f412f1d
--- /dev/null
+++ b/data/rbot/plugins/quakeauth.rb
@@ -0,0 +1,51 @@
+# automatically auths with Q on quakenet servers
+
+class QPlugin < Plugin
+
+ def help(plugin, topic="")
+ case topic
+ when ""
+ return "quath plugin: handles Q auths. topics set, identify"
+ when "set"
+ return "nickserv set <user> <passwd>: set the Q user and password and use it to identify in future"
+ when "identify"
+ return "quath identify: identify with Q (if user and auth are set)"
+ end
+ end
+
+ def initialize
+ super
+ # this plugin only wants to store strings!
+ class << @registry
+ def store(val)
+ val
+ end
+ def restore(val)
+ val
+ end
+ end
+ end
+
+ def set(m, params)
+ @registry['quakenet.user'] = params[:user]
+ @registry['quakenet.auth'] = params[:passwd]
+ m.okay
+ end
+
+ def connect
+ identify(nil, nil)
+ end
+ def identify(m, params)
+ if @registry.has_key?('quakenet.user') && @registry.has_key?('quakenet.auth')
+ debug "authing with Q using #{@registry['quakenet.user']} #{@registry['quakenet.auth']}"
+ @bot.sendmsg "PRIVMSG", "Q@CServe.quakenet.org", "auth #{@registry['quakenet.user']} #{@registry['quakenet.auth']}"
+ m.okay if m
+ else
+ m.reply "not configured, try 'qauth set :nick :passwd'" if m
+ end
+ end
+
+end
+plugin = QPlugin.new
+plugin.map 'qauth set :nick :passwd', :action => "set"
+plugin.map 'quath identify', :action => "identify"