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: Cant call function from another module.  (Read 7880 times)

0 Members and 1 Guest are viewing this topic.

Offline crocks

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Cant call function from another module.
« on: October 09, 2012, 12:51:24 pm »
Hey Guys. I am trying to call function to show points in news module. This is what I am using:

in News.php
Code: [Select]
$this->register_module("points");
$points = $this->bot->core("points")->show_points($name);
$inside .= "You have ($points) points.";

Here is an error log from console:
Code: [Select]
Crocksbot [ERROR]       [News]  Undefined function show_points(Crocks)!
According to error log it seems like the news.php is still trying to find the function inside the news.php module instead of points.php as its been called.

Have I done anything wrong please?
Thanks in advance for help.
« Last Edit: October 09, 2012, 04:53:23 pm by crocks »

Offline Shelly

  • BeBot Apprentice
  • ***
  • Posts: 192
  • Karma: +0/-0
Re: Cant call function from another module.
« Reply #1 on: October 12, 2012, 02:53:08 am »
It would be my guess that you don't have a function declared, but you are attempting to call a function "show_points()"

Offline crocks

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: Cant call function from another module.
« Reply #2 on: October 12, 2012, 02:32:47 pm »
So I tryied to move the code to the default news.php module whichs being released here and it works. Guess I had some crazy bug in my news.php which I had customized for my guild. Anyway thanks for looking over that :)

Crocks

 

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