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: Updated Points.php  (Read 13637 times)

0 Members and 1 Guest are viewing this topic.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Updated Points.php
« on: November 15, 2005, 05:43:05 am »
This adds support to view single users points by: points <name> aswell as ability to view top25 points by: points top25 (actually, points top<anynumber>, but it will only return top 25)

Code: [Select]

<?
  /*
   * Points.php - Handles raidpoints.
   *
   * BeBot - An Anarchy Online Chat Automaton
   * Copyright (C) 2004 Jonas Jax
   *
   * Developed by Blondengy (RK1)
   * Special thanks goes out to Khalem (RK1) for his support.
   *
   * File last changed at $LastChangedDate: 2004-12-29 01:41:32 +0100 (Wed, 29 Dec 2004) $
   * Revision: $Id: Points_RAID.php 8 2004-12-29 00:41:32Z blondengy $
   */


  $points = new Points($bot);

  $commands["tell"]["points"] = &$points;


  $db -> query("CREATE TABLE IF NOT EXISTS raid_points
              (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
              points INT,
                                                        raiding TINYINT DEFAULT '0')");




  /*
    The Class itself...
  */
  class Points
  {
    var $bot;
    var $transfer;
    var $tomain;



    /*
      Constructor:
        Hands over a referance to the "Bot" class.
    */
    function Points (&$bot)
    {
      $this -> bot = &$bot;

      $result = $this -> bot -> db -> select("SELECT value FROM settings WHERE setting = 'points_transfer'");
      if (empty($result))
        $this -> transfer = 0;
      else
        $this -> transfer = $result[0][0];

      $result = $this -> bot -> db -> select("SELECT value FROM settings WHERE setting = 'points_tomain'");
      if (empty($result))
        $this -> tomain = 0;
      else
        $this -> tomain = $result[0][0];
    }



    /*
      This gets called on a tell with the command
    */
    function tell($name, $msg)
    {
                        if (preg_match("/^" . $this -> bot -> commpre . "points give (.+) ([0-9]+)$/i", $msg, $info))
                                $this -> give_points($name, $info[1], $info[2]);
                        else if (preg_match("/^" . $this -> bot -> commpre . "points add (.+) ([0-9]+)$/i", $msg, $info))
                                $this -> add_points($name, $info[1], $info[2]);
                        else if (preg_match("/^" . $this -> bot -> commpre . "points (del|rem) (.+) ([0-9]+)$/i", $msg, $info))
                                $this -> rem_points($name, $info[2], $info[3]);
                        else if (preg_match("/^" . $this -> bot -> commpre . "points transfer (on|off)$/i", $msg, $info))
                                $this -> transfer_points($name, $info[1]);
                        else if (preg_match("/^" . $this -> bot -> commpre . "points tomain (on|off)$/i", $msg, $info))
                                $this -> tomain_points($name, $info[1]);
                        else if (preg_match("/^" . $this -> bot -> commpre . "points all$/i", $msg))
                                $this -> all_points($name);
                        else if (preg_match("/^" . $this -> bot -> commpre . "points top([0-9]+)$/i", $msg))
                                $this -> top_points($name);
                        else if (preg_match("/^" . $this -> bot -> commpre . "points (.+)$/i", $msg, $info))
                                $this -> show_points($name, $info[1]);

                        else
                                $this -> show_points($name, false);
    }



    /*
                Shows your points
    */
    function show_points($name, $target)
    {
        if (!$target)
        {
                if (!$this -> bot -> aoc -> get_uid($target))
                {
                        $this -> bot -> send_tell ($name, "Player <font color=#ffff00>$who</font> does not exist.");
                }
                else
                {
                        $result = $this -> bot -> db -> select("SELECT points FROM raid_points WHERE id = " . $this -> points_to($name));
                        $this -> bot -> send_tell($name, "You have <font color=#ffff00>" . ($result[0][0] / 10) . "</font> raidpoints.");
                }
        }
        else
        {
                if ($this -> bot -> admin -> in_group($name, "superadmin") || $this -> bot -> admin -> in_group($name, "admin"))
                {
                        if (!$this -> bot -> aoc -> get_uid($target))
                        {
                                $this -> bot -> send_tell ($name, "Player <font color=#ffff00>$target</font> does not exist.");
                        }
                        else
                        {
                                $result = $this -> bot -> db -> select("SELECT points FROM raid_points WHERE id = " . $this -> points_to($target));
                                $this -> bot -> send_tell($name, "Player " . $target . " has <font color=#ffff00>" . ($result[0][0] / 10) . "</font> raidpoints.");
                        }
                }
                else
                {
                        $this -> bot -> send_tell($name, "You must be an admin to do this");
                }

        }
    }




    /*
                Shows your points
    */
    function all_points($name)
    {
                        if ($this -> bot -> admin -> in_group($name, "superadmin"))
                        {
        $result = $this -> bot -> db -> select("SELECT nickname, points FROM raid_points, members WHERE raid_points.id = members.id AND NOT points = 0 ORDER BY points DESC");
        $inside = "<font color=CCInfoHeadline>:::: All raidpoints ::::</font><font color=CCInfoText>\n\n";
        if (!empty($result))
        foreach ($result as $val)
        {
                $inside .= $val[0] . " <font color=CCCCTextColor>" . ($val[1] / 10) . "</font>\n";
        }

        $this -> bot -> send_tell($name, "All raidpoints :: " . $this -> bot -> make_blob("click to view", $inside));
                        }
                        else
                                $this -> bot -> send_tell($name, "You must be a superadmin to do this");
    }


    /*
                Shows top25 points
    */
    function top_points($name)
    {
        $result = $this -> bot -> db -> select("SELECT nickname, points FROM raid_points, members WHERE raid_points.id = members.id AND NOT points = 0 ORDER BY points DESC LIMIT 0,25");
        $inside = "<font color=CCInfoHeadline>:::: Top 25 raidpoints ::::</font><font color=CCInfoText>\n\n";
        if (!empty($result))
        {
                $num = 1;
                foreach ($result as $val)
                {
                        $inside .= "<font color=CCCCTextColor>" . $num . ".</font> " . $val[0] . " <font color=CCCCTextColor>" . ($val[1] / 10) . "</font>\n";
                        $num++;
                }
                $this -> bot -> send_tell($name, "Top 25 raidpoints :: " . $this -> bot -> make_blob("click to view", $inside));
        }
        else
        {
                $this -> bot -> send_tell($name, "Im sorry but there appears to be no one with raidpoints yet");
        }
    }





    /*
                Use main char's account for points...
    */
    function tomain_points($name, $toggle)
    {
                        if ($this -> bot -> admin -> in_group($name, "superadmin"))
                        {
        $this -> bot -> db -> query("DELETE FROM settings WHERE setting = 'points_tomain'");
                        $toggle == strtolower($toggle);
                                $new = (($toggle == "on") ? 1 : 0);
                                $this -> bot -> db -> query("INSERT INTO settings (setting, value) VALUES ('points_tomain', $new)");

                                $this -> tomain = $new;

                                $add = "";

                                if ($new == 1)
                                {
                                $result = $this -> bot -> db -> select("SELECT id, points FROM raid_points WHERE points != 0");
                                foreach ($result as $res)
                                {
                                        if ($res[0] != $this -> points_to($res[0]))
                                        {
                                                $this -> bot -> db -> query("UPDATE raid_points SET points = 0 WHERE id = " . $res[0]);
                                        $resu = $this -> bot -> db -> select("SELECT points FROM raid_points WHERE id = " . $this -> points_to($res[0]));
                                        if (empty($resu))
                                                $this -> bot -> db -> query("INSERT INTO raid_points (id, points, raiding) VALUES (" . $this -> points_to($res[0]) . ", " . $res[1] . ", 0)");
                                        else
                                                        $this -> bot -> db -> query("UPDATE raid_points SET points = " . ($res[1] + $resu[0][0]) . " WHERE id = " . $this -> points_to($res[0]));
                                        }
                                        }
                                $add = " All points have been transfered.";
                        }

                                $this -> bot -> send_tell($name, "Points going to the main character's account is now <font color=#ffff00>" .
                                                                        (($new == 1) ? "enabled" : "disabled") . "</font>." . $add);
                        }
                        else
                                $this -> bot -> send_tell($name, "You must be a superadmin to do this");
    }




    /*
                Enable/Disable !points give
    */
    function transfer_points($name, $toggle)
    {
                        if ($this -> bot -> admin -> in_group($name, "superadmin"))
                        {
        $this -> bot -> db -> query("DELETE FROM settings WHERE setting = 'points_transfer'");
                        $toggle == strtolower($toggle);
                                $new = (($toggle == "on") ? 1 : 0);
                                $this -> bot -> db -> query("INSERT INTO settings (setting, value) VALUES ('points_transfer', $new)");

                                $this -> transfer = $new;

                                $this -> bot -> send_tell($name, "Transfering points has been <font color=#ffff00>" .
                                                                        (($new == 1) ? "enabled" : "disabled") . "</font>.");
                        }
                        else
                                $this -> bot -> send_tell($name, "You must be a superadmin to do this");
    }




    /*
                Transfers points
    */
    function give_points($name, $who, $num)
    {
        if ($this -> transfer != 0)
        {
        $result = $this -> bot -> db -> select("SELECT points FROM raid_points WHERE id = " .
                                                                                                                                            $this -> points_to($name));

                        if ($num > ($result[0][0] / 10))
                                $this -> bot -> send_tell ($name, "You only have <font color=#ffff00>" .
                                                                                                                                        ($result[0][0] / 10) . "</font> raid points.");
                        else if (!$this -> bot -> aoc -> get_uid($who))
                                $this -> bot -> send_tell ($name, "Player <font color=#ffff00>$who</font> does not exist.");
                        else
                        {
                        $this -> bot -> db -> query("UPDATE raid_points SET points = points - " . ($num * 10) .
                                                                                                                                            " WHERE id = " . $this -> points_to($name));
                        $this -> bot -> db -> query("UPDATE raid_points SET points = points + " . ($num * 10) .
                                                                                                                                            " WHERE id = " . $this -> points_to($who));
                                $this -> bot -> send_tell($name, "You gave <font color=#ffff00>$num</font> raidpoints to <font color=#ffff00>$who</font>.");
                                $this -> bot -> send_tell($who, "You got <font color=#ffff00>$num</font> raidpoints from <font color=#ffff00>$name</font>.");
                        }
                }
                else
                        $this -> bot -> send_tell($name, "Transfering points has been <font color=#ffff00>disabled</font>.");
    }




    /*
                Adds points
    */
    function add_points($name, $who, $num)
    {
                        if ($this -> bot -> admin -> in_group($name, "superadmin"))
                        {
                        if (!$this -> bot -> aoc -> get_uid($who))
                                $this -> bot -> send_tell ($name, "Player <font color=#ffff00>$who</font> does not exist.");
                        else
                        {
                        $this -> bot -> db -> query("UPDATE raid_points SET points = points + " . ($num * 10) .
                                                                                                                                            " WHERE id = " . $this -> points_to($who));
                                $this -> bot -> send_pgroup("<font color=#ffff00>$name</font> added <font color=#ffff00>$num</font> raidpoints to <font color=#ffff00>$who</font>'s account.");
                                $this -> bot -> send_tell($name, "You added <font color=#ffff00>$num</font> raidpoints to <font color=#ffff00>$who</font>'s account.");
                                $this -> bot -> send_tell($who, "<font color=#ffff00>$name</font> added <font color=#ffff00>$num</font> raidpoints to your account.");
                        }
                        }
                        else
                                $this -> bot -> send_tell($name, "You must be a superadmin to do this");
    }




    /*
                Remove points
    */
    function rem_points($name, $who, $num)
    {
                        if ($this -> bot -> admin -> in_group($name, "superadmin"))
                        {
                        if (!$this -> bot -> aoc -> get_uid($who))
                                $this -> bot -> send_tell ($name, "Player <font color=#ffff00>$who</font> does not exist.");
                        else
                        {
                        $this -> bot -> db -> query("UPDATE raid_points SET points = points - " . ($num * 10) .
                                                                                                                                            " WHERE id = " . $this -> points_to($who));
                                $this -> bot -> send_pgroup("<font color=#ffff00>$name</font> removed <font color=#ffff00>$num</font> raidpoints from <font color=#ffff00>$who</font>'s account.");
                                $this -> bot -> send_tell($name, "You removed <font color=#ffff00>$num</font> raidpoints from <font color=#ffff00>$who</font>'s account.");
                                $this -> bot -> send_tell($who, "<font color=#ffff00>$name</font> removed <font color=#ffff00>$num</font> raidpoints from your account.");
                        }
                }
                        else
                                $this -> bot -> send_tell($name, "You must be a superadmin to do this");
    }



                /*
                        Get correct char for points
                */
                function points_to($name)
                {
                        if ($this -> tomain == 0)
                                return $this -> bot -> aoc -> get_uid($name);

                        $main = $this -> bot -> alts -> main($name);
                        return $this -> bot -> aoc -> get_uid($main);
                }
  }
?>
BeBot Founder and Fixer Kingpin

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Updated Points.php
« Reply #1 on: November 18, 2005, 12:13:32 am »
Hi Khalem,

Had a quick play with this, 3 people have points in guild, yet only 2 showing in top 25...?

Cheers,

-jj-

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Updated Points.php
« Reply #2 on: November 18, 2005, 04:11:04 am »
There is an issue i discovered myself that could be the reason.

The points module was designed for standalone raidbots, and from what i can tell offhand, guild members wont be entered into the points table unless they have actually done !raid join to an active raid at least once.

In short, the points module doesnt take this into account, so it may report that points have been added to someone, but in reality it might not have actually have added them.
BeBot Founder and Fixer Kingpin

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Updated Points.php
« Reply #3 on: November 18, 2005, 08:50:35 am »
Hi Khalem,

Sorry I should have been a little more specific - it was 2AM when I wrote that =)

