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: AoC: Add PvP level to whois/logon notifie  (Read 12468 times)

0 Members and 1 Guest are viewing this topic.

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
AoC: Add PvP level to whois/logon notifie
« on: February 15, 2009, 06:05:25 pm »
In AoC we have PvP lvl.
This isnt querie able, but what if its added a command like "!setcraft" that add it to member table?
And then also showed when doing whois.
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: AoC: Add PvP level to whois/logon notifie
« Reply #1 on: March 04, 2009, 11:09:09 pm »
*Bump*

Any chance to get this?
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline Wizhk

  • BeBot Apprentice
  • ***
  • Posts: 85
  • Karma: +0/-0
Re: AoC: Add PvP level to whois/logon notifie
« Reply #2 on: March 05, 2009, 08:21:47 am »
Yg.com has this information.

Would be nice to see on the bot.

Wizhk

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: AoC: Add PvP level to whois/logon notifie
« Reply #3 on: March 05, 2009, 11:32:10 am »
YG.com is not relable imo...
They scan a specific area with a player char, taking the information out of memory the client has around him and saving it to DB.
I have alot of alts, non of they are added to YG.com. And i can see a problem on up2date profiles as you need to be in this area all the time to get it updated...

What i have made as a solution is disable "!logon" and added "!setpvp [0-5]" that will insert "PvP lvl [0-5]" where you have the "logon" messages. But i would like to have it as a PvP lvl variable so you can see it on "!whois" like you do with "!setcraft"
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: AoC: Add PvP level to whois/logon notifie
« Reply #4 on: March 05, 2009, 06:32:28 pm »
Check out core/aoc/Whois.php for that.

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: AoC: Add PvP level to whois/logon notifie
« Reply #5 on: March 05, 2009, 07:28:00 pm »
CREATE TABLE `pvplevel` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(32) NOT NULL,
  `pvplevel` int(3) default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`)
);

Modification needed:

core\aoc\Whois.php
Quote
291 a $who["pvplevel"] = $lookup[0]['pvplevel'];

147 a $lookup2 = $this -> bot -> db -> select("SELECT pvplevel FROM pvplevel WHERE name = '" . $name . "'", MYSQL_ASSOC);
148 a if (!empty($lookup2)) {
149 a $who["pvplevel"] = $lookup2[0]['pvplevel'];
150 a    }

291 a $who["pvplevel"] = $lookup[0]['pvplevel'];

393 m $this -> bot -> db -> query("INSERT INTO #___whois (id, nickname, level, pvplevel,"
395 m . " VALUES ('" . $who["id"] . "', '" . $who["nickname"] . "', '" . $who["level"] . "', '" . $who["pvplevel"] . "', '" . $who["class"] . "', '" . $who["craft1"] . "', '" . $who["craft2"] . "', " . $who["location"] . ", " . $who["online"] . ", "
397 m . "level = VALUES(level), pvplevel = VALUES(pvplevel), class = VALUES(class), craft1 = VALUES(craft1), craft2 = VALUES(craft2), online = VALUES(online), location = VALUES(location), "


417 a if(!empty($whois['pvplevel']))
418 a {
419 a    $window .= " ##normal##PvP Level:##end## ##highlight##{$whois['pvplevel']}##end##\n";
420 a }
a = add
m = modify

modules\aoc\setpvplvl.php

Quote
<?php
/*
 Author : Getrix

*/
$pvplevel = new pvplevel($bot);

class pvplevel extends BaseActiveModule
{
   /*
   Constructor: Hands over a referance to the "Bot" class.
   */
   function __construct (&$bot)
   {
      //Initialize the base module
      parent::__construct(&$bot, get_class($this));

                $this -> register_command('tell', 'setpvp', 'MEMBER');
                $this -> register_command('gc', 'setpvp', 'MEMBER');
       
                $this -> help['description'] = "This command adds your PvP Level to messages when you logon";
      $this -> help['command']['setpvp 0-5'] = "Set your current PvP Level.";
      $this -> help['notes'] = "Only set your real level. If abused you will get 24hr ban from bot without warning.";
   }


   /*
   Unified message handler
   $source: The originating player
   $msg: The actual message, including command prefix and all
   $type: The channel the message arrived from. This can be either "tell", "pgmsg" or "gc"
   */
   function command_handler($name, $msg, $type)
   {
      //ALWAYS reset the error handler before parsing the commands to prevent stale errors from giving false reports
      $this->error->reset();
      
      if (preg_match("/^setpvp (.+)$/i", $msg, $info)) {
                  return($this -> setpvp($info[1], $name));
      }
      else  {
               $this -> error -> set("Broken plugin, recieved unhandled command: $command");
         return($this->error->message());
      }
   }
   
   function setpvp($pvplevel, $name) {
      $sql = "SELECT char_id FROM #___users WHERE nickname = '$name'";
           $result = $this -> bot -> db -> select($sql);
           if ($this -> bot -> guildbot && !empty($result))
           {
      $char_id = $result[0][0];
      if(is_numeric($pvplevel)) {
         $this -> bot -> db -> query('INSERT INTO pvplevel (name,id,pvplevel) VALUES("'.$name.'","'.$char_id.'", "'.$pvplevel.'") ON DUPLICATE KEY UPDATE name=values(name), id=values(id), pvplevel=(pvplevel)');
         $this -> bot -> db -> query("UPDATE #___whois SET pvplevel = '" . $pvplevel . "' WHERE nickname = '" . $name . "'");
         $strmsg = "Thanks for setting your PvP Level.";
      }
      else { $strmsg = "Your pvp level '$pvplevel' is not a number!"; }
      }
      else { $strmsg = "Failed"; }

           return $strmsg;
   }
}
?>
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: AoC: Add PvP level to whois/logon notifie
« Reply #6 on: May 29, 2009, 06:42:56 pm »
Sorry to necro this thread, but I think YG profiles will soon become more reliable as they have recently released a profile updater that regular players can run on their machines while they are playing.  Any people they cross paths with during their playtime will get updated on the YG database.  I started running it last night and it seems to be working pretty well.

Beyond that, I know nothing about writing Bebot modules, but it would be great to see something that can leverage that YG profile information.

Offline Keltezaa

  • BeBot Rookie
  • *
  • Posts: 16
  • Karma: +0/-0
  • -=Blood Arcanum=-
Re: AoC: Add PvP level to whois/logon notifie
« Reply #7 on: August 20, 2009, 03:17:47 pm »
i have downloaded that yg updater and tbh it will take a looong time for it to successfully update.. whit i have done is runn the app and went to conarch, running from one end of the map to the other, stopping at rez points for 15+ min, so that all players that are there or respawn there gets loged... i went to most instances.. and to top it off wrote down a few "regularly" seen characters names down..
6 zones and 3hrs later... i went online to yg and searched the characters from my list and comparing it to the site.. it failed..my test.. some members were not even listed...
so i thought mybe the site needs to refresh every 24 hours... checked again the next day.. only 2 were added. so after a week i check and ahh what do you know.. the stats are there. but it is old...:(.. i used the ingame search to look for members and compare the supposely new added info and once again it faild cause the characters were 6 lvl's ahead of the website...so if accuracy you want.. yg is to slow at this time...
ok after saying that.. cant we get a code that reads the pvp lvl from the game like it does your normal lvl..? also how can the code from the new "autogratz" mod be used for this..
thanx..

 

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