collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Improving relay over IRC  (Read 11884 times)

0 Members and 3 Guests are viewing this topic.

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Improving relay over IRC
« on: March 07, 2007, 07:27:33 am »
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)
« Last Edit: May 04, 2007, 10:18:47 pm by Vhab »

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Improving relay over IRC
« Reply #1 on: March 09, 2007, 11:56:04 pm »
Thanx Vhab.

Been giving this some thought as of late. Just need time :\
BeBot Founder and Fixer Kingpin

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: Improving relay over IRC
« Reply #2 on: March 16, 2007, 07:25:34 pm »
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?

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Improving relay over IRC
« Reply #3 on: March 16, 2007, 08:50:36 pm »
Moved to 0.2 support, lemme know if you want it anywhere different.

-jj-

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
Re: Improving relay over IRC
« Reply #4 on: March 17, 2007, 02:51:23 am »
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..:)
Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Improving relay over IRC
« Reply #5 on: May 04, 2007, 07:26:29 pm »
What char is [COLOR]? Or is that something else? Got no real clue about IRC tbh :)

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: Improving relay over IRC
« Reply #6 on: May 04, 2007, 10:18:28 pm »
my bad, seems i forgot that one.
it's ascii 3

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Improving relay over IRC
« Reply #7 on: May 05, 2007, 12:25:54 pm »
Implemented and working, just got to wait for the SVN to be back up to commit it.

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: Improving relay over IRC
« Reply #8 on: May 05, 2007, 12:29:24 pm »
nice :D

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Improving relay over IRC
« Reply #9 on: May 05, 2007, 01:25:48 pm »
One question:

Code: [Select]
$msg = preg_replace("/<a href=\"(.+)\">/isU", "[link]", $msg);
$msg = preg_replace("/<\/a>/iU", "[/link]", $msg);
$msg = preg_replace("/<font(.+)>/iU", "", $msg);
$msg = preg_replace("/<\/font>/iU", "", $msg);
The code above is in the gmsg() and privgroup() functions, removing ingame blobs and colors.

Is there any way to format it in a decent way for IRC while saving all information so the tags can be recreated on the other bots of the relay?

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: Improving relay over IRC
« Reply #10 on: May 05, 2007, 02:44:50 pm »
don't think so, firstly because of the size of the blobs, it'll easy hit the irc max and flood limit.
also, you'll have to visualize all data on the irc side in some way, and spamming the full contents of a blob to irc is a tad too spammy imo.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Improving relay over IRC
« Reply #11 on: May 05, 2007, 02:49:42 pm »
The only way I see such a thing fesable is if someone runs a command and then have the bot reply in /msg-s.

Well you could always write the blob to a file and post it to a web-server or such. :)
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Improving relay over IRC
« Reply #12 on: May 05, 2007, 02:52:55 pm »
I'll just leave it then.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Improving relay over IRC
« Reply #13 on: May 06, 2007, 01:04:24 am »
SVN is up. I know it's been a bit unstable in the past few days.

We are experiencing some hardware issues with this system as it has frozen up completely 5 or 6 times now in the past few days.

A hardware swap is planned asap which hopefully will bring SVN back to being stable.
BeBot Founder and Fixer Kingpin

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Improving relay over IRC
« Reply #14 on: May 06, 2007, 01:07:25 am »
Commited.

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 490
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal