BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: Snarfblatt on December 10, 2007, 09:33:39 pm

Title: How to relay to multiple org bots?
Post by: Snarfblatt on December 10, 2007, 09:33:39 pm
I'm working on an alliance with a couple orgs and we would like to connect our bots. How does one accomplish this? I see the relay command but it appears you can only put in one bot name there and I'm not even sure that is the right place to do it. I also saw Pharexys' Alliance module, but I'm not sure that is right either.

Anyone else doing this and know where to look? BTW, at least one of the orgs is using BudaBot and not Bebot. Still possible?
Title: Re: How to relay to multiple org bots?
Post by: Alreadythere on December 10, 2007, 10:40:59 pm
I don't know which kind of relay budabot supports, so I can't say anything to this.

To relay between multiple bebots you need to setup a bot that can serve as relaying hub via his private group. This bot only needs to be able to invite the org bots to his own private chatgroup. Best way to do this is by using autoinvite. The org bots have to be configured to use pgroup as relay, and you have to setup the botname of the relay hub there. In addition you'll have to add the other org bots of the alliance to some security group so they are able to invoke !gcr commands in the other org bots.

Another way of relaying is using IRC, simply relay all chat to a shared IRC channel.
Title: Re: How to relay to multiple org bots?
Post by: Snarfblatt on December 11, 2007, 02:43:14 am
Does this only work with the svn version? Because I'm reading this post: http://bebot.link/index.php/topic,781.15.html and it mentions a "relay.php" module which I see only is in the svn version.
Title: Re: How to relay to multiple org bots?
Post by: Alreadythere on December 11, 2007, 12:28:51 pm
That post is outdated a bit, the module got included into SVN before 0.4.
Title: Re: How to relay to multiple org bots?
Post by: Snarfblatt on December 11, 2007, 04:31:51 pm
But it wasn't released? I still only see it in svn. I just want to make sure that i'm using the right files to get this to work, because so far I haven't.

Another question.. should the "relay" bot be setup as a guild or raid bot? If a guild bot, do I just leave the org name and id blank in the bot.conf file?
Title: Re: How to relay to multiple org bots?
Post by: Alreadythere on December 11, 2007, 04:46:40 pm
The Relay_GUILD.php coming with 0.4.3 does support relaying over private chatgroups. It is based on the version posted by Ebag333 you linked to.

The relay hub should best run as pure raidbot, as only the private chat channel of it is needed.
Title: Re: How to relay to multiple org bots?
Post by: Snarfblatt on December 11, 2007, 06:48:30 pm
I guess that's where I'm a little confused... if I set it up as a raid bot, doesn't the bot not load Relay_GUILD.php? or am I mistaken?
Title: Re: How to relay to multiple org bots?
Post by: Alreadythere on December 11, 2007, 06:52:15 pm
You don't need the relay module in the relay hub. All the hub has to do is invite the org bots of your alliance to it's private chat. Nothing else. The bots then will use the private chatgroup of the hub the same ways as they use any other chat channel.
Title: Re: How to relay to multiple org bots?
Post by: Snarfblatt on December 11, 2007, 08:26:02 pm
Ok.. finally got the relaying working with a couple test bots... but the auto-inviting doesn't seem to happen. I have to join the relay bot and manually !invite the other two bots. Which auto-invite settings need messed with? There seems to be settings for autoinv and settings for members and setting for relay that all mention auto invite.
Title: Re: How to relay to multiple org bots?
Post by: Alreadythere on December 11, 2007, 08:57:13 pm
You have to set Activated to On under !settings AutoInv.

And under !settings Members you got to set AutoInvite to On, and set AutoInviteGroup to Guest or Member, whichever you are using for the bots. As long as they do get invited both will work.

After you have done this setting you have to readd the bots, or log each of the bot characters and do /tell relayhub !autoinvite on to enable autoinvite for them.
Title: Re: How to relay to multiple org bots?
Post by: Snarfblatt on December 11, 2007, 09:48:35 pm
hmmm.. auto inviting is still not happening.
Title: Re: How to relay to multiple org bots?
Post by: Alreadythere on December 11, 2007, 10:38:33 pm
Are the characters on the buddy list?
Title: Re: How to relay to multiple org bots?
Post by: Temar on December 12, 2007, 01:29:56 am
notify has to be on
Title: Re: How to relay to multiple org bots?
Post by: Snarfblatt on December 12, 2007, 07:24:11 pm
Yup.. Notify did it. Thanks. Now to see if I can get budabot to talk to the relay...  :-\

If anyone has any hints on that one, please speak up.
Title: Re: How to relay to multiple org bots?
Post by: Alreadythere on December 12, 2007, 07:47:34 pm
The idea behind the relay is easy: Get budabot to accept chatgroup invites, make it relay all chat org/guest chat with !gcr in the hub's group, and make it react to the !gcr commands of other bots in the hubs group.

No clue how to do that with budabot though, never looked into the coding there.
Title: Re: How to relay to multiple org bots?
Post by: Snarfblatt on December 12, 2007, 11:21:25 pm
Well if anyone is interested I'm getting there.. but boy is budabot different. I'm pretty much going down the road you described.
Title: Re: How to relay to multiple org bots?
Post by: bmoscato on December 21, 2007, 04:40:56 pm
Not to hijack the thread but do you still need a hub bot to relay between 2 different org bots if you are hosting the bots for both orgs?

This question is based upon using only BeBot bots.
Title: Re: How to relay to multiple org bots?
Post by: Vhab on December 21, 2007, 06:08:36 pm
Easiest way is still using IRC. In case of bad support between bots and multiple owners, just stick all bots into the same IRC channel.
Title: Re: How to relay to multiple org bots?
Post by: Snarfblatt on December 21, 2007, 06:51:03 pm
No you don't need a Hub.. you can just set the Relay to each of the other bots and then use Tells. Seems to work good for me.
Title: Re: How to relay to multiple org bots?
Post by: Alreadythere on December 21, 2007, 09:09:18 pm
For two bots tells will work ok.
Title: Re: How to relay to multiple org bots?
Post by: Zweiblum on July 22, 2008, 09:20:31 pm
For two bots tells will work ok.

i got even 2 bebots on 2 guilds.
i would like to relay them both, but i realy dont know how.. :/
i tried it trough !settings relay but doesnt seems to work... but maybe i just did it wrong..

would be very thankful for any kind of help :)
Title: Re: How to relay to multiple org bots?
Post by: Drizzurdeen on April 04, 2009, 08:59:26 pm
really the easiest way to relay several guild is using IRC

just type

!settings irc
then make the settings

e.g. irc-server ... use irc.funcom.com ... works perfekt

than whenn all settings are done ... make the same by the bot u will release ... than you just have to connect to irc

!irc connect

tadaaaaaaa you can read all what is written in the irc :D ... i think is the best and easiest way to relay several guild-chats ...

greets Drizz
Title: Re: How to relay to multiple org bots?
Post by: Pigtail on April 08, 2009, 08:27:05 am
Hello all!

Since I'm also in the progress of linking several guild- and raidbots together, I experienced all the problems I never thought there would be. Even reading the guide (http://bebot.link/wiki/org_relay) it didn't work and I have to admit I didn't find it very helpful.
Now that all is working properly, I do hereby volunteer to write a better, more complete one which will describe how to setup guild-bots and relay-bot in detail. Well... or I will just edit the current one if nobody takes offence.
Do you feel there's a need to rewrite the mentioned guide?

Greetings

- Pigtail
Title: Re: How to relay to multiple org bots?
Post by: clashbot on April 08, 2009, 04:56:56 pm
I have no problem with a rewrite as some of the information is dated, especially concerning some of the newer aspects of relay (namely DB relay). I am currently running 11 bots.

5 of which are in a relay, a relay bot hub, a raid bot,  and 4 different org bots.

once the slave module is available again, this will probably add two more "bot" toons. And there are talks in the works for adding two more orgs to the relay as well.

I could cut out a number of bots if there was a way of modifying online to offer arguments of org only/alliance, as some of the bots are redundant just for the separate online listings.

Oh, would like to add, I have used the IRC as a relay hub when I actually had a guild on AoC. That also worked well, but will admit, a lot of it was test-break-fix-test-success attempts.
Title: Re: How to relay to multiple org bots?
Post by: Pigtail on April 09, 2009, 01:16:06 pm
Hello Clashbot!

Now the only question remaining is: will you do the rewrite or do you want me to do it myself? There are certain fields in which I have no expertise. I have, for example, never used shared online-lists or a database as a relay and don't know if they would still work as described. I can try that, though it might take me some time to do all the testing needed for all kinds of setups.
I can very well start with describing the setup which I use (which is what most people will most likely use) and how to do it and other people can contribute and complete the guide.
What sayest thou, Clashbot?

- Pigtail
Title: Re: How to relay to multiple org bots?
Post by: clashbot on April 09, 2009, 01:17:55 pm
lol, I'll let you do the writing, and I can play guinea pig at the expense of my orgs..hehe
Title: Re: How to relay to multiple org bots?
Post by: Pigtail on April 09, 2009, 01:41:04 pm
\o/ Hooray! I'll see what I can come up with ;)
Title: Re: How to relay to multiple org bots?
Post by: Pigtail on April 15, 2009, 10:48:30 am
Hi all!

As promised, I rewrote the kinde outdated documentation (http://bebot.link/wiki/org_relay). Feel free to drop me a note with comments and/or suggestions on how to improve. Enjoy!

- Pigtail
Title: Re: How to relay to multiple org bots?
Post by: Alreadythere on April 15, 2009, 01:23:16 pm
That's a really excellent write-up, Pigtail!

Some small comments:
Reading your guide I think we should add a way to notify other bots in a relay about changes in the online status with a specific command, like we do for timers. That way you won't have to do any complicated secondary setups just for this purpose.
Title: Re: How to relay to multiple org bots?
Post by: Pigtail on April 15, 2009, 02:54:37 pm
Thanks for reading and commenting, Alreadythere!
I edited the guide according to your comments, and yes, I also think that a way to synchronize the online-lists would be very nice. Though it looks like it wouldn't be too hard to do. Just add an optional parameter do status_change() (to specify the bot), let the bot announce joins/leaves to the relay-group and act according to such announces. Well... and leaving/joining the relay-bot's private group should also trigger a sync ... oh boy! More work than I thought ;D. Any plans on this?

- Pigtail
Title: Re: How to relay to multiple org bots?
Post by: Alreadythere on April 15, 2009, 03:24:34 pm
Let's say it's something like #12345 on my todo list ;)
Title: Re: How to relay to multiple org bots?
Post by: Khalem on April 15, 2009, 03:29:11 pm
Great job.

I'll look closer at it later, but offhand i would like to have a mention alongside the tells mentioning that you run the risk of having your bot banned with no warning by Funcom by using tells relay. It probably should be ripped out of the bot altogether.
Title: Re: How to relay to multiple org bots?
Post by: Pigtail on April 15, 2009, 03:52:24 pm
Aye, added that remark to the guide. I didn't even know you could have your bot banished for tell-relays. Glad I convinced my org to switching to a pgroup-relay ;)
Title: Re: How to relay to multiple org bots?
Post by: Khalem on April 15, 2009, 07:29:33 pm
Ok. I've had the time to take a closer look at this, and attempted to follow the relay pgroup guide to the letter :)

First off i would recommend enclosing all botnames using "" or <> to make sure they stand out properly. I actually found myself pasting
Code: [Select]
/tell org1bot !set Relay Relay rbot

Directly causing me to set relay bot to rbot :P

Code: [Select]
/tell org1bot addgroup relaybots All bots from which we want to receive messages
/tell org1bot admin group add relaybots

This section is missing command prefix, and also the second line does not make any sense to me, then again i might be missing something.

Overall, great guide and i have to say i really appreciate you taking the time to clean it up :)

I did not end up with a working relay, but i have not had time to investigate why as of yet. Bots would join, and online updates where sent. But for some reason unknown to me, one of the bots simply refused to relay orgchat despite settings being correct.

Final note, which i almost forgot and is another reason tell relay should just be removed from the bot:
Tells are:
1) Throttled, meaning that if you send several tells in rapid succession, you will see tells being slowed down by the chatserver (or at least AO client, but i do believe the enforcement is serverside)
2) After x tells in x seconds, the chatserver starts simply dropping tells. In any guild with say more than 5 events every 10 seconds this means you will have loss of information occuring.
Title: Re: How to relay to multiple org bots?
Post by: Pigtail on April 16, 2009, 08:48:25 am
Hallo Khalem!

Thanks for taking thetime and cross-checking the guide. I really appreciate it.

First off i would recommend enclosing all botnames using "" or <> to make sure they stand out properly. I actually found myself pasting
Code: [Select]
/tell org1bot !set Relay Relay rbot

Directly causing me to set relay bot to rbot :P

Okay, done that. I actually did the same once. Guess it's better this way ;D

Code: [Select]
/tell org1bot addgroup relaybots All bots from which we want to receive messages
/tell org1bot admin group add relaybots

This section is missing command prefix, and also the second line does not make any sense to me, then again i might be missing something.

*yikes* added the missing exclamation marks, thanks. As for the second line... I found the group after a simple "!addgroup" not being listed with "!security levels". Only after I did that "!admon group add relaybots" was I able to see and change the access level for the group. Might as well have been a bug or other mistake on my side. I'll look into it this evening and check if it's really necessary or not. Thanks for pointing it out, because people could get an error if the group already existed. Nothing you would like a guide to produce ;)

I did not end up with a working relay, but i have not had time to investigate why as of yet. Bots would join, and online updates where sent. But for some reason unknown to me, one of the bots simply refused to relay orgchat despite settings being correct.

Please let me know if you found the reason. I wrote this  guide while I was configuring all my 4 bots + 1 relay. When all was working, I kind of followed my own guide step by step then and corrected it until it worked. But it might very well be that something really is amiss. After all I set several options directly via MySQL, because I was too lazy to look up how to set them via tells  ::) I might have screwed some things up there...

