L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 02:01:46 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Whats wrong?
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Whats wrong?  (Read 269 times)
0 Members and 1 Guest are viewing this topic.
Harry
Freshman
*
Offline Offline

Posts: 2


Whats wrong?
« on: August 12, 2007, 03:50:09 PM »

I recently started using PHP, so I know that I'm noob  Undecided
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?  Huh
Code:
<?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, $msg, 1);
}

      function 
arm_blob()
{
$inside = "##blob_title##my text##end##\n\n";
return $this -> bot -> make_blob("Armor Shop", $inside);
      }
      
}          
?>
Logged
Parfet
Rookie
**
Offline Offline

Posts: 33


Re: Whats wrong?
« Reply #1 on: August 13, 2007, 09:01:50 AM »

change $thisClass to read $armorshop and &$thisClass to read &$armorshop, should work as intended
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Whats wrong?
« previous next »
 
Jump to:  

Recent
[request] Raid timers
by Alreadythere
[Today at 11:42:32 AM]

Shared DB online list
by Temar
[Today at 01:55:47 AM]

relay colors
by Temar
[Today at 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]

Starting Bot
by Allisande
[November 28, 2008, 07:08:21 AM]
Stats
Members
Total Members: 1243
Latest: Whackoeng
Stats
Total Posts: 11143
Total Topics: 1505
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 15
Total: 16

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.48 seconds with 28 queries. (Pretty URLs adds 0.025s, 4q)
Loading...