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

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

Author Topic: How to call method in other module  (Read 5049 times)

0 Members and 1 Guest are viewing this topic.

Offline onekman

  • BeBot Rookie
  • *
  • Posts: 15
  • Karma: +0/-0
How to call method in other module
« on: July 11, 2009, 06:22:56 pm »
Hey,

I'm no "shark" into PHP, so I need help with following issue.

I created a new module, consisting of new methods, which can be use from the bot.

However I now created another module, where I need to call one of the methods from the old module.

How is that possible ? pls attach an example if possible.

Thanks ind advance for a great piece of work :)

/1k

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: How to call method in other module
« Reply #1 on: July 12, 2009, 10:07:31 am »
You have to register the module offering the functions with the bot core.
$this->register_module("some_unique_name");

Then you can access the module from anywhere by using the core() function.
$this->bot->core("some_unique_name")->function_you_want_to_call();

 

* Recent Posts
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 ]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm ]

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