Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > Torrent Trader
Reply
  #1  
Old 21st August 2011, 08:57
CL_Utility CL_Utility is offline
Member
 
Join Date: Jul 2011
P2P
Posts: 9
Default Shout auto reply torrenttrader 2.06
Ive played around a bit and keep coming up with absolutely nothing, but has anyone seen or does anyone have a suggestion for where i might start this? basically what i want is a bot that picks up certain words put into shout by a user and gives predetermined responses

e.g

if i post in shout

User: hello

shout box would recognize the word "hello" and i would receive an automated response from bot

Bot: how are you


the problem is i dont know how to trigger it to even start

ive got a start on the response though

Code:
$query = "INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, 'Bot', 'how are you', '".get_date_time()."', '0')";
any help would be appreciated

Last edited by CL_Utility; 21st August 2011 at 09:06. Reason: typo
Reply With Quote
  #2  
Old 21st August 2011, 09:08
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
place this after the shout query
PHP Code:
if(strtolower($shout) == "hello")
{
$query "INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, 'Bot', 'how are you', '".get_date_time()."', '0')";
mysql_query($query);

__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
The Following User Says Thank You to joeroberts For This Useful Post:
CL_Utility (21st August 2011)
  #3  
Old 21st August 2011, 09:38
CL_Utility CL_Utility is offline
Member
 
Join Date: Jul 2011
P2P
Posts: 9
Default
(strtolower($shout) doesnt seem to be a valid variable l in TT shoutbox or if it is it is out of my range of limited knowledge lol and that is my main problem is i dont know what i should be calling.

but thankyou for ur help joe, this is all a learning experience for me, i am not running a site i just want to play :)
Reply With Quote
  #4  
Old 21st August 2011, 09:45
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
Quote:
Originally Posted by CL_Utility View Post
(strtolower($shout) doesnt seem to be a valid variable l in TT shoutbox or if it is it is out of my range of limited knowledge lol and that is my main problem is i dont know what i should be calling.

but thankyou for ur help joe, this is all a learning experience for me, i am not running a site i just want to play :)
First off change
PHP Code:
$shout 
to what ever TT is using I just took a shot as to what it was
and
PHP Code:
strtolower() 
is php not torrent trader
It changes a text to all lower texts (HeLLo becomes hello)
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #5  
Old 21st August 2011, 09:50
CL_Utility CL_Utility is offline
Member
 
Join Date: Jul 2011
P2P
Posts: 9
Default
thanks Joe! ive got it working now, im learning heaps. and i thank you eternally

would there be a way to make that pick up part of the statement? as in if i said "hello everybody" it still picked up "hello" and responded?
Reply With Quote
  #6  
Old 21st August 2011, 11:36
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
yes by using
PHP Code:
if(preg_match("/hello (.*)/",strtolower($shout),$m)) 
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #7  
Old 21st August 2011, 12:39
CL_Utility CL_Utility is offline
Member
 
Join Date: Jul 2011
P2P
Posts: 9
Default
what does the $m refer to? is that something i need to change?
Reply With Quote
  #8  
Old 21st August 2011, 14:32
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
no the $m becomes an array with the content of (.*) in it
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #9  
Old 22nd August 2011, 09:11
CL_Utility CL_Utility is offline
Member
 
Join Date: Jul 2011
P2P
Posts: 9
Default
ok so i changed $shout to $message as that is what TT is using, but that is not working
Reply With Quote
  #10  
Old 22nd August 2011, 12:33
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
try this
PHP Code:
if(strtolower($message) == 'hello' OR preg_match("/hello (.*)/",strtolower($message),$m)) 
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
Reply

Tags
206 , auto , reply , shout , torrenttrader

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 21:14. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.