0 Members and 1 Guest are viewing this topic.
!eightball
<?php/** eightball.php - A Social Module** Developed by Sicarius Legion of Amra* a Age of Conan Guild on the Hyrkania server**/ /* Add a "_" at the beginning of the file (_eightball.php) if you do not want it to be loaded.*/ $eightball = new EightBall($bot);/* The Class itself...*/class EightBall Extends BaseActiveModule { var $bot; var $eightball; var $returnstr; /* Constructor: Hands over a referance to the "Bot" class. */ function __construct (&$bot) { parent::__construct(&$bot, get_class($this)); $this -> register_command("all", "eightball", "MEMBER"); $this -> help['description'] = "Shows eightball quotes."; $this -> help['command']['eightball']="Use !eightball to generate a random eightball quote"; } function command_handler($name, $msg, $origin) { $output = ""; if (preg_match("/^eightball$/i", $msg, $info)) { $output = $this -> get_eightball($name); } return $output; } /* This gets called on a msg in the guildchat with the command */ function irc($name, $msg) { $returnstr = $this -> get_eightball($name); $this -> bot -> send_gc($returnstr); $this -> bot -> send_irc("", "", "3" . $returnstr); } /* Build response */ function get_eightball($name) { $eightball = array( "As I see it, yes", "It is certain", "It is decidedly so", "Most likely", "Outlook good", "Signs point to yes", "Without a doubt", "Yes", "Yes - definitely", "You may rely on it", "Reply hazy, try again", "Ask again later", "Better not tell you now", "Cannot predict now", "Concentrate and ask again", "Don't count on it", "My reply is no", "My sources say no", "Outlook not so good", "Very doubtful" ); // You can add more possible responses to the array above. $dmg = rand(100,999); $creds = rand(10000,9999999); $returnstr = $eightball[rand(0,sizeof($eightball)-1)]; $returnstr = str_replace("*name*",$name,$returnstr); $returnstr = str_replace("*dmg*",$dmg,$returnstr); $returnstr = str_replace("*creds*",$creds,$returnstr); return $returnstr; }}?>
$returnstr = str_replace("*dmg*",$dmg,$returnstr); $returnstr = str_replace("*creds*",$dmg,$returnstr);
$returnstr = str_replace("*dmg*",$dmg,$returnstr); $returnstr = str_replace("*creds*",$creds,$returnstr);