BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => AO 0.6 support => Topic started by: Dochere on September 01, 2009, 12:37:04 pm

Title: Calling a function from another module.
Post by: Dochere 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 :)

Title: Re: Calling a function from another module.
Post by: Dochere on September 01, 2009, 01:24:42 pm
Bleh im blind, found a topick with exact same description. here (http://bebot.link/coding-and-development-discussion/how-to-call-method-in-other-module).
SimplePortal 2.3.7 © 2008-2024, SimplePortal