Created
March 26, 2009 14:55
-
-
Save badboy/86135 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'lib/jabbot' | |
configure do |conf| | |
conf.login = 'geheim@server' | |
conf.channel = 'spamalot' | |
conf.server = 'conference.server' | |
conf.password = 'noch_geheimer' | |
end | |
def calc(msg) | |
IO.popen("ruby19 calculator.rb", 'w+') { |r| r.write("#{msg}\nquit\n"); r.read } | |
end | |
message /^.calc (.+)$/m do |message, params| | |
calculation = params[:matches].first | |
post calc(calculation) | |
end | |
message ".answer :me" do |message, params| | |
post "ey, ja! wieso soll ich \"#{params[:me]}\" sagen, hm?" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment