I promissed khalem I'd post this, so here it goes.
Currently things like items etc aren't relayed properly.
Also when using IRC to relay between guilds the output is a bit dodgy like:
[Your Guild] Bot: [IRC] Otherbot: [Their Guild] Someguy: hi
To solve this without affecting the readability on IRC, I build a very small protocol using "hidden characters".
I have currently implemented this in VhaBot and it would be nice if more bots adopt it.
Some basic information:
[BOLD]: Character 2
[REVERSE]: Character 22
[UNDERLINE]: Character 31
[COLOR]: Character 3
These are all characters used by most IRC clients to format text.
They function as a toggle. each appearance of the character reverses the effect. (placing a bold makes the text bold, placing another makes the text normal again).
We can abuse this by placing them in sets of 2, which means they are visually invisible to the users (on any modern irc client).
Message relaying:
Before: [Channel] Nickname: message
After: [BOLD][BOLD][BOLD][Channel][BOLD] Nickname: message
It starts with 2 bold characters, followed by the [Channel] outputted as bold.
When receiving a message following this structure, you don't display [IRC] Botname: [Channel] Nickname: message
but directly display: [Channel] Nickname: message
Also, this is the way it's currently implemented in IGN. while it may be a dying piece of crap, some compat never hurts.
All bold characters are required.
Items relaying:
Before: check this item Burden of Incompetence (
http://url to auno/aodb)
After: check this item [COLOR][COLOR]Burden of Incompetence[COLOR] [COLOR](
http://auno.org/ao/db.php?id=123&id2=123&ql=200)[COLOR][COLOR]
The space between the second set of [COLOR] is intentional.
There's also an id2= added to the url. this is done because while auno only need 1 id to operate, we need both to generate a valid item ingame.
Some patterns I'm using for this:
this.ItemFormat = this.COLOR + this.COLOR + "{0}" + this.COLOR + " " + this.COLOR + "(
http://auno.org/ao/db.php?id={1}&id2={2}&ql={3})" + this.COLOR + this.COLOR;
this.ItemPattern = this.COLOR + this.COLOR + "(.+?)" + this.COLOR + " " + this.COLOR + "[(](.+?)id=([0-9]+)&id2=([0-9]+)&ql=([0-9]+)[)]" + this.COLOR + this.COLOR;
First line is the way we format it, second line is the regexp for finding the messages.
On the first line replace {0} with the item name, {1} with the lowID, {2} with the highID, {3} with QL
(LowID doesn't mean the ID is lower than HighID. it means the associated QL with that ID is lower than the QL of the HighID. in case of doubt, just use how AO sends it to you)