BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Module Requests => Topic started by: uberjon on July 26, 2009, 01:06:55 am

Title: simplified IRC module?
Post by: uberjon on July 26, 2009, 01:06:55 am
I had a brain storm of a great idea for bebot. one that i hope should be fairly simple..

forum shoutbox to guild chat and reverse of course.

quite simply anything typed into the shoutbox would be replicated on guild chat by the bot. anything typed in guild chat would be replicated into the guild shoutbox (via direct insert of the database)

the database structure is quite simple.

Code: [Select]
s_id // auto increment
s_id // member id would be 0 in this case for guest.
s_date // would be date()
s_message // would be the message
s_ip // would be 127.0.0.1
s_edit // would be null

unfortunately i have limited knowledge of php "classes" so it may take me a while (possibly a long while) to do this myself. so i am requesting help on this. i assume it would be quite easy?

~uberjon (one and same from SMF forums)
Title: Re: simplified IRC module?
Post by: clashbot on July 26, 2009, 01:08:42 am
uber, it would be nice if you could expand this to include the ajaxchat integration in some smf forums. I personally don't use the shoutbox, but do have the ajaxchat
Title: Re: simplified IRC module?
Post by: uberjon on July 26, 2009, 01:32:52 am
uber, it would be nice if you could expand this to include the ajaxchat integration in some smf forums. I personally don't use the shoutbox, but do have the ajaxchat


*blush* hehe. well i could possibly look into that. however i am quite unfamliar with the bebot code end of things.. thats why im posting here.

i believe it would be entirely possible for my needs to have this done without any edits to the forum im using (thats not smf actually..)

but if its possible to do it as easy via the database for your needs, whatever anyone here comes up with should work for you too.
Title: Re: simplified IRC module?
Post by: Khalem on July 26, 2009, 02:14:05 am
I'm a bit swamped atm, so I unfortunately don't have any time to spare for this.

You should not worry too much about PHP classes for what you want to do. A good starting point would be the example module: http://bazaar.launchpad.net/~bebot-devel/bebot/stable-0.6/annotate/head%3A/modules/example/_ExampleModule.php


Title: Re: simplified IRC module?
Post by: uberjon on July 26, 2009, 04:03:33 am
I'm a bit swamped atm, so I unfortunately don't have any time to spare for this.

You should not worry too much about PHP classes for what you want to do. A good starting point would be the example module: http://bazaar.launchpad.net/~bebot-devel/bebot/stable-0.6/annotate/head%3A/modules/example/_ExampleModule.php




that has helped a great deal! i am stuck on one part though i think.

having the bot speak in guild chat. no idea where to find such a function/class. could you point me in the direction to have a custom module do that?

im hoping its something simple thats already included when the module gets loaded by the bot. such as say() or such?
Title: Re: simplified IRC module?
Post by: Alreadythere on July 26, 2009, 10:40:35 am
$this->bot->send_gc("I want to say something too!") is your friend ;)
And it works in all modules (well at least all modules extending the BaseModules).

If you want to colorize stuff check out the color module for color tags, they are enclosed in ##tagname##.
Title: Re: simplified IRC module?
Post by: uberjon on July 26, 2009, 06:46:13 pm
$this->bot->send_gc("I want to say something too!") is your friend ;)
And it works in all modules (well at least all modules extending the BaseModules).

If you want to colorize stuff check out the color module for color tags, they are enclosed in ##tagname##.

thanks, the send_gc seems to be what i needed. however now it seems once setup that my method of "catching guild chat talk" to send to the shoutbox db is indeed not correct.

could you or someone help on this as well? i currently have a 1-way chat possible :p (website > conan chat) instead of (website <> conan chat)
Title: Re: simplified IRC module?
Post by: Khalem on July 26, 2009, 07:23:11 pm
First register the apropriate event (assumes you are extending BaseActiveModule)
Code: [Select]
$this->register_event("gmsg", "org");

Then add the function to handle the message
Code: [Select]
function gmsg($name, $group, $msg)
{
}
Title: Re: simplified IRC module?
Post by: uberjon on July 27, 2009, 04:06:39 am
uber, it would be nice if you could expand this to include the ajaxchat integration in some smf forums. I personally don't use the shoutbox, but do have the ajaxchat


can you tell me specifically the SMF version and the mod link/version so i may look into porting this? (assuming you ain't going to judge my code as long as it doesnt break something.. not the best :p)
Title: Re: simplified IRC module?
Post by: clashbot on July 27, 2009, 01:18:21 pm
I'm running smf 1.1.9 with TP.

Link to the ajax mod is http://custom.simplemachines.org/mods/index.php?mod=1319 (http://custom.simplemachines.org/mods/index.php?mod=1319)

If you would like to see how it operates currently, you can visit my org forums, register, and will let you take a look. Send me a pm if this is something you would like to do.
Title: Re: simplified IRC module?
Post by: Khalem on July 27, 2009, 03:20:25 pm
I'm running smf 1.1.9 with TP.

You really should update your SMF install ;)
Title: Re: simplified IRC module?
Post by: clashbot on July 27, 2009, 03:35:18 pm
oops, tells how often I head into the admin section.. heh, 1.1.10 now
Title: Re: simplified IRC module?
Post by: clashbot on July 27, 2009, 03:53:39 pm
funny thing is khalem, I had upgraded my forums for eve, forgot to upgrade my one for anarchy.

Title: Re: simplified IRC module?
Post by: uberjon on August 03, 2009, 06:10:04 pm
oops, tells how often I head into the admin section.. heh, 1.1.10 now


hehe. sorry for the continuous delay.. but im having some issues getting the ajaxchat to install... even when i update the .zip myself to fix the version error i still get the error... weird.. :( il have to continue trying though!
Title: Re: simplified IRC module?
Post by: clashbot on August 03, 2009, 06:14:15 pm
ajaxchat is notorious for not installing correctly, especially with prettyurls installed. You might want to search through the forum support on ajaxchat for clashbot there as well as I had issues getting it installed easily as well.

Unless I am spewing random nonsense because you are not talking about ajaxchat for smf, in which case ignore my previous ramble ;D ;D ;D
Title: Re: simplified IRC module?
Post by: uberjon on August 16, 2009, 09:10:29 pm
status update: still developing slowly for my software. found a "bug or such" today..

when someone uses a script in guild chat, like /script.txt (the txt file has basic html for the game to interpret)

the module i have adds weird data to the database...

basically my setup should have it add something like this to the db:

Code: [Select]
$username said: $message

but it turns out like:
Code: [Select]
0 said: <remoteformat id="ugh" category="100" key="ugh" knubot="0"  ><parameter value="6;Jekhel" /><parameter value="ugh" /></remoteformat>

replaced teh actual data with "ugh" as im not sure if its something security related or what. some was just long strings of numbers some was weirder. any suggestions?

last resort would be like:
Code: [Select]
if($username == 0)
{
die();
} else { ......
SimplePortal 2.3.7 © 2008-2024, SimplePortal