collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Need help! How can I allow "Anonymous Users" Botscripts?  (Read 1853 times)

0 Members and 1 Guest are viewing this topic.

Offline maikee

  • BeBot Rookie
  • *
  • Posts: 17
  • Karma: +0/-0
Need help! How can I allow "Anonymous Users" Botscripts?
« on: May 02, 2011, 03:15:22 pm »
Hi

I need help by the following Module

Code: [Select]
<?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(&$botget_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?
« Last Edit: May 02, 2011, 03:16:56 pm by maikee »

Offline Drizzurdeen

  • BeBot Apprentice
  • ***
  • Posts: 193
  • Karma: +0/-0
    • Obsidian-Cult
Re: Need help! How can I allow "Anonymous Users" Botscripts?
« Reply #1 on: May 03, 2011, 11:10:17 am »
u have to change the accesslevel of the module ... i thinkg u can do this with !commands or !command ...

Offline maikee

  • BeBot Rookie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Need help! How can I allow "Anonymous Users" Botscripts?
« Reply #2 on: May 03, 2011, 09:12:22 pm »
Thanks.
Now it works

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 544
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal