[BETA] Forum (phpbb3) with bot response (ALICE & Hal9000)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Ideas Centre
User avatar
petrocad3d
Registered User
Posts: 68
Joined: Wed Apr 08, 2009 2:40 am

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by petrocad3d » Thu Sep 23, 2010 4:45 am

teemad.net wrote:I say Good night to Alissa here and u can see that she thinks that an other user who says Good night after me to her, is me as well :roll:

Sorry about bad english :oops:
i see the problem. You can download the last version of alissa.php here. "New version of alissa.php".

nice avatar for your bot.

:ugeek:

User avatar
Blue Blood
Registered User
Posts: 763
Joined: Sat Apr 11, 2009 7:09 am
Location: U§A
Name: Blue Blood
Contact:

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by Blue Blood » Thu Sep 23, 2010 5:57 am

This seems very interesting!!!

OK I have a Honda forum..
People are always asking for example

"is there is a DIY for (let say) Changing brakes"
Can the bot post a link to a brake changing DIY the already exists on my forum.

This would be very useful to answer simple questions that my members have.
I get a lot of the same questions, & I'm tired of answering them.
I find my-self being rude to the members because they cant use the search for some reason.

batanaka
Registered User
Posts: 12
Joined: Tue Sep 21, 2010 11:35 pm

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by batanaka » Thu Sep 23, 2010 6:45 am

petrocad3d wrote:Alice Bot and Hal9000 must reply very well "What is my name?", because the program send the name of the user.
...
Hal9000 just takes 3 first lines.
Alice takes all.
I have my own pandorabot, so I was experimenting with pandorabots only. It can't take name of the user, and it can't shorten quoted text.
petrocad3d wrote:i will release the next version very soon.
I will be looking forward to it.

teemad.net
Registered User
Posts: 4
Joined: Tue Aug 10, 2010 5:26 pm
Location: Estonia
Name: Mario Aria
Contact:

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by teemad.net » Thu Sep 23, 2010 6:48 am

petrocad3d wrote:i see the problem. You can download the last version of alissa.php here. "New version of alissa.php".
Thing is that i dont run alissa or other bots from my own server. I use your defaults :roll:
petrocad3d wrote: nice avatar for your bot.
:ugeek:
Ty. Just needed some beautiful friends too :lol:
Still learning English.

batanaka
Registered User
Posts: 12
Joined: Tue Sep 21, 2010 11:35 pm

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by batanaka » Thu Sep 23, 2010 11:17 am

A few more questions for the developer:
1) in the file "libraryfunction.php" there are numerous functions like buscar_en_palabra..., contar_palabras..., delimitadora..., etc. Are any of those really used by the current version of the bot? I checked posting_bot.php and didn't find any reference to those functions.

2) the script doesn't process bbcode_uid correctly. For instance, I type this line:

Code: Select all

This is a test post for checking [b]bold[/b], [i]italics[/i] and [u]underscore[/u].
And in bot reply I get this:

Code: Select all

[quote]This is a test post for checking [b:nvr7z1oc]bold[/b:nvr7z1oc], [i:nvr7z1oc]italics[/i:nvr7z1oc] and [u:nvr7z1oc]underscore[/u:nvr7z1oc].[/quote]That is just your personal opinion.
Does it work the same for all bots or only for pandorabots?

3) in posting_bot.php there seem to be code for checking locked/unlocked topics and handling polls. Is it used for anything or it's just unused code left from default posting.php? The bot replies in locked topics as well - is it supposed to work this way?
Last edited by batanaka on Thu Sep 23, 2010 3:33 pm, edited 2 times in total.

batanaka
Registered User
Posts: 12
Joined: Tue Sep 21, 2010 11:35 pm

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by batanaka » Thu Sep 23, 2010 3:25 pm

A quick solution I found for passing username for pandorabot...
I replaced

Code: Select all

$alissa_m = $data['message'];$alissa_u = $user->data['user_id'].$code_bot;
with

Code: Select all

$send_name=$user->data['username'];
$send_name='zzz '.$send_name.'. ';
$alissa_m = $send_name.$data['message'];$alissa_u = $user->data['user_id'].$code_bot;
This way each message sent to pandorabot is preceded with "zzz username". Of course it requires a new category for pandorabot to react to it correctly. It stores username, but doesn't produce a reply. This should be added in any aiml file for pandorabot.

Code: Select all

<category><pattern>ZZZ *</pattern><template><think><set name="name"><star/></set></think></template></category>
Perhaps it will be of some use for other people.

User avatar
petrocad3d
Registered User
Posts: 68
Joined: Wed Apr 08, 2009 2:40 am

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by petrocad3d » Fri Sep 24, 2010 6:06 am

Blue Blood wrote:This seems very interesting!!!

OK I have a Honda forum..
People are always asking for example

"is there is a DIY for (let say) Changing brakes"
Can the bot post a link to a brake changing DIY the already exists on my forum.

This would be very useful to answer simple questions that my members have.
I get a lot of the same questions, & I'm tired of answering them.
I find my-self being rude to the members because they cant use the search for some reason.
Yes, the principal function of the bots is to help the users (or admin). You can teach your ALICE bot or your Pandorabots in order to response this question.

I think, teach to Pandorabots is easier than ALICE BOT.

:ugeek:

User avatar
petrocad3d
Registered User
Posts: 68
Joined: Wed Apr 08, 2009 2:40 am

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by petrocad3d » Fri Sep 24, 2010 6:15 am

batanaka wrote: I have my own pandorabot, so I was experimenting with pandorabots only. It can't take name of the user, and it can't shorten quoted text.

This way each message sent to pandorabot is preceded with "zzz username". Of course it requires a new category for pandorabot to react to it correctly. It stores username, but doesn't produce a reply. This should be added in any aiml file for pandorabot.

Code: Select all

<category><pattern>zzz *</pattern><template><think><set name="name"><star/></set></think></template></category>
Perhaps it will be of some use for other people.
could work very well.

in config_bot.php in this line

$str_sendM[3] = 'botid=$urlbot&custid=$alissa_u&input=$alissa_m';

you can change in this way

$str_sendM[3] = 'botid=$urlbot&custid=$alissa_u&input=".urlencode(\'zzz \'.$alissa_f.\'. \')."$alissa_m';

i think your idea is really good.

:ugeek:
Last edited by petrocad3d on Fri Sep 24, 2010 5:30 pm, edited 3 times in total.

User avatar
petrocad3d
Registered User
Posts: 68
Joined: Wed Apr 08, 2009 2:40 am

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by petrocad3d » Fri Sep 24, 2010 6:33 am

teemad.net wrote: Thing is that i dont run alissa or other bots from my own server. I use your defaults :roll:
i will check it. (UPDATE)

in libraryfunction.php
line 390

this line
global $str_botid,$str_sendM,$str_hostM,$str_nameM,$str_typeM,$str_urlM;
rewrite :
global $str_botid,$str_sendM,$str_hostM,$str_nameM,$str_typeM,$str_urlM,$alissa_f;

line 393
this line
$alissa_f = $str_nameM[$nbot];
rewrite:
//$alissa_f = $str_nameM[$nbot];


let me explain about the ALICE BOT.

The user_id is assigned to a nick name, only once,

only when you send "my name is .....", this value will not change the other way.

if you want to work well the ALICE BOT, you must install on your own server.

i notice it is dificult to understand, but i get a explain.

In my forum :

user_id = 2453 assigned to "Daniel".

If "Daniel" asked "what is my name?"

ALICE reply "your name is Daniel", and in this memory user_id = 2453 was assigned "Daniel".

in your forum

user_id = 2453 assigned to "Anthony".

if "Anthony" asked "what is my name?"

ALICE will reply "your name is Daniel", no "Anthony", because in the ALICE memory user_id = 2453 was assigned "Daniel".

if "Anthony" reply "my name is Anthony".

ALICE will change her memory to "Anthony" for user_id = 2453.

in my forum, if Daniel ask to Alice "what is my name?". well ALICE reply "Anthony".

is the main reason I recommend using your own ALICE.

In my case, each week, ALICE bot is reset by a CRON JOB. I dont have anyproblem for that.

:ugeek:
Last edited by petrocad3d on Fri Sep 24, 2010 3:17 pm, edited 1 time in total.