Basically, the points are on all three people's accounts doing !points from each person but if you do !points top25, it only shows two people in the list.  If you do !points <playername> that works fine also, showing the correct amounts.

I will try and dump SQL table Raid_points to text tonite to double check that all three people actually have points allocated in there (however, restarted bot etc and !points is still giving correct information for all three people).

Cheers,

-b-

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Updated Points.php
« Reply #4 on: November 18, 2005, 11:40:48 am »
Hrm. Another thought.

Are all 3 actually members of the guild?
BeBot Founder and Fixer Kingpin

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Updated Points.php
« Reply #5 on: November 18, 2005, 04:06:23 pm »
The two showing in top25 are in guild, the one which doesn't show isn't in guild.

-jj-

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Updated Points.php
« Reply #6 on: November 18, 2005, 04:22:21 pm »
Ok.

This is happening because blondengy probably never intended the points module to be used outside of a stand alone raid bot.

Basically whats happening is that your out of guild buddy is getting his points stored in the raid points table. However, the raid table only contains the character id. This characterid is then referenced with the members table to get the name of the character. On a guild bot, non guilded users wont be in the members table, which is also why he wont show in top25 :\

Im not sure if there is really a good way to handle this case short of adding the name to the raid points table. The problem with that again is that you'd be storing a lot of uneccecary data as 99% of the people with raid points, will either be members of the guild if its a guild bot, or everyone in the case of a raid bot.
Then again im dead tired atm, anyone else have thoughts on this one?
BeBot Founder and Fixer Kingpin

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Updated Points.php
« Reply #7 on: November 18, 2005, 06:42:39 pm »
Easy to fix :-)

