Archive > BeBot Hyborian modules

Web GuildChat Module

(1/6) > >>

URFUBAR:
Wrote a simple module last night that allows you to access guild chat from any web browser. It works like this:

From within the game you must first register and set yourself a webchat password using:


--- Code: ---/tell bot !webchat register mypass
--- End code ---

once you've done this you can login to the webchat php page using your player usename and webchat password.

Other in game commands include:


--- Code: ---/tell bot !webchat
--- End code ---
to list all the webchat registered users (color coded based on whether they are logged into webchat or blocked access).


--- Code: ---/tell bot !webchat block playername
/tell bot !webchat allow playername
--- End code ---

Thats it really.

Obviously the webchat sends all its messages as the bot user and therefore in-game chat sessions will look like this.

[Guild][Bot][Bob]Hi there, Bob here on webchat from work
[Guild][Bill]Hi Bob I'm at home playing!
[Guild][Tom]Hi Bob, some PVP later?
[Guild][Bot][Bob]Sounds good, I'll be logging in aroudn 5pm
[Guild][Bot][Fred]Count me in too!

anyway thats it, will post up the code later just in case anyone is interested. It's not perfect, and I still need to add code so that chat hyperlinks work as per in the game (items links won't work though).

Can't upload the module from work but I've attached a screenshot until I can do the upload later this evening.

CheRny:
Great! I am using Bebot IRC relay which is an official module in the bot, but I'll be great to test your module too. But if I wanna test it at least you need to post your module php here :)

URFUBAR:

--- Quote from: CheRny on July 17, 2008, 09:28:36 am ---But if I wanna test it at least you need to post your module php here :)

--- End quote ---
lol will do, just in work at the moment and won't be able to upload until this evening.

Organizer:
Sound cool, but I presume this only works if the webchat is running on the same machine that the bot is running on? In my case my own pc for the bot and if we would like to use this it would have to be our our external webhost..

URFUBAR:

--- Quote from: Organizer on July 17, 2008, 11:33:55 am ---Sound cool, but I presume this only works if the webchat is running on the same machine that the bot is running on?

--- End quote ---

yes, it's a bit basic (only a couple of hours work) and simply tails (and parses) the bebot output file to get messages from guildchat. To send messages in, the web script simply writes to a database which the webchat bot module checks every couple of seconds. If it finds anything it prepends the sender to the message and then sends it to the guild chat channel.

I suppose we could redirect bebot output to a php script which in turn writes to a database. But you'd obviously have to open a hole in your firewall at home to allow mysql requests to come in from the net.

Will add this functionality if its required, sounds pretty straightforward.

Also by adding some access controls to webchat, users could perform remote web admin of bebot using the same interface. This could be useful.

Navigation

[0] Message Index

[#] Next page

Go to full version