Chat Bot working?

Started on the old forum in September 2009 · view the original in the archive · old links redirect here

21 replies · 1,258 views · started 17 years ago · 2 min read

6 participants
Leviathan73 Senior · 260 posts #1

Hello friends, did not realize this thing .. I have the file ravebabe.php

include("config.php"); 
include("core.php"); 
connectdb();
$action=$_GET["action"];
$id=$_GET["id"];
$sid = $_GET["sid"];
$botid = "8d034368fe360895";
$input = $_POST["input"];
$custid=$_POST["custid"];
$hostname = "www.pandorabots.com";
$hostpath = "/pandora/talk-xml";
$uid = getuid_sid($sid);
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
$sitename = $sitename[0];
if(islogged($sid)==false)
    {
      echo "<head>";
      echo "<title>Error!!!</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/white_medium.css\">";
      echo "</head>";
      echo "<body>";
      echo "<p align=\"center\">";
      echo "You are not logged in<br/>";
      echo "Or Your session has been expired<br/><br/>";
      echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
    }
    $uid = getuid_sid($sid);
    if(isbanned($uid))
    {
      echo "<head>";
      echo "<title>Error!!!</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo "</head>";
      echo "<body>";
      echo "<p align=\"center\">";
      echo "<img src=\"../images/notok.gif\" alt=\"x\"/><br/>";
      echo "<b>You are Banned</b><br/><br/>";
      $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'"));
 $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
      $remain = $banto[0]- time();
      $rmsg = gettimemsg($remain);
      echo "<b>Time Left: </b>$rmsg<br/>";
      $nick = getnick_uid($banto[2]);
 echo "<b>By: </b>$nick<br/>";
 echo "<b>Reason: </b>$banto[1]";
      //echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
    }
      echo "<head>";
      echo "<title>Error!!!</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo "</head>";
      echo "<body>";
      echo "<p align=\"center\">";
      echo "<br/>";
      addonline(getuid_sid($sid),"Chatting to ChatGirl","");
    if ($input!="")
    {
        $sendData = "botid=".$botid."&input=".urlencode($input)."&custid=".$custid;
     // Send the request to Pandorabot
     $result = PostToHost($hostname, $hostpath, $sendData);
     //TODO: Process the returned XML as an XML document instead of a big string.
     // Use string manipulations to pull out the 'custid' and 'that' values.
     $pos = strpos($result, "custid=\"");
     // Extract the custid
     if ($pos === false) {
      $custid = "";
     } else {
      $pos += 8;
      $endpos = strpos($result, "\"", $pos);
      $custid = substr($result, $pos, $endpos - $pos);
     }
     // Extrat <that> - this is the reply from the Pandorabot
     $pos = strpos($result, "<that>");
     if ($pos === false) {
      $reply = "";
     } else {
      $pos += 6;
      $endpos = strpos($result, "</that>", $pos);
      $reply = unhtmlspecialchars(substr($result, $pos, $endpos - $pos));
     }
        //echo htmlspecialchars( $reply);
        $hers = $reply;
        $hers = parsemsg($hers);
             $input=htmlspecialchars($input);
             $nick = getnick_uid($uid);
             echo "<br/><b>$nick: </b>$input<br/>";
             echo "<b>ChatGirl: </b>$hers<br/>";
  echo "<form action=\"ravebabe.php?sid=$sid\" method=\"post\">";
        echo "<br/><input type=\"text\" name=\"input\" maxlength=\"120\" value=\"$input\"/>";
 echo "<input type=\"hidden\" name=\"custid\" value=\"$custid\"/>";
 echo "<input type=\"Submit\" value=\"Say\" Name=\"Submit\"/></form><br/>";
    }else{
      echo "Hello, now you can chat with our chatbot<br/> her name is ChatGirl, have fun<br/>";
  echo "<form action=\"ravebabe.php?sid=$sid\" method=\"post\">";
      echo "<input type=\"text\" name=\"input\" maxlength=\"120\" value=\"$input\"/><anchor>";
 echo "<input type=\"hidden\" name=\"custid\" value=\"$custid\"/>";
 echo "<input type=\"Submit\" value=\"Say\" Name=\"Submit\"/></form><br/>";
    }
    
  echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
        echo "</body>";
