Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. #!/usr/bin/php
  2. <?php
  3.  
  4.   require("cbot.php");
  5.  
  6.   if (empty($argv[1]))
  7.   {
  8.     die("Usage: bot2bot <start phrase>\n");
  9.   }
  10.  
  11.   $bots = array(new CBot(), new CBOt());
  12.  
  13.   $resp = $argv[1];
  14.   $bots[1]->say($resp, false);
  15.  
  16.   $cbot = -1;
  17.   while (true)
  18.   {
  19.     $cbot++;
  20.     if ($cbot == 2) $cbot = 0;
  21.    
  22.     echo "Bot ".($cbot + 1).": $resp\n";
  23.     $resp = $bots[$cbot]->say($resp);
  24.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement