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

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

Author Topic: Web GuildChat Module  (Read 43450 times)

0 Members and 1 Guest are viewing this topic.

Offline URFUBAR

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Web GuildChat Module
« on: July 17, 2008, 09:12:55 am »
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: [Select]
/tell bot !webchat register mypass
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: [Select]
/tell bot !webchat to list all the webchat registered users (color coded based on whether they are logged into webchat or blocked access).

Code: [Select]
/tell bot !webchat block playername
/tell bot !webchat allow playername

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.
« Last Edit: July 17, 2008, 12:10:39 pm by URFUBAR »

Offline CheRny

  • BeBot Rookie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: Web GuildChat Module
« Reply #1 on: July 17, 2008, 09:28:36 am »
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 :)

Offline URFUBAR

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Web GuildChat Module
« Reply #2 on: July 17, 2008, 11:30:58 am »
But if I wanna test it at least you need to post your module php here :)
lol will do, just in work at the moment and won't be able to upload until this evening.

Offline Organizer

  • BeBot Apprentice
  • ***
  • Posts: 135
  • Karma: +0/-0
Re: Web GuildChat Module
« Reply #3 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? 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..

Offline URFUBAR

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Web GuildChat Module
« Reply #4 on: July 17, 2008, 11:41:16 am »
Sound cool, but I presume this only works if the webchat is running on the same machine that the bot is running on?

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.

« Last Edit: July 17, 2008, 12:09:44 pm by URFUBAR »

Offline Vrykolas

  • BeBot Apprentice
  • ***
  • Posts: 100
  • Karma: +0/-0
Re: Web GuildChat Module
« Reply #5 on: July 17, 2008, 01:45:39 pm »
rather than redirecting the output you could write a module that parses guild chat as the bot recieves it and checks the web chat every so often....
kind of like this
Code: [Select]
$web_chat = new web_chat(&$bot);

/*
The Class itself...
*/
class web_chat Extends BaseActiveModule
{
var $bot;


/*
Constructor:
Hands over a referance to the "Bot" class.
*/
function __construct (&$bot)
{
parent::__construct(&$bot, get_class($this));
$this -> register_event('gmsg', 'org');
$this -> register_event('cron', '2sec');

$this -> help['description'] = "Passes guild chat to the web chat and back.";
}

function command_handler($name, $msg, $origin)
{
$this->error->reset(); //Reset the error message so we don't trigger the handler by old error messages.
return;
}

function gmsg($name, $group, $msg)
{
// Code to pass guild chat to web chat here
}

function cron()
{
// Code to pass web chat to guild chat here
}
}

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Web GuildChat Module
« Reply #6 on: July 17, 2008, 02:21:43 pm »


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.


you could have the bot use an address on a remote sever to pass messages on like..
Code: [Select]
$address = "http://www.mywebserver.com/add.php?name=gamename&msg=hi!";
BTW i also have a Webchat Module i call AOWC, mine can do simple guild chat aswell as full login and chat
« Last Edit: July 17, 2008, 02:24:59 pm by Temar »

Offline URFUBAR

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Web GuildChat Module
« Reply #7 on: July 17, 2008, 02:36:22 pm »
BTW i also have a Webchat Module i call AOWC, mine can do simple guild chat aswell as full login and chat
lol that would have saved me the effort. Is it available for download?

Offline URFUBAR

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Web GuildChat Module
« Reply #8 on: July 17, 2008, 02:39:26 pm »
rather than redirecting the output you could write a module that parses guild chat as the bot recieves it and checks the web chat every so often....
kind of like this

wow, should have read the manual or at least looked at the parent class code!

many thanks!

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Web GuildChat Module
« Reply #9 on: July 17, 2008, 03:45:57 pm »
http://svn.aofiles.com/svn/AOWC_Lite/

put AOWC.php from /bot/ in the bot module folder

the Rest go in the webserver

this currently designed to work with SMF or PHPBB
it uses user detail from those, i plan on writeing a 3rd option of an intneral login so those forums arnt required but not done yet.

use the prefs.sql file to add the required table

Sorry i havnt bothered with a good Install file yet :p

Offline Vain

  • BeBot User
  • **
  • Posts: 57
  • Karma: +0/-0
Re: Web GuildChat Module
« Reply #10 on: July 19, 2008, 09:51:51 am »
But if I wanna test it at least you need to post your module php here :)
lol will do, just in work at the moment and won't be able to upload until this evening.

Any progress?
I would love to use this.  ;D

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Web GuildChat Module
« Reply #11 on: July 19, 2008, 06:36:11 pm »
working on an install file. Will make official release of aowc later today

Offline elvyne

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Web GuildChat Module
« Reply #12 on: July 22, 2008, 01:10:13 am »
what webserver program do you recommend running this on =/ I dont understand apache that well so yeah. Btw any luck on the installer?

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Web GuildChat Module
« Reply #13 on: July 22, 2008, 01:46:43 am »
installer is done and AOWC has been released, ill be releaseing 1.5 with in the hour

http://bebot.link/0-5-x-customunofficial-modules/aowc/

Offline krillin

  • BeBot Rookie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: Web GuildChat Module
« Reply #14 on: July 22, 2008, 09:14:12 am »
To bad that i'm using none of the mentioned forums :(

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


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


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

* Who's Online
  • Dot Guests: 288
  • 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