[ABD] Forum AI v0.2.0

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! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony »

Were can I get more AIML packs?
Blind-Summit
Registered User
Posts: 131
Joined: Thu Mar 13, 2003 3:09 am
Contact:

Post by Blind-Summit »

mr.luc
Registered User
Posts: 213
Joined: Mon Feb 24, 2003 4:09 pm
Contact:

Post by mr.luc »

just a thought... sometimes...
example: the first time you ask a question... the will ad <condition> tags... and give a list..
ask it: what is my husbands name?

if you gave it the answer (example johnny) it will rember it..
but on the first time it will give you a <condition> statement and give you a <li> of possible answers...

is there a way of enabling html just for the bot??? and not for other users .. it would still look a little awkward.. but the xml tags would be gone.
Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony »

I have installed all those packs.

My bot needs more.

It can't take over the world without them.
User avatar
andysmeth
Registered User
Posts: 86
Joined: Sun Feb 10, 2002 11:56 pm
Location: Liverpool, UK
Contact:

Post by andysmeth »

:lol:


Try...

http://www.alicebot.org/downloads/

http://j-alice.sourceforge.net/

Maybe we could post a list of these and others people find????
Josh Windu
Registered User
Posts: 377
Joined: Sun Jul 14, 2002 3:14 am
Location: Australia
Contact:

Post by Josh Windu »

great mod guys!!!

I looked over every page but I could not find how to delay the reply time :?

I saw it once before but I couldnt find it. Help would be great thanks
Nitrotech - Alpha stage... Your own fully customisable forum! and site!
mr.luc
Registered User
Posts: 213
Joined: Mon Feb 24, 2003 4:09 pm
Contact:

Post by mr.luc »

well there is acronjob on page 44 by zemaj and i changed it a little bit to make it work only in a php file on page 45. mine is still buggy and won't handle quotes of quotes.. but as i am writing.. i think i'll take a look at it tonight..
Josh Windu
Registered User
Posts: 377
Joined: Sun Jul 14, 2002 3:14 am
Location: Australia
Contact:

Post by Josh Windu »

how do I run the cron job?????
Nitrotech - Alpha stage... Your own fully customisable forum! and site!
mr.luc
Registered User
Posts: 213
Joined: Mon Feb 24, 2003 4:09 pm
Contact:

Post by mr.luc »

I looked through the cron_delay file in fixed the errors...
it now handles the quotes correctly.. quotes registered and anonymous users by name.

here is the new file. It works on my system:

Code: Select all

<?php 
/*************************************************************************** 
*                                iai_cron.php 
*                            ------------------- 
*   copyright            : (C) 2003 James Gay 
*   email                : zemaj@palgn.com 
* 
***************************************************************************/ 
/*************************************************************************** 
*   Zemaj wrote:
*   This *should* check & update IAI posts where needed when called. 
*   To use set this page as a cron jobs to run every minute. 
*
*   Mr.Luc wrote:
*	Actually i don't know if this version will run as a cronjob.
*	I included it with: 
*	include($phpbb_root_path.'iai_cron.php'); 
*	at the very beginning of page_tail.php
* 
***************************************************************************/ 

define('IN_PHPBB', true); 

if(!isset($phpbb_root_path)) {
	$phpbb_root_path='./'; 	
}

	include_once($phpbb_root_path.'extension.inc'); 	

	include_once($phpbb_root_path.'common.'.$phpEx); 	

	include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); 

	include_once($phpbb_root_path . 'includes/functions_post.'.$phpEx);	


// Grab all our data 
$sql = "SELECT c.*, pt.post_text AS past_message, pt.bbcode_uid AS past_bbcode_uid, p.post_username, p.poster_id, t.topic_last_post_id 
        FROM " . IAI_CRON_TABLE . " c, " . POSTS_TEXT_TABLE . " pt, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t 
        WHERE c.update_time < " . time() . " 
                AND pt.post_id = c.past_post_id 
                AND p.post_id = c.past_post_id 
                AND t.topic_id = p.topic_id"; 
if ( !($result = $db->sql_query($sql)) ) 
{ 
        message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql); 
} 


$posts = $db->sql_fetchrowset($result); 

