Hi
I need help by the following Module
<?php
/*
* Trader.php
* For BeBot - An Anarchy Online & Age of Conan Chat Automaton Developed by Blondengy (RK1)
* Copyright (C) 2009 Daniel Holmen
*
* As usual place this file in ./modules
*/
/*
Add a "_" at the beginning of the file (_Traders.php) if you do not want it to be loaded.
*/
$Traders = new Traders($bot);
class Traders extends BaseActiveModule
{
function __construct (&$bot)
{
parent::__construct(&$bot, get_class($this));
$this -> register_command('all', 'trader', "ANONYMOUS");
$this -> help['description'] = 'Kulturwaffenverkauf';
}
function command_handler($name, $msg, $origin)
{
$output = "";
if (strtolower($msg) == "trader")
{
$output = $this->generate_list();
}
else if (preg_match("/^trader.*$/i", $msg))
{
// Handle arguments
$cmdparam = explode(" ", $msg);
// Handle commands
if (preg_match("/^search$/i", $cmdparam[1]))
{
$searchstring = preg_replace("/^trader.*search(.*)/i", "$1", $msg);
$output = $this->search($searchstring);
}
else if (preg_match("/^class$/i", $cmdparam[1]))
{
$classname = $this->get_class_name(preg_replace("/^trader.*class(.*)/i", "$1", $msg));
if ($classname != "")
{
// Class name found, display weapons for class.
$output .= $this->generate_list($classname);
}
}
else
{
// Check for class names without any command prefix
$classname = $this->get_class_name(preg_replace("/^trader(.*)/i", "$1", $msg));
if ($classname != "")
{
// Class name found, display weapons for class.
$output .= $this->generate_list($classname);
}
else
{
$output = "Unknown command/parameter";
}
}
}
return $output;
}
function generate_list($class = "")
{
$output = "";
$traderslist = $this->get_traders();
$lastclass = "";
foreach($traderslist as $key => $value)
{
if ($class == "" || $class == $value[0])
{
// Display header for each class
if ($lastclass != $value[0])
{
if ($lastclass != "") $output .= "<br>";
$lastclass = $value[0];
$output .= "<font face='HEADLINE' color=#c0c0c0>".$lastclass."</font><br>";
}
$output .= " <a href='chatcmd:///tell ".$this->bot->botname." item ".$value[3]."'>[".$value[2]."]</a> (".$value[1].")<br>";
}
}
if ($class == "") $linktitle = "Was ich anbiete (Hier Klicken)";
else $linktitle = "Was ich anbiete ".$class." (Klicken für Info)";
return "<a href=\"text://<div align=left>".$output."</div>\">".$linktitle."</a>";
}
function get_traders()
{
$traderslist = array( // Class, Item Type, Name
array("Kulturwaffen", "2-händig Klinge ", "Asgardische Schneeaxt", "3857929"),
array("Kulturwaffen", "2-händig Klinge ", "Vanaheimischer Überfalbrecher", "3857930"),
array("Kulturwaffen", "1-händig Klinge ", "Brythunische Kavalerieaxt", "3857927"),
array("Kulturwaffen", "Dolch ", "Asurischer Zeremoniendolch", "3857933"),
array("Kulturwaffen", "Talisman ", "Auge von Zath", "3857934"),
array("Kulturwaffen", "Talisman ", "Dagons Glück", "3857937"),
);
return $traderslist;
}
}
?>
My problem is that the bot says when an "Anonymous User" tells my Bot for this Script : I only listen to members of this bot.
I will Anonymous Users allow this script.
Is something wrong in the Script?