User avatar
petrocad3d
Registered User
Posts: 68
Joined: Wed Apr 08, 2009 2:40 am

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by petrocad3d » Fri Sep 24, 2010 7:09 am

batanaka wrote:A few more questions for the developer:
1) in the file "libraryfunction.php" there are numerous functions like buscar_en_palabra..., contar_palabras..., delimitadora..., etc. Are any of those really used by the current version of the bot? I checked posting_bot.php and didn't find any reference to those functions.

2) the script doesn't process bbcode_uid correctly. For instance, I type this line:

Code: Select all

This is a test post for checking [b]bold[/b], [i]italics[/i] and [u]underscore[/u].
And in bot reply I get this:

Code: Select all

[quote]This is a test post for checking [b:nvr7z1oc]bold[/b:nvr7z1oc], [i:nvr7z1oc]italics[/i:nvr7z1oc] and [u:nvr7z1oc]underscore[/u:nvr7z1oc].[/quote]That is just your personal opinion.
Does it work the same for all bots or only for pandorabots?

3) in posting_bot.php there seem to be code for checking locked/unlocked topics and handling polls. Is it used for anything or it's just unused code left from default posting.php? The bot replies in locked topics as well - is it supposed to work this way?
1. Yes, in my forum it is used alot. :) . it is used for madlib tecnology and other tecnologies. i will include it in the next version

2. the next version you wont have this problem. (i hope) :? . i will review it.

3. for locked topics no ones (human) can post anything. since the bot are not human, they pass it. Could be a good idea include some protection for that. 8-)

:geek:

batanaka
Registered User
Posts: 12
Joined: Tue Sep 21, 2010 11:35 pm

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by batanaka » Fri Sep 24, 2010 7:16 am

BTW, petrocad3d, I was examining your code in posting_bot.php and got curious what for do you need an additional column in phpbb_posts table ("post_bot_respond"). If I understood it correctly, the only reason it's used for is to store id of bot reply in order to edit it correctly if and when user post (replied to) is edited. If there are no other uses, I think it can be dropped, together with bot edit function, for the following reason:
If intended goal of the boat is to replicate, to some degree, behavior of human poster, it would be only logical to not react to edited posts. E.g., when I edit my older posts at forums to fix something, other members who replied to me, unless they are uber-geeks who monitor all old threads 24/7, don't go and don't edit their replies to reflect those changes. Neither should bots. Additional benefits are: no changes to phpbb MySQL table, thus easier installation of the mod, no danger of people messing with their database during installation, less code in php files.
I think this bot edit function is not really necessary, and makes this otherwise relatively simple mod unnecessarily complex. Perhaps you should drop that function together with changes to forum table structure in one of your future releases?

User avatar
petrocad3d
Registered User
Posts: 68
Joined: Wed Apr 08, 2009 2:40 am

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by petrocad3d » Fri Sep 24, 2010 3:38 pm

batanaka wrote:BTW, petrocad3d, I was examining your code in posting_bot.php and got curious what for do you need an additional column in phpbb_posts table ("post_bot_respond"). If I understood it correctly, the only reason it's used for is to store id of bot reply in order to edit it correctly if and when user post (replied to) is edited. If there are no other uses, I think it can be dropped, together with bot edit function, for the following reason:
If intended goal of the boat is to replicate, to some degree, behavior of human poster, it would be only logical to not react to edited posts. E.g., when I edit my older posts at forums to fix something, other members who replied to me, unless they are uber-geeks who monitor all old threads 24/7, don't go and don't edit their replies to reflect those changes. Neither should bots. Additional benefits are: no changes to phpbb MySQL table, thus easier installation of the mod, no danger of people messing with their database during installation, less code in php files.
I think this bot edit function is not really necessary, and makes this otherwise relatively simple mod unnecessarily complex. Perhaps you should drop that function together with changes to forum table structure in one of your future releases?
You are right, the main function of this column is the bot could reply if the user rewrite its post

this is main function but no only functions are there.

When the bot replies with delay, or the bot replies to an event (depending on the message, user, forum, etc), this column is used in order to store this action.

