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: Calling a function from another module.  (Read 1664 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
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: 305
  • 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