L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2008, 02:26:30 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Module Requests > Topic: Relay coloring on recieving end.
Pages: [1] 2   Go Down
« previous next »
Print
Author Topic: Relay coloring on recieving end.  (Read 842 times)
0 Members and 1 Guest are viewing this topic.
johskar
Rookie
**
Offline Offline

Posts: 50


Relay coloring on recieving end.
« on: January 26, 2008, 11:09:46 PM »

Not realy a module request tho but....
Me and the girlfriend patched together a relay module by disecting the orignal Relay_GUILD.php and patching it up again as a separate module to use in an alliance relay, where we now need to find a way to set colors on the recieving end instead of the transmitting side and hope someone can help us with that....

Annyhow, the code is attatched to this message and it's probably  messy as hell, but it works werry well for our now 10bot and growing relay network, and now we hope you lot can help us out on the coloring part as it's "fun" watching the rainbows as all the senders are sending their own defined colors to the rest of the alliance:)


Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1088


Re: Relay coloring on recieving end.
« Reply #1 on: January 27, 2008, 07:38:36 AM »

Interesting idea.

To colorize on the receiving side you need to remove the color tags added on the sending side before relaying (or just remove those you don't want anymore), those are in one of the relay_to_xyz() functions. Just check where the color schemes are used.
On the receiving side you then need to check the sender against your color list and simply add the color tags you want before calling the send_output() function.
Logged
johskar
Rookie
**
Offline Offline

Posts: 50


Re: Relay coloring on recieving end.
« Reply #2 on: January 27, 2008, 02:26:40 PM »

that would color the entire thing with the same color or would it then be possible to split the message in to different colors like when we assemble it before it is sent?
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1088


Re: Relay coloring on recieving end.
« Reply #3 on: January 27, 2008, 02:40:52 PM »

You will have to parse the incoming relayed chat if you want to color it differently depending on the parts, most likely something like checking for text between [] for the guild name and text between ] and : for the character name.
Something like preg_match("/^[(.+)] (.+): (.+)$/i", $msg, $info) would give you org string in $info[1], name of the sending character in $info[2] and the chat in info[3]. Not sure if [] and : need to be escaped in the regular expression...
You may have to check for <font color=""></font> tags in the incoming chat too...
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 887



WWW
Re: Relay coloring on recieving end.
« Reply #4 on: January 27, 2008, 02:47:54 PM »

won't it be easier to set colour in bot that sends using ##".$this -> bot -> settings -> get(   )."## text ##end##
Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1088


Re: Relay coloring on recieving end.
« Reply #5 on: January 27, 2008, 02:51:09 PM »

That's the easiest way, true.

Though as I understand it johskar wants a solution working on the receiving bot, I guess that's the only one he can control.
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 887



WWW
Re: Relay coloring on recieving end.
« Reply #6 on: January 27, 2008, 03:00:19 PM »

well if he want to colour the bots on recieveing end then maybe a good way is prob set a colour too a botname then have it use that colour for relays from that bot
Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 887



WWW
Re: Relay coloring on recieving end.
« Reply #7 on: January 27, 2008, 03:46:53 PM »

i had a good idea!
At the moment im at work using my mobile
I finish in 2 hours then ill do it and post it for you
Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 887



WWW
Re: Relay coloring on recieving end.
« Reply #8 on: January 27, 2008, 06:51:51 PM »

ok i havnt done what you want as im not sure exactly what you want
but i did notice a big problem with ur module
u repeat WAY TOO MUCH
i have changed it so it doesnt repeat code
and adding more bots too your code is very simple , you only have to edit 1 line Grin

module is about 1/3 the original size now :p
« Last Edit: January 28, 2008, 02:17:25 AM by Temar » Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
johskar
Rookie
**
Offline Offline

Posts: 50


Re: Relay coloring on recieving end.
« Reply #9 on: January 27, 2008, 11:08:08 PM »

Quote from: Temar on January 27, 2008, 03:00:19 PM
well if he want to colour the bots on recieveing end then maybe a good way is prob set a colour too a botname then have it use that colour for relays from that bot
so for ONE relay wich contains over 10 bots we'd then have to set the color on each of those even tho it's intended that those are going to use the same color?
the relay module has 5 separate relays, on wich each can use ither a tell to ONE bot or a privgroup to talk to multiple bots
Logged
johskar
Rookie
**
Offline Offline

Posts: 50


Re: Relay coloring on recieving end.
« Reply #10 on: January 27, 2008, 11:09:56 PM »

Quote from: Temar on January 27, 2008, 06:51:51 PM
ok i havnt done what you want as im not sure exactly what you want
but i did notice a big problem with ur module
u repeat WAY TOO MUCH
i have changed it so it doesnt repeat code
and adding more bots too your code is very simple , you only have to edit 1 line Grin

module is about 1/3 the original size now :p
Yes it's a dirty code, but it was working well ;P (except for the coloring)

Thank you for the shrinking code, but with your version I get this error:
Code:
Parse error: syntax error, unexpected T_FOREACH in /<removedpath>/Alliance_Relay.php on line 70
« Last Edit: January 27, 2008, 11:54:44 PM by johskar » Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 887



WWW
Re: Relay coloring on recieving end.
« Reply #11 on: January 28, 2008, 02:18:16 AM »

Yer was untested, i had some probs connecting to my server,
anyway i removed the few typos and tested it loads
Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
johskar
Rookie
**
Offline Offline

Posts: 50


Re: Relay coloring on recieving end.
« Reply #12 on: January 28, 2008, 11:59:03 AM »

The way I/We want it is that it colors the messages it recieve from each channel separately, instead of when it sends it, cause then each guild can choose what color they want on their separate relays, but have the same color on every guild in the same relay, this so that we don't spam in all of the colors in the rainbow when we are chatting, like we do now, cause some has set colors and some have not.

Your module works after fix btw, ty Smiley
Logged
johskar
Rookie
**
Offline Offline

Posts: 50


Re: Relay coloring on recieving end.
« Reply #13 on: February 18, 2008, 02:15:02 PM »

This is what we ended up with in the end Smiley
(well.. haven't cleaned out stuff that's commented out due to not being in use annymore yet tho Roll Eyes)
Logged
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: Relay coloring on recieving end.
« Reply #14 on: February 18, 2008, 05:08:36 PM »

The send_output function does not have support for removing color tags, but if I recall correctly the send_tell function does. Check Bot.php to be sure...

This won't remove color tags that were added before you passed your output string to send_tell, it just prevents send_tell from adding color tags. If you want to remove all color tags you would have to remove them from your string before sending the string to send_tell...
Logged
Pages: [1] 2   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Module Requests > Topic: Relay coloring on recieving end.
« previous next »
 
Jump to:  

Recent
Bot not working after tod...
by Alreadythere
[Today at 01:04:41 PM]

Tokens Calulator
by Temar
[December 03, 2008, 01:09:03 PM]

Bebot does not work with ...
by IKShadow
[December 03, 2008, 08:54:04 AM]

!items database
by Temar
[December 03, 2008, 07:27:59 AM]

massive_pvp_time_table 1
by Sudoka
[December 03, 2008, 06:49:07 AM]

Log playtime from buddys ...
by IKShadow
[December 02, 2008, 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]
Stats
Members
Total Members: 1246
Latest: Vingus
Stats
Total Posts: 11190
Total Topics: 1507
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 6
Guests: 14
Total: 20
scape
Organizer
vikor
Snarfblatt
Whackoeng

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.541 seconds with 28 queries. (Pretty URLs adds 0.051s, 4q)
Loading...