From: Ryan Davies <ryan@i-...> - 2008-05-28 06:39:20
Is there a socket I can connect to, that will receive all notices and that
will accept commands that are written to it?
I'm have written an IRC bot (in another language) that is in no way related to
misterhouse, and i want it to announce announcements from misterhouse to the
room (e.g. "<HouseBot> The sun is now setting at 5:02pm" ). I want to give the
bot the ability to receive commands from the chan and have them re-layed to
misterhouse. I would prefer to have a persistant connection between the two,
but this isnt a biggie. Just wanted to know if there was an existing socket I
From: Ryan Davies <ryan@i-...> - 2008-05-30 11:57:32
Gregg Liming <gregg <at> limings.net> writes:
> The closest that I know of is code/common/telnet.pl
Do you think that it would be easier to write my own socket? Perhaps a mixture
of telnet and voice_server.pl ?
Ryan Davies wrote:
> Gregg Liming <gregg <at> limings.net> writes:
>> The closest that I know of is code/common/telnet.pl
> Do you think that it would be easier to write my own socket? Perhaps a mixture
> of telnet and voice_server.pl ?
If proper "respond" and "echo" handling is needed, then realize that
currently it is somewhat "hard-wired" into bin/mh and
lib/Generic_Item.pm. Search on telnet in each of the above files to get
an idea. There are changes to both that could make it less "hard-wired"
and easier to extend to new "conduits". I would be willing to work w/
you to do this if you decide on this approach. Just realize that it may
not be overly quick or easy. Alternatively, if you treat your new
socket as a conduit of type "im" (instant messaging), then you could
rely on the existing framework.
As an example of "respond" vice "echo", consider that "echo" events are
speech and/or display events that you may want to intercept/receive
regardless of whether they were intended for your client or not.
"respond" events are those that are direct responses to your client's
query/command. As an example, you don't (necessarily) want to broadcast
a response to your client's command/query to the house PA, but instead
limit it to only your client. Alternatively, you may wish to "echo"
either all or some subset of speak or display events back to your client
(in an unsolicited fashion).
Hope this makes some sense.