[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!
Scam Warning
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 »

Another small improvement I made:
In posting_bot.php after

Code: Select all

$bot_respond2 = $bot_respond . chr(10). delimitador($bot_respondM,1,chr(10),1,1);
I added:

Code: Select all

$update_time=time();
$sql = 'UPDATE '. USERS_TABLE . ' SET user_lastvisit = ' . "'$update_time'" . ' WHERE user_id = ' . "'$bot_id'";
$result = $db->sql_query($sql);
This way each time a bot makes a reply, its last visit time is updated, so when somebody looks into bot's profile, it will look as if it visited recently.
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 »

Any progress on this mod, petrocad3d? When can we expect next update?
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 »

Yet another bug I found in posting_bot.php
If you have visual confirmation for guest posting enabled, you'll get an error about wrong confirmation code (guest post will be submitted, but bot reply will be blocked), since the code seemingly is not passed from posting.php to posting_bot.php

I solved this by deleting this part from posting_bot.php

Code: Select all

	if ($config['enable_post_confirm'] && !$user->data['is_registered'] && in_array($mode, array('quote', 'post', 'reply')))
	{
		$confirm_id = request_var('confirm_id', '');
		$confirm_code = request_var('confirm_code', '');

		$sql = 'SELECT code
			FROM ' . CONFIRM_TABLE . "
			WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
				AND session_id = '" . $db->sql_escape($user->session_id) . "'
				AND confirm_type = " . CONFIRM_POST;
		$result = $db->sql_query($sql);
		$confirm_row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		if (empty($confirm_row['code']) || strcasecmp($confirm_row['code'], $confirm_code) !== 0)
		{
			$error[] = $user->lang['CONFIRM_CODE_WRONG'];
		}
		else
		{
			$solved_captcha = true;
		}
	}
Worked fine for me.
User avatar
Galandas
Registered User
Posts: 732
Joined: Thu Jul 23, 2009 4:11 pm
Location: Italy
Name: Rey
Contact:

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

Post by Galandas »

I installed the mod but when I do the question example

what is your name?

response

Destination host forbidden


the board and in Italian and maybe that's the problem?
English is not my native language My CDB Contributions My RC extensions
User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

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

Post by Volksdevil »

Hi,

Where is the latest download link for this mod? On the first post? Does it include all the fixes? :)
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60
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 »

Volksdevil wrote:Hi,

Where is the latest download link for this mod? On the first post? Does it include all the fixes? :)
It's in the first post. Modbot version 0.3.1. (October 13, 2009). petrocad3d didn't make updates since then.
There are quite a few bugs in that release, so I hope petrocad3d will release a new version at some point in the future.
Galandas wrote:I installed the mod but when I do the question example
what is your name?
response
Destination host forbidden
the board and in Italian and maybe that's the problem?
I'm not completely sure, but did you check your PHP "allow_url_fopen" setting? Many website hosting companies have it set to "off" by default, and you must manually edit it to "on" to allow php files to access files on other domains.
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 »

POLL VOTING MODULE

Image

I wrote a module enabling the bot to vote in polls. I think it's one more step to make it more similar to human members and it adds to fun. It works as follows:
1) first the bot checks if there is a poll in the topic and if it uses a registered account;
2) if there is a poll it checks if it didn't end (if it has end date) and the bot didn't vote as yet;
3) if all conditions are met, the bot loads all options, picks one randomly and replies (to current post) with "I voted for "poll-option-goes-here" (check the screenshot);
4) once it voted, during all subsequent replies to the same thread it will make normal replies (without voting).

In posting_bot.php, find:

Code: Select all

			$data2['post_edit_user'] = $bot_id;
BEFORE, add:

Code: Select all

///////////////////poll voting module begin//////////////////////

$vote_in_poll=0;
$sql = 'SELECT poll_start, poll_length FROM ' . TOPICS_TABLE . ' WHERE topic_id = ' . $data['topic_id'];
$result = $db->sql_query($sql);
$result2 = $db->sql_fetchrow($result);
$poll_start = $result2['poll_start'];
$poll_length = $result2['poll_length'];
$db->sql_freeresult($result);

