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: Giving me grey hairs :/  (Read 1801 times)

0 Members and 1 Guest are viewing this topic.

Offline Nesi

  • BeBot User
  • **
  • Posts: 55
  • Karma: +0/-0
Giving me grey hairs :/
« on: April 19, 2005, 09:52:45 am »
Trying to use:

if ($this -> bot -> admin -> in_group($user, "xxxxxgroup"))

In bot.php

Restarts the bot with the following error :

Fatal error: Call to a member function on a non-object.


Trying to use it in the incomming tell section.

Anyone got a clue how to make that work there?

Offline Nesi

  • BeBot User
  • **
  • Posts: 55
  • Karma: +0/-0
Giving me grey hairs :/
« Reply #1 on: April 19, 2005, 09:57:38 am »
I can't make it call the database from bot.php either...

Offline Zacix

  • Contributor
  • *******
  • Posts: 73
  • Karma: +0/-0
Giving me grey hairs :/
« Reply #2 on: April 19, 2005, 12:59:14 pm »
take away bot-> so it becomes:

if ($this -> admin -> in_group($user, "xxxxxgroup"))


since you are inside the Bot class, $this means the instance of the bot class. whereas $this ->bot which is used inside modules means a reference to the same class. Note that in the beginning/constructor of each module, a reference to the bot class is stored in a variable called $bot, hence u can access functions inside the bot class by doing $this ->bot->bot_class_function. In this case $this means the module class.
Zacix
Current projects:
RINGBot, BeBot branch
Neutnet, RK2 Neutral massmessage network

Offline Nesi

  • BeBot User
  • **
  • Posts: 55
  • Karma: +0/-0
Giving me grey hairs :/
« Reply #3 on: April 19, 2005, 10:39:14 pm »
Yeah, figured that out like 5 mins after i posted that hehe, thanks for the reply tho.

 

* 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: 658
  • 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