Development > Coding and development discussion

Improving relay over IRC

(1/6) > >>

Vhab:
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)

Khalem:
Thanx Vhab.

Been giving this some thought as of late. Just need time :\

Vhab:
Seeing there's some development regarding IRC going on by non-contributors (no offense intended, refering to people without access to the contributors forum) can this post be moved to a public sub-forum?

jjones666:
Moved to 0.2 support, lemme know if you want it anywhere different.

-jj-

Nytridr:
I have posted this before somewhere else.. but atm really just to sick to look for it.. but here is some of the mods I made for the alliance I am in.. and it seems to work halfway decent..

I have added a lang filter which you can turn it on and off while in game..

put a limit that the IRC will send out that way if something is to long it will just not send it..

took out the formating changing in the sending and reciving for now.. till either I can figure out how to do it correctly or someone else can.. with the items across the IRC.. since on the reciving side it needs to be reconverted back into a workable link.

http://metanyt.homeip.net:8888/bebot/


since to me it seems things should problably be under the same topic I figured I would repost it here.. that way who ever wants to look my simple changing of things can..:)

Navigation

[0] Message Index

[#] Next page

Go to full version