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: Whats wrong?  (Read 1631 times)

0 Members and 1 Guest 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
[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: 684
  • 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