if($poll_start!=0 && $bot_id!='1')
{
//there is a poll in the topic, begin checking


 if($poll_length!=0)
 {
  $poll_end = $poll_start + $poll_length;
  if($poll_end<time())
  {
   $vote_in_poll=0; //poll ended, do not vote
  }
  else
  {
   $vote_in_poll=1; //poll has end time but not ended as yet
  }
 }
 else
 {
  $vote_in_poll=1; // poll has no end time
 }

if($vote_in_poll!=0)
{
//checking if bot already voted in this poll
$sql = 'SELECT poll_option_id FROM ' . POLL_VOTES_TABLE . ' WHERE topic_id = ' . $data['topic_id'] . ' AND vote_user_id = '.$bot_id;
$result = $db->sql_query($sql);
$result2 = $db->sql_fetchrow($result);
$poll_option_id = $result2['poll_option_id'];
$db->sql_freeresult($result);
if($poll_option_id!='')
{
$vote_in_poll=0; //bot already voted
}
else
{
//begin voting
$sql = 'SELECT * FROM ' . POLL_OPTIONS_TABLE . ' WHERE topic_id = ' . $data['topic_id'] . ' ORDER BY poll_option_id';
$result = $db->sql_query($sql);
$poll_options = array();
while ($row = $db->sql_fetchrow($result))
{
$poll_options[] = $row;
}
$db->sql_freeresult($result);
$option_to_vote = rand(0, count($poll_options)-1); //picking a random option to vote for; array position, not option id
$rand_vote_reply=rand(0,1);
if($rand_vote_reply==0)
$data2['message'] = 'I voted for "'.$poll_options[$option_to_vote]['poll_option_text'].'".';
else
$data2['message'] = 'I chose "'.$poll_options[$option_to_vote]['poll_option_text'].'".';
$option_id = $poll_options[$option_to_vote]['poll_option_id'];

$sql_ary = array(
			'topic_id'		=> (int) $data['topic_id'],
			'poll_option_id'	=> (int) $option_id,
			'vote_user_id'		=> (int) $bot_id,
			'vote_user_ip'		=> (string) $user->ip,
		);

$sql = 'INSERT INTO ' . POLL_VOTES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);

$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . ' SET poll_option_total = poll_option_total + 1 WHERE poll_option_id = ' . (int) $option_id . ' AND topic_id = ' . 

(int) $data['topic_id'];
$db->sql_query($sql);
}
}

}

///////////////////poll voting module end//////////////////////
It works fine for me, but I would be glad if somebody tested this on their forum and reported about results/possible bugs.
Last edited by batanaka on Tue Oct 26, 2010 3:49 pm, edited 1 time in total.
User avatar
Galandas
Registered User
Posts: 732
Joined: Thu Jul 23, 2009 4:11 pm
Location: Italy
Name: Rey
Contact:

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

Post by Galandas »

I'm not completely sure, but did you check your PHP "allow_url_fopen" setting? Many website hosting companies have it set to "off" by default, and you must manually edit it to "on" to allow php files to access files on other domains.

and that's the problem on my hosting the "allow_url_fopen" and off, thanks for the suggestion.
English is not my native language My CDB Contributions My RC extensions
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 »

Galandas wrote:
I'm not completely sure, but did you check your PHP "allow_url_fopen" setting? Many website hosting companies have it set to "off" by default, and you must manually edit it to "on" to allow php files to access files on other domains.

and that's the problem on my hosting the "allow_url_fopen" and off, thanks for the suggestion.
i have a version of this mod, in that version you do not need to use curl or fsocket tecnologies, but you need to install ALICE BOT program in your server. in this case, you could forget to use the pandorabots or verbots in your forum.

:ugeek:
Mr. Man!
Registered User
Posts: 109
Joined: Sat Jul 31, 2010 6:05 am
Contact:

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

Post by Mr. Man! »

No way.... This mod's still active :D
User avatar
muggins
Registered User
Posts: 1183
Joined: Fri Feb 22, 2008 5:12 pm
Location: Texas
Name: Donovan
Contact:

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

Post by muggins »

Maybe active, but not really useful except as a novelty.

I had it working after a lot of effort. Training the ALICE script is a huge undertaking, and not really worth it for an active forum.
Muggins
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 »

M1sT3rM4n wrote:No way.... This mod's still active :D
muggins wrote:Maybe active, but not really useful except as a novelty.

I had it working after a lot of effort. Training the ALICE script is a huge undertaking, and not really worth it for an active forum.
Hi

We did not write ALICE BOT, re-write that bot in order to do the things we want to do, is a lot of work.

Our bot (HAL9000) we want to do:
-answer and ask questions of chemistry
-answer and ask questions of mathematics
-insert news on particular topics
-create stories to entertain people
-to be a fan of a particular artist

for ALICE bot to do it, would be difficult, we had to wait an update, or someone who has done scripts for that.

The problem we found is that our BOT(HAL9000) also has over 50,000 phrases and patterns of sentences that should be recognized, and this caused overload on our server.

We had been undergoes for 1 year with another type of bot, a "bot moderator", this also has to recognize words, phrases and patterns of sentences, but like the HAL9000, also caused a server overload.

Nowadays, the "bot moderator" uses other techniques to check the post from users, it does not cause any problems on the server.

The same technique, we would use HAL9000, to do the things that we do not have problems on server load.

We do not stop the development of modbot.

: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 »

Galandas wrote:I installed the mod but when I do the question example

what is your name?

response

Destination host forbidden


the board and in Italian and maybe that's the problem?
No, actually i see italian forum phpbb work with the mod.

I think the best way to resolve Curl, Fsocket, and fopen were disabled, is using the xmlrpc tecnology. i just need to mod :? that mod. if i can, you could receive the bot response(with delay, not immediately), RSS, and other stuff :o .

:ugeek:
User avatar
Blue Blood
Registered User
Posts: 767
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 »

Where can i download this mod..
the download link directs me to
modbot_v0.3.1.zip
alissa_0.0.1.zip

nether one of these are the main mod
just bot add-on's


Also


Is there a way to set a response to a post.

Example
If a member makes a post with the phrase:

What is 2 plus 2?

The the admin can set an auto response for just this phrase.

The answer is 4.

Thanks!!
Last edited by Blue Blood on Sat May 28, 2011 6:04 pm, edited 1 time in total.
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

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

Post by Peter77sx »

Ye, the more info you upload on alice files, the smarter the bot. Had similar mod for phpbb2... it was fun for a while.
Locked

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