Final note, which i almost forgot and is another reason tell relay should just be removed from the bot:
Tells are:
1) Throttled, meaning that if you send several tells in rapid succession, you will see tells being slowed down by the chatserver (or at least AO client, but i do believe the enforcement is serverside)
2) After x tells in x seconds, the chatserver starts simply dropping tells. In any guild with say more than 5 events every 10 seconds this means you will have loss of information occuring.

I added exactly this to a footnote in the tell-relay. If this won't convince people to use pgroups, I don't know what will ;) I just don't think not describing tell- and irc-relays in detail will do any good. Better to have documented all the drawbacks, so people can decide for themselves.

- Pigtail
Title: Re: How to relay to multiple org bots?
Post by: Khalem on April 18, 2009, 03:36:42 pm
No idea why it wouldn't work properly first time around, but it works flawlessly now.

In case anyone wants to play around with a small change I've made to the relay allowing the names of someones main character to be suffixed to the character they are on when relaying text.

Ie, when I'm on an alt, others on the relay will see him like this:
Alt (Khalem): text

Also added a setting to truncate the main's name with default of 6 characters.

Diff:
http://bazaar.launchpad.net/~bebot-devel/bebot/stable-0.6/revision/14

Full file:
http://bazaar.launchpad.net/~bebot-devel/bebot/stable-0.6/annotate/head%3A/modules/Relay.php
Title: Re: How to relay to multiple org bots?
Post by: Pigtail on May 07, 2009, 08:57:55 am
Hiya!

I'm glad to hear all works well now. After several weeks of illness, I'm finally back and already started coding  a module that syncs the online-list of all bots in the relay. It's not perfect, but it works. The only problem I have is that there's no hook for "joining a private group". I can react to the relay-invite, but not  to the join. So I had to change Relay.php and add a call to my own module. Would maybe be nicer to add that hook to the AOChat-lib.

Anyway... the basic idea is that all connected bots issua commands like this on the private group:

Code: [Select]
[relay] org1bot: !onlinelist user:Pigtail where:gc status:1
when I join the guildchat (aka coming online) and

Code: [Select]
[relay] org1bot: !onlinelist user:Pigtail where:pg status:0
when I leave the private group of a bot. When a bot enters the relay-chat, it ask all bots to clear the online-list for this bot and then sends who's online right now. Afterwards, itasks the other bots to send theironlinelist, too, so everyone is in sync. This looks like this:

Code: [Select]
[relay] org1bot: !onlinelist clear
[relay] org1bot: !onlinelist user:Pigtail where:pg status:1
[relay] org1bot: !onlinelist user:Foobar where:pg:1
[relay] org1bot: !onlinelist updateme

[relay] org2bot: !onlinelist clear
[relay] org2bot: !onlinelist user:Piggyfix where:gc status:1

[relay] org3bot: !onlinelist clear
[relay] org3bot: !onlinelist user:Pigtestsx where:gc status:1
[relay] org3bot: !onlinelist user:Pigtestsmore where:gc status:1
[relay] org3bot: !onlinelist user:Pigohpig where:gc status:1

Every bot stores the onlinelist in its database and sets it according to the bot who sent the !onlinelist. So after setting OtherBots, even !online sort of works (sort of, because the output is a mess since private groups shwo up double), which I overcameby enhancing the OnlineDisplay.php as well.
I'm using this module for 4 connected bots now and it works like a charm. Right now, it can generate a lot of messages when a bot restarts which is why I'm thinking about bundling those messages with user:a,b,c,d and so on. Any thoughts on this or maybe even only on adding a hook to joining a channel (that is sending the join-package)?
Also, I had to modify OnlineDisplay.php so it has another group "XX On Other Bots". I wonder why no one has ever done that before. The current sharing of online-lists with using a DB looks terribly without having an own group and shows a lot of things more than once. Anyone wants to take a look at my proposed changes?

Cheerio

- Pigtail
Title: Re: How to relay to multiple org bots?
Post by: Temar on May 07, 2009, 08:22:34 pm
i have already done this for my bots i have it posted here
and has already been added to the official BeBot
http://bebot.link/0-6-x-customunofficial-modules/public-relay/
Title: Re: How to relay to multiple org bots?
Post by: Pigtail on May 08, 2009, 08:35:40 am
Hey Temar!

Now I'm feeling a bit stupid, but since AlreadyThere wrote that someone needs to work on online-sync, I simply assumed, there was no solution around at all. Funny thing is, you and me ended up with the same solution, only my approach was to use a module of its own instead of modifying Relay.php. Well, thanks to your code, I finally learned about extpgjoin-event, so I don't even need to touch Relay.php at all anymore *cheers*

Since you have already committed these enhancements, there's no need for me to keep working on my module any more. You might want to do a $this -> bot -> core("whois") -> lookup (<person who joined>) though whenever the bot is told about someone joining pg or gc.
Forgive my double-coding *puts on his hat of shame +3*

- Pigtail
SimplePortal 2.3.7 © 2008-2024, SimplePortal