http://bebot.fieses.net/viewtopic.php?t=135

Using Xenixa's updated ROOSTER_GUILD script above, so manually added member to bot's roster with !member command.

Works fine now :-)

Cheers for the support Khalem!

-jj-

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Updated Points.php
« Reply #8 on: November 18, 2005, 09:28:33 pm »
Actually, that wont fix it too well though :(

The problem lies with how the rest of the Guild rooster is handeled.
Every 12 hours the bot basically deletes the guild rooster and updates it from the funcom XML (not a solution im too happy with), so in under 12 hours, when the cronjob to update the guild rooster runs again, he will be removed :\

I'll need to think about this one a bit more, definately not something i want to do in my current tired state.
BeBot Founder and Fixer Kingpin

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Updated Points.php
« Reply #9 on: November 18, 2005, 10:32:47 pm »
I myself thought that over in the past. The best solution for my org was to just make a 2nd Org Raid bot seperate of the Organization bot since we leave the Relay on at all times for guests.

Running a raid with raid chatter in the Org bots Private channel only servered to annoy Org members and guests not involved in the raid.

You can still use the same database for a Raid bot and a Guild bot so thats not really an issue.

Oh and the !member command in my Rooster_GUILD.php is only a temporary thing. When our recruiting Dept adds a new member they toss them on the Member roster so their on the bot buddy list until FC gets around to making it's updates. My own personal copy of Rooster_GUILD has the cron job set to 18 hrs BTW for the rare occation that someone may be added in that period just after FC update's the XML db's. Just keeps them from being removed from the bots buddy list to soon really.

Edit: I guess I should mention I added a 18hr Cron job to the Bot.php  also. :)
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Uragon

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Updated Points.php
« Reply #10 on: February 25, 2008, 11:13:15 pm »
This feels a bit like a necro, but well... here's some bug fixes to the Points module included in BeBot 0.4.3, which seems to be based off this module:
Code: [Select]
--- Points.php.orig     2008-02-25 21:58:48.000000000 +0100
+++ Points.php  2008-02-25 21:56:16.000000000 +0100
@@ -73,7 +73,7 @@
                $this -> help['command']['points transfer <(on|off)>'] = "Turns ability to give points on or off.";
                $this -> help['command']['points tomain <(on|off)>'] = "Turns ability to give points from alts to main on or off.";
                $this -> help['command']['points all'] = "Shows the combined number of points on your main and alts.";
-               $this -> help['command']['points top <cutoff>'] = "Shows the <cutoff> biggest point accounts.";
+               $this -> help['command']['points top<cutoff>'] = "Shows the <cutoff> biggest point accounts.";

                $this -> bot -> accesscontrol -> create("tell", "points", "GUEST");
        }
@@ -96,8 +96,8 @@
                $this -> tomain_points($name, $info[1]);
                else if (preg_match("/^" . $this -> bot -> commpre . "points all$/i", $msg))
                $this -> all_points($name);
-               else if (preg_match("/^" . $this -> bot -> commpre . "points top([0-9]+)$/i", $msg))
-               $this -> top_points($name);
+               else if (preg_match("/^" . $this -> bot -> commpre . "points top([0-9]+)$/i", $msg, $info))
+               $this -> top_points($name, $info[1]);
                else if (preg_match("/^" . $this -> bot -> commpre . "points (.+)$/i", $msg, $info))
                $this -> show_points($name, $info[1]);

@@ -171,7 +171,7 @@
                if ($this -> bot -> security -> check_access($name, "superadmin"))
                {
                        $this -> bot -> send_tell($name, "Fetching full list of points, this might take a while.");
-                       $result = $this -> bot -> db -> select("SELECT nickname, points FROM #___raid_points, #___members WHERE #___raid_points.id = #___members.id AND NOT points = 0 ORDER BY points DESC");
+                       $result = $this -> bot -> db -> select("SELECT nickname, points FROM #___raid_points, #___whois WHERE #___raid_points.id = #___whois.id AND NOT points = 0 ORDER BY points DESC");
                        $inside = "<font color=CCInfoHeadline>:::: All raidpoints ::::</font><font color=CCInfoText>\n\n";
                        if (!empty($result))
                        {
@@ -189,12 +189,12 @@


        /*
-       Shows top25 points
+       Shows top<cutoff> points
        */
-       function top_points($name)
+       function top_points($name, $cutoff)
        {
-               $result = $this -> bot -> db -> select("SELECT nickname, points FROM #___raid_points, #___members WHERE #___raid_points.id = #___members.id AND NOT points = 0 ORDER BY points DESC LIMIT 0,25");
-               $inside = "<font color=CCInfoHeadline>:::: Top 25 raidpoints ::::</font><font color=CCInfoText>\n\n";
+               $result = $this -> bot -> db -> select("SELECT nickname, points FROM #___raid_points, #___whois WHERE #___raid_points.id = #___whois.id AND NOT points = 0 ORDER BY points DESC LIMIT 0,$cutoff");
+               $inside = "<font color=CCInfoHeadline>:::: Top $cutoff raidpoints ::::</font><font color=CCInfoText>\n\n";
                if (!empty($result))
                {
                        $num = 1;
@@ -203,7 +203,7 @@
                                $inside .= "<font color=CCCCTextColor>" . $num . ".</font> " . $val[0] . " <font color=CCCCTextColor>" . ($val[1] / 10) . "</font>\n";
                                $num++;
                        }
-                       $this -> bot -> send_tell($name, "Top 25 raidpoints :: " . $this -> bot -> make_blob("click to view", $inside));
+                       $this -> bot -> send_tell($name, "Top $cutoff raidpoints :: " . $this -> bot -> make_blob("click to view", $inside));
                }
                else
                {
This fixes the !points top<cutoff> command to actually do what its !help text suggests, and retrieves the character ID out of the whois cache instead of the members table. Not sure wether the whois cache or the users table (botname_users) would be the best data source for this, but at least this seems to work. Feedback welcome. :)

Offline Trancillion

  • BeBot User
  • **
  • Posts: 20
  • Karma: +0/-0
Re: Updated Points.php
« Reply #11 on: February 26, 2008, 11:10:04 am »
With the fix from Uragon:

Parse error: syntax error, unexpected T_FUNCTION, expecting ';' or '{' in D:\0.4
.3\modules\Points.php on line 201

Line 200  function top_points($name)
Line 201  function top_points($name, $cutoff)
Line 202 

so i tried just for fun to rem out the line it's complaining on:
/*function top_points($name, $cutoff)*/

and it gives me this error after that:

Noctrish [2008-02-26 08:56:09]  [TELL]  [INC]   Trancillion: !points
Noctrish [2008-02-26 08:56:09]  [TELL]  [OUT]   -> Trancillion: You have 353.2 raidpoints.
Noctrish [2008-02-26 08:56:13]  [TELL]  [INC]   Trancillion: !points top25
MySQL error (# 0) on query: SELECT nickname, points FROM noctrish_raid_points, noctrish_members WHERE noctrish_raid_points.id = noctrish_members.id AND NOT points = 0 ORDER BY points DESC LIMIT 0,25
Table 'nfbebot.noctrish_members' doesn't exist
MySQL error (# 1) on query: SELECT nickname, points FROM noctrish_raid_points, whois WHERE noctrish_raid_points.id = whois.id AND NOT points = 0 ORDER BY points
 DESC LIMIT 0,
You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near '' at line 1
Noctrish [2008-02-26 08:56:13]  [TELL]  [OUT]   -> Trancillion: Im sorry but there appears to be no one with raidpoints yet

This should be able to run in a normal guildbot, or am i complitly wrong?

and on Khalem's, i'm only getting an error :|

MySQL error (# 0) on query: SELECT value FROM settings WHERE setting = 'points_transfer'
Table 'nfbebot.settings' doesn't exist
MySQL error (# 1) on query: SELECT value FROM settings WHERE setting = 'points_tomain'
Table 'nfbebot.settings' doesn't exist

(For the database, i guess it should point to nfbebot.noctrish_settings)

Hope someone can understand this more than i can :P or correct me where i f*cked up :P
« Last Edit: February 26, 2008, 11:16:40 am by Trancillion »

Offline Uragon

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Updated Points.php
« Reply #12 on: February 26, 2008, 03:40:35 pm »
Hmm, this looks like you somehow didn't apply the patch correctly. I'll attach the complete source code, with a bit of luck that will work for you.

Offline Trancillion

  • BeBot User
  • **
  • Posts: 20
  • Karma: +0/-0
Re: Updated Points.php
« Reply #13 on: February 26, 2008, 04:32:51 pm »
yay finaly worked ^^ had some problems with the one that was following with the bot aswell. but all seems to work now, thank you :)

Offline keirou

  • BeBot Apprentice
  • ***
  • Posts: 90
  • Karma: +0/-0
Re: Updated Points.php
« Reply #14 on: January 10, 2009, 03:45:45 am »
Im a php / sql noob... was wondering, is there away to get the points to list alhpabetically??
i have a look and saw this code

$result = $this -> bot -> db -> select("SELECT nickname, points FROM #___raid_points, #___users WHERE #___raid_points.id = #___users.char_id AND NOT points = 0 ORDER BY points DESC");

and assume it has to do with that, but wouldn't know what to change.

the part i want sorted alphabetically is !points all

 

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