function unhtmlspecialchars( $string )
{
  $string = str_replace ( '&', '&', $string );
  $string = str_replace ( ''', '\'', $string );
  $string = str_replace ( '"', '"', $string );
  $string = str_replace ( '<', '<', $string );
  $string = str_replace ( '>', '>', $string );
  $string = str_replace ( 'ü', '?', $string );
  $string = str_replace ( 'Ü', '?', $string );
  $string = str_replace ( 'ä', '?', $string );
  $string = str_replace ( 'Ä', '?', $string );
  $string = str_replace ( 'ö', '?', $string );
  $string = str_replace ( 'Ö', '?', $string );
  return $string;
}
capofret Developer · 225 posts #2

what do u mean?? or you can create your own bot at Pandorabots - A Multilingual Chatbot Hosting Service

then just edit in your script

LDSWAPWORLD site closed. im busy with other things in life like facebook , send me PM so i can add you 🙂 www.pinoySG.com

don't ask for help if you're not even helping yourself! i am tired of seeing the line "best site", i want to see something NEW and UNIQUE. maybe if i find one, ill go back to my wap life again.

External image (may be gone)

Leviathan73 Senior · 260 posts #3

how to change? I have this code in the file chat.php

mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'");
echo "</body>";
echo "</html>";
exit();
}
if($rinfo[1]==2)
{
//oh damn i gotta post this message to ravebabe :(
//will it succeed?
$botid = "eeb070e74e366473";
$hostname = "www.pandorabots.com";
$hostpath = "/pandora/talk-xml";
$sendData = "botid=".$botid."&input=".urlencode($message)."&custid=".$custid;
 
$result = PostToHost($hostname, $hostpath, $sendData);
 
$pos = strpos($result, "custid=\"");
$pos = strpos($result, "<that>");
if ($pos === false) {
$reply = "";
} else {
$pos += 6;
$endpos = strpos($result, "</that>", $pos);
$reply = unhtmlspecialchars2(substr($result, $pos, $endpos - $pos));
$reply = mysql_escape_string($reply);
}
 
$chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='1', who='', timesent='".time()."', data='".time()."', msgtext='".$reply." @".getnick_uid($uid)."', rid='".$rid."';");
 
}
$message = "";
}
 
echo "<br/>";
$chats = mysql_query("SELECT chatter, who, timesent, msgtext, exposed,data FROM ibwf_chat WHERE rid='".$rid."' ORDER BY timesent DESC, id DESC");
$counter=0;
while($chat = mysql_fetch_array($chats))
{
$canc = true;
 
 
if($counter<8)
{
if(istrashed($chat[0])){
if($uid!=$chat[0])
{
$canc = false;
}
}
//////good
/*if(isignored($chat[0],$uid)){
$canc = false;
}*/
//////////good
if($chat[0]!=$uid)
{
if($chat[1]!=0)

how it works?

spiderwebs Developer · 193 posts #4

registers at pandorabot.com and change bot id $botid = "eeb070e74e366473"; with ur bot id which u have registers there

E107 Security Team Leader Proudly Support AccountLab Plus Billing Software

Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com

Leviathan73 Senior · 260 posts #5

Spiders I signed up, where do I find id $botid = "eeb070e74e366473"; to change?

ranzit2 Developer · 187 posts #6

Leviathan73 wrote: Spiders I signed up, where do I find id $botid = "eeb070e74e366473"; to change?

the code u posted before had that id look it carefully

she is beautifull than php.and i love her more than php.

kei_ki7 Senior · 431 posts #7

Leviathan73 wrote: Spiders I signed up, where do I find id $botid = "eeb070e74e366473"; to change?

You posted it already at your chat.php replace your new botid there

Did I help you? You can help me too Your donations will help me finance my studies.

Leviathan73 Senior · 260 posts #8

I do not know where to look for new BOTID 🙁

spiderwebs Developer · 193 posts #9

when u signed for bot at pandorabot.com they generate bot id for u dude just try to fig it out

E107 Security Team Leader Proudly Support AccountLab Plus Billing Software

Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com

Leviathan73 Senior · 260 posts #10

there he found his place 🙂, and now that I do?

spiderwebs Developer · 193 posts #11

just replace existing bot id with ur bot id in ravebabe.php which u got frm pandorabot

E107 Security Team Leader Proudly Support AccountLab Plus Billing Software

Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com

Leviathan73 Senior · 260 posts #12

Spider I replaced only BOTID, but we write and not speak;(

spiderwebs Developer · 193 posts #13

u have to make it there n setup msgs in pandorabot

E107 Security Team Leader Proudly Support AccountLab Plus Billing Software

Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com

spiderwebs Developer · 193 posts #15

just look in pandorabot u will find everything dude

E107 Security Team Leader Proudly Support AccountLab Plus Billing Software

Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com

Leviathan73 Senior · 260 posts #17

I do not know, I have this function in the file core.php

//////////////////////////////////////////////////RAVEBABEfunction PostToHost($host, $path, $data_to_send){     $result = "";        $fp = fsockopen($host,80,$errno, $errstr, 30);        if( $fp)        {            fputs($fp, "POST $path HTTP/1.0\n");        fputs($fp, "Host: $host\n");        fputs($fp, "Content-type: application/x-www-form-urlencoded\n");        fputs($fp, "Content-length: " . strlen($data_to_send) . "\n");        fputs($fp, "Connection: close\n\n");        fputs($fp, $data_to_send);         while(!feof($fp)) {     $result .=  fgets($fp, 128);        }        fclose($fp);         return $result;        }  }
kiLLeR-eyEd_14 Senior · 382 posts #18

Leviathan73 wrote: I do not know, I have this function in the file core.php

//////////////////////////////////////////////////RAVEBABEfunction PostToHost($host, $path, $data_to_send){     $result = "";        $fp = fsockopen($host,80,$errno, $errstr, 30);        if( $fp)        {            fputs($fp, "POST $path HTTP/1.0\n");        fputs($fp, "Host: $host\n");        fputs($fp, "Content-type: application/x-www-form-urlencoded\n");        fputs($fp, "Content-length: " . strlen($data_to_send) . "\n");        fputs($fp, "Connection: close\n\n");        fputs($fp, $data_to_send);         while(!feof($fp)) {     $result .=  fgets($fp, 128);        }        fclose($fp);         return $result;        }  }

try to register at pandorabots.com then make a bot, publish it then get the bot id then copy and paste it to your script..If your bot still answers nothing, maybe ur host really has disabled fsockopen..

Leviathan73 Senior · 260 posts #19

my files are in php, pandorabots.com me create bot id in html. But if you are disabled, how do I enable them?

capofret Developer · 225 posts #20

Leviathan73 wrote: my files are in php, pandorabots.com me create bot id in html. But if you are disabled, how do I enable them?

why dont you do things step by step.

setup your bot at pandorabots.com (e.g. make keywords or questions that your bot can answer). if you didnt make anything there then it will not really work.

copy the id to your script then test it.

whats your host/server btw?

if you get these errors PHP Warning: fopen(http://www.example.com%29: failed to open stream: HTTP request failed! fsockopen(): unable to connect to … file_get_contents(): failed to open stream: HTTP request failed! PHP Warning: main(): Failed opening ‘http://www.example.com/index.html’ for inclusion … PHP Warning: include(/usr/local/index.php): failed to open stream: No such file or directory in …

then maybe its disabled.

to enable it, put

allow_url_fopen = On

in your php.ini file which is in your web directory in your host control panel.

if it still doesnt work, the problem maybe you 😊

LDSWAPWORLD site closed. im busy with other things in life like facebook , send me PM so i can add you 🙂 www.pinoySG.com

don't ask for help if you're not even helping yourself! i am tired of seeing the line "best site", i want to see something NEW and UNIQUE. maybe if i find one, ill go back to my wap life again.

External image (may be gone)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close