2013-08-18 15:11:16 -04:00
|
|
|
module RubyTest
|
2013-08-28 19:22:32 -04:00
|
|
|
|
2013-08-18 19:09:35 -04:00
|
|
|
def self.prof_init(version, status)
|
2013-08-18 17:22:14 -04:00
|
|
|
Prof::cons_show("RubyTest: init, " + version + ", " + status)
|
2013-08-18 18:54:56 -04:00
|
|
|
Prof::register_command("/ruby", 0, 1, "/ruby", "RubyTest", "RubyTest", cmd_ruby)
|
2013-08-28 19:22:32 -04:00
|
|
|
Prof::register_timed(timer_test, 10)
|
2013-08-18 17:22:14 -04:00
|
|
|
end
|
|
|
|
|
2013-08-18 19:09:35 -04:00
|
|
|
def self.prof_on_start()
|
2013-08-18 17:22:14 -04:00
|
|
|
Prof::cons_show("RubyTest: on_start")
|
|
|
|
end
|
|
|
|
|
2013-08-31 10:43:04 -04:00
|
|
|
def self.prof_on_connect(account_name, fulljid)
|
|
|
|
Prof::cons_show("RubyTest: on_connect, " + account_name + ", " + fulljid)
|
2013-08-18 17:22:14 -04:00
|
|
|
end
|
|
|
|
|
2013-08-18 19:09:35 -04:00
|
|
|
def self.prof_on_message_received(jid, message)
|
2013-08-18 17:22:14 -04:00
|
|
|
Prof::cons_show("RubyTest: on_message_received, " + jid + ", " + message)
|
2013-08-28 19:48:39 -04:00
|
|
|
Prof::cons_alert
|
2013-08-31 15:39:15 -04:00
|
|
|
return message + "[RUBY]"
|
2013-08-18 15:11:16 -04:00
|
|
|
end
|
2013-08-18 18:54:56 -04:00
|
|
|
|
2013-08-31 16:11:28 -04:00
|
|
|
def self.prof_on_message_send(jid, message)
|
|
|
|
Prof::cons_show("RubyTest: on_message_send, " + jid + ", " + message)
|
|
|
|
Prof::cons_alert
|
|
|
|
return message + "[RUBY]"
|
|
|
|
end
|
|
|
|
|
2013-08-18 19:09:35 -04:00
|
|
|
def self.cmd_ruby()
|
2013-08-28 19:22:32 -04:00
|
|
|
return Proc.new { | msg |
|
2013-08-18 18:54:56 -04:00
|
|
|
if msg
|
2013-08-28 19:22:32 -04:00
|
|
|
Prof::cons_show("RubyTest: /ruby command called, arg = " + msg)
|
2013-08-18 18:54:56 -04:00
|
|
|
else
|
2013-08-28 19:22:32 -04:00
|
|
|
Prof::cons_show("RubyTest: /ruby command called with no arg")
|
2013-08-18 18:54:56 -04:00
|
|
|
end
|
2013-08-28 19:22:32 -04:00
|
|
|
Prof::cons_alert
|
|
|
|
Prof::notify("RubyTest: notify", 2000, "Plugins")
|
|
|
|
Prof::send_line("/help")
|
|
|
|
Prof::cons_show("RubyTest: sent \"/help\" command")
|
2013-08-18 18:54:56 -04:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2013-08-18 19:09:35 -04:00
|
|
|
def self.timer_test()
|
2013-08-18 18:54:56 -04:00
|
|
|
return Proc.new {
|
2013-08-28 19:22:32 -04:00
|
|
|
Prof::cons_show("RubyTest: timer fired.")
|
|
|
|
recipient = Prof::get_current_recipient
|
|
|
|
if recipient
|
2013-08-28 19:36:09 -04:00
|
|
|
Prof::cons_show(" current recipient = " + recipient)
|
2013-08-28 19:22:32 -04:00
|
|
|
end
|
|
|
|
Prof::cons_alert
|
2013-08-18 18:54:56 -04:00
|
|
|
}
|
|
|
|
end
|
2013-08-18 15:11:16 -04:00
|
|
|
end
|