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

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

Author Topic: Whats wrong?  (Read 3003 times)

0 Members and 2 Guests are viewing this topic.

Offline Harry

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Whats wrong?
« on: August 12, 2007, 10:50:09 pm »
I recently started using PHP, so I know that I'm noob  :-\
I already used similar module, so I simply copied file and changed everything to armorshop. But when I do !armorshop , I get: "Broken plugin, recieved unhandled command: armorshop". Whats wrong in code?  ???
Code: [Select]
<?php

$thisClass 
= new armorshop($bot);

$commands["tell"]["armorshop"] = &$thisClass;

class 
armorshop
{
var $bot;
var $help;

function armorshop (&$bot)
{
$this -> bot = &$bot;

$this -> bot -> accesscontrol -> create ('tell''armorshop''GUEST');

}

     
     
function handler($source$msg$type)
{
$return false;

$vars explode(' 'strtolower($msg));
if (!empty($this -> bot -> commpre))
{
$vars[0] = substr($vars[0], 1);
}

$command $vars[0];

switch($command)
{
case 'armorshop':
$this -> bot -> send_output($source$this -> arm_blob(), $type);
break;
default:
$this -> bot -> send_output($source"Broken plugin, recieved unhandled command: $command"$type);
}
      
      }
      
      
function tell($source$msg)
{
$this -> handler ($source$msg1);
}

      function 
arm_blob()
{
$inside "##blob_title##my text##end##\n\n";
return $this -> bot -> make_blob("Armor Shop"$inside);
      }
      
}          
?>

Offline Parfet

  • BeBot User
  • **
  • Posts: 33
  • Karma: +0/-0
Re: Whats wrong?
« Reply #1 on: August 13, 2007, 04:01:50 pm »
change $thisClass to read $armorshop and &$thisClass to read &$armorshop, should work as intended

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


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


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

* Who's Online
  • Dot Guests: 180
  • 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