drb application in bots

J

Junkone

Hello.
I am doing a drb application for a bot client and have a prob. How can
i set up the server so that it will accept a string and do someaction
like bot.deliver(string)

bot server
!/usr/bin/env ruby
require 'rubygems'
require 'jabber/bot'
require 'fileutils'
require 'drb'



# Create a public Jabber::Bot
$bot = Jabber::Bot.new(
:jabber_id => '(e-mail address removed)',
:password => 'pass',
:master => '(e-mail address removed)',
:is_public => true
)

Thread.new do
$bot.connect
end

puts "starting anothe rsergice"
DRb.start_service('druby://localhost:9000',
$bot.deliver("(e-mail address removed),somestring)
DRb.thread.join # Don't exit just yet!
puts "starting anothe service"



# Bring the new bot to life



Bot client
irb(main):013:0> obj = DRbObject.new(nil, 'druby://localhost:9000')
=> #<DRb::DRbObject:0x2e4a80c @uri="druby://localhost:9000", @ref=nil>
irb(main):014:0> obj.im("this is a true bot.")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top