For example Blue Blood wrote :
Blue Blood wrote:...
People are always asking for example
"is there is a DIY for (let say) Changing brakes"
Can the bot post a link to a brake changing DIY the already exists on my forum.
This would be very useful to answer simple questions that my members have.
I get a lot of the same questions, & I'm tired of answering them.
...
this is exactly an event by message, When the program finds "* DIY * Changing brakes", the program calls to the specific bot in order to reply this message, after that a "flag" is stored in "post_bot_respond" in order to program doesnt see again this post.

it is possible to prevent the bot replies again if the user changes his post, i could add a option in ACP panel.

I think alof of times that delete that column and create a new table in order to prevent the people play with this king of table(main table)

:geek:

batanaka
Registered User
Posts: 12
Joined: Tue Sep 21, 2010 11:35 pm

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by batanaka » Fri Sep 24, 2010 3:52 pm

I noticed a small bug: if bot is assigned to a group with custom group usernames colour, the script doesn't update color correctly on index and viewforum pages after making a reply (it's displayed correctly though on viewtopic and in profile). How this can be fixed?
EDIT: I fixed the mentioned bug in the following way (editing posting_bot.php):

Code: Select all

			$sql = 'SELECT user_id FROM ' . USERS_TABLE . ' WHERE username_clean  = ' . "'".$db->sql_escape(utf8_clean_string($str_name))."'";
			$result = $db->sql_query($sql);
			$topic2 = $db->sql_fetchrow($result);$bot_id = $topic2['user_id'];if ($bot_id=='') {$bot_id = 1;}
replaced with:

Code: Select all

			$sql = 'SELECT user_id, user_colour FROM ' . USERS_TABLE . ' WHERE username_clean  = ' . "'".$db->sql_escape(utf8_clean_string

($str_name))."'";
			$result = $db->sql_query($sql);
			$topic2 = $db->sql_fetchrow($result);$bot_id = $topic2['user_id'];if ($bot_id=='') {$bot_id = 1;}
$bot_colour=$topic2['user_colour'];
and this

Code: Select all

			$user->data['user_colour'] = '';
replaced with

Code: Select all

			$user->data['user_colour'] = $bot_colour;
Now bot color is updated correctly on all pages for me. I'm not sure if I did this in the best way though.
Last edited by batanaka on Fri Sep 24, 2010 7:44 pm, edited 2 times in total.


User avatar
petrocad3d
Registered User
Posts: 68
Joined: Wed Apr 08, 2009 2:40 am

Re: [BETA] Forum (phpbb3) with bot response (ALICE & Hal9000

Post by petrocad3d » Mon Sep 27, 2010 3:49 pm

batanaka wrote:I noticed a small bug: if bot is assigned to a group with custom group usernames colour, the script doesn't update color correctly on index and viewforum pages after making a reply (it's displayed correctly though on viewtopic and in profile). How this can be fixed?
EDIT: I fixed the mentioned bug in the following way (editing posting_bot.php):

Code: Select all

			$sql = 'SELECT user_id FROM ' . USERS_TABLE . ' WHERE username_clean  = ' . "'".$db->sql_escape(utf8_clean_string($str_name))."'";
			$result = $db->sql_query($sql);
			$topic2 = $db->sql_fetchrow($result);$bot_id = $topic2['user_id'];if ($bot_id=='') {$bot_id = 1;}
replaced with:

Code: Select all

			$sql = 'SELECT user_id, user_colour FROM ' . USERS_TABLE . ' WHERE username_clean  = ' . "'".$db->sql_escape(utf8_clean_string

($str_name))."'";
			$result = $db->sql_query($sql);
			$topic2 = $db->sql_fetchrow($result);$bot_id = $topic2['user_id'];if ($bot_id=='') {$bot_id = 1;}
$bot_colour=$topic2['user_colour'];
and this

Code: Select all

			$user->data['user_colour'] = '';
replaced with

Code: Select all

			$user->data['user_colour'] = $bot_colour;
Now bot color is updated correctly on all pages for me. I'm not sure if I did this in the best way though.
Yes, it is the best way in order to fix it.

i am grateful for your contributions

:ugeek:

Locked

Return to “[3.0.x] MODs in Development”