if($total_posts = count($posts))  // if there is a message...
{ 

		for( $i = 0; $i < $total_posts; $i++ )  // get each message
        { 
                // Int vars 
                $iai_post_id = $posts[$i]['post_id']; 
                $topic_id = $posts[$i]['topic_id']; 
                $forum_id = $posts[$i]['forum_id']; 
                $iai_subject = $posts[$i]['post_subject']; 
                $bbcode_uid = $posts[$i]['bbcode_uid'];
                $iai_message = $posts[$i]['post_text'];  
                $current_time = time(); 
				$quote_poster = $posts[$i]['poster_id'];
                if($posts[$i]['topic_last_post_id'] != $posts[$i]['past_post_id']) 
                { 
                        // New posts in thread since this reply was set... 
                        // Now we have to add old text in a quote. Fun. 

						// clean_up
						$posts[$i]['past_message'] = trim($posts[$i]['past_message']);
						$iai_message = trim($iai_message);

						// we get rid of old bbcode_uid
						$past_message = preg_replace('/\:(([a-z0-9]:)?)' . $posts[$i]['past_bbcode_uid'] . '/s', '', $posts[$i]['past_message']); 


                        $iai_message = preg_replace('/\:(([a-z0-9]:)?)' . $bbcode_uid . '/s', '', $iai_message); 

						// we get the username

						if($posts[$i]['poster_id'] > 1) 
						{
							/* getting the registered username. the post_username gets only the name of anonymous users. tried to include this query in the one above.. but i failed. so i put it here */
						
							$sql2 = "SELECT username FROM ". USERS_TABLE ."
							WHERE user_id = $quote_poster";

							if ( !($result2 = $db->sql_query($sql2)) ) 
							{ 
									message_die(GENERAL_ERROR, 'Error in posting1', '', __LINE__, __FILE__, $sql2); 
							} 
							$posterinfo = $db->sql_fetchrow($result2);							
							
						// now we put the username into the quotes [quote="Username"]
							
							$iai_message = "[quote=\"" . $posterinfo['username'] . "\"]" . $past_message . "[/quote]" . $iai_message;
                   
						}
						else 
						{
							if($posts[$i]['post_username'] != "" ) 
							{
								/* an anonymous user posted... but he entered a username */
								$iai_message = "[quote=\"" . $posts[$i]['post_username'] . "\"]" . $past_message . "[/quote]" . $iai_message;
							}
							else
							{
								/* an anonymous user posted... but he did not enter a username */
								$iai_message = "[quote=\"Anonymous\"]" . $past_message . "[/quote]" . $iai_message;
							}
						}   
						

						// now we parse with new bbcode 
                        $bbcode_uid = make_bbcode_uid(); 
						$iai_message = addslashes($iai_message);
						$iai_message = bbencode_first_pass($iai_message, $bbcode_uid);
						$iai_message = stripslashes($iai_message);
                        /* somehow this needs an add AND strip slashes!!! i don't know why :-0 but it won't work without... at least on my system !!! */
						
                } 

                $sql = "UPDATE " . POSTS_TABLE . " 
                        SET topic_id = $topic_id, forum_id = $forum_id, post_time = $current_time 
                        WHERE post_id = $iai_post_id"; 
                if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) ) 
                { 
                        message_die(GENERAL_ERROR, 'Error in posting1', '', __LINE__, __FILE__, $sql); 
                } 


				$iai_message = str_replace("'", "''", $iai_message);
				$iai_subject = str_replace("'", "''", $iai_subject);

                $sql = "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, bbcode_uid, post_subject, post_text) VALUES ($iai_post_id, '$bbcode_uid', '" . str_replace("\'", "''", $iai_subject) . "',  '" . str_replace("\'", "''", $iai_message) . "')"; 
                if ( !($result = $db->sql_query($sql)) ) 
                { 
                        message_die(GENERAL_ERROR, 'Error in posting2', '', __LINE__, __FILE__, $sql); 
                } 

				
				/* we don't include the add_search_words function... because we don't want to upset users if they do a serious search and they would get 100 stupid posts of the bot. If you want to include it you would have to uncomment the 2 following lines! - But i don't know how much load it adds to system and how big dbase gets... if the bot posts alot */

			//	 include_once($phpbb_root_path . 'includes/functions_search.'.$phpEx);  
             //    add_search_words($iai_post_id, stripslashes($iai_message), stripslashes($iai_subject)); 


				/* you can comment out following line if you dont want the bot count to rise with each post */

             //   iai_update_post_stats($forum_id, $topic_id, $iai_post_id, $board_config['iai_userid']); 


                // Updating complete! Remove this post from cron table! 
                $sql = "DELETE FROM " . IAI_CRON_TABLE . " 
                        WHERE post_id = $iai_post_id"; 
                if ( !($result = $db->sql_query($sql)) ) 
                { 
                        message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql); 
                } 

        } 
} 
?>
You can comment out the bot post count ...

to make it work you need to install zemaj's mod on page 44. this replaces the cron file... (not the rest)!!!

you should be able to run it with cron (i didn't test it)
or you can run it (thats how i tested it) like i explained on page 45

Luc
beardeddone
Registered User
Posts: 192
Joined: Thu Jan 16, 2003 1:47 am

Post by beardeddone »

This

src="./../mods/iai/jsrs/talk.gif"

should be

src="mods/iai/jsrs/talk.gif"

if from the root dir

works great at

http://www.skyport.dynip.com/skyport/aichat.php

you just need to be logged in to play
Best Regards
Skyport Forums   &#8226 Suzuki LC 1500 Parts & Accessories Links   &#8226  SexTalk &#8226 Music
SamW
Registered User
Posts: 57
Joined: Sat Apr 05, 2003 1:23 am
Location: Orlando, FL
Contact:

Post by SamW »

beardeddone wrote: This

src="./../mods/iai/jsrs/talk.gif"

should be

src="mods/iai/jsrs/talk.gif"

if from the root dir

works great at

http://www.skyport.dynip.com/skyport/aichat.php

you just need to be logged in to play
.


Error on registering
beardeddone
Registered User
Posts: 192
Joined: Thu Jan 16, 2003 1:47 am

Post by beardeddone »

Error on registering


Humm, can't delete my mistake
Last edited by beardeddone on Fri Apr 11, 2003 2:05 am, edited 1 time in total.
Best Regards
Skyport Forums   &#8226 Suzuki LC 1500 Parts & Accessories Links   &#8226  SexTalk &#8226 Music
beardeddone
Registered User
Posts: 192
Joined: Thu Jan 16, 2003 1:47 am

Post by beardeddone »

Error on registering


What kind of error
Best Regards
Skyport Forums   &#8226 Suzuki LC 1500 Parts & Accessories Links   &#8226  SexTalk &#8226 Music
beardeddone
Registered User
Posts: 192
Joined: Thu Jan 16, 2003 1:47 am

Post by beardeddone »

Nevermind I fixed it!
Best Regards
Skyport Forums   &#8226 Suzuki LC 1500 Parts & Accessories Links   &#8226  SexTalk &#8226 Music
zemaj
Registered User
Posts: 267
Joined: Thu Mar 07, 2002 3:58 am
Location: Australia
Contact:

Post by zemaj »

::EDIT:: Just checking something ::/EDIT::

-zem
Locked

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