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: Calling a function from another module.  (Read 1376 times)

0 Members and 1 Guest are viewing this topic.

Offline Dochere

  • BeBot User
  • **
  • Posts: 43
  • Karma: +0/-0
Calling a function from another module.
« on: September 01, 2009, 12:37:04 pm »
Hi, i know this is rather basic, but bot programming is rather new to me as i mainly work with websites that are programmed inn a much simpler manner.


What I'm basically trying to do is call a modified function within "Points.php"

Code: [Select]
function user_points($name) {
$result = $this -> bot -> db -> select("SELECT points, nickname FROM #___raid_points WHERE id = " . $this -> points_to($name));
if ($result)
{
if($result[0][1] == "")
{
$this -> bot -> db -> query("UPDATE #___raid_points SET nickname = '".$this -> points_to_name($name)."' WHERE id = " . $this -> points_to($name));
}
$points = $this -> round($result[0][0]);
}
else
{
$points = 0;
}
return $points;
}

As you may see it only returns points for given user ($name).

How would i go forth calling this function from another module? (iwe looked through most modules to see if any uses any modules except their own)

All feedback appreciated :)


Offline Dochere

  • BeBot User
  • **
  • Posts: 43
  • Karma: +0/-0
Re: Calling a function from another module.
« Reply #1 on: September 01, 2009, 01:24:42 pm »
Bleh im blind, found a topick with exact same description. here.

 

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