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: Instance Bound Tracker b2.x.x  (Read 121786 times)

0 Members and 2 Guests are viewing this topic.

Offline altera

  • BeBot Rookie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Instance Bound Tracker
« Reply #45 on: January 04, 2010, 05:20:08 pm »
Also, there is another problem in that all your bound info from last year is stored and users will show with the same bindings for the same weeks they were bound last year.  Prolly be a good idea to clear out the table of data for those of us that have been using it.

How do we clear out the current data from the db; (sorry, not mysql savvy) ?

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: Instance Bound Tracker
« Reply #46 on: January 04, 2010, 05:47:13 pm »
You will not get any problem with this the first weeks. I got week nr45 as first in my table, and thats 44weeks untill it f***s up. In that time i may have worked around this problem with a new release.
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 dillinger

  • BeBot Apprentice
  • ***
  • Posts: 91
  • Karma: +0/-0
Re: Instance Bound Tracker
« Reply #47 on: January 06, 2010, 05:56:18 pm »
*wahahaha* now it's working!

The headline shows: :::: Bound info week 01 for: PlayerName ::::

Cheers, dill

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: Instance Bound Tracker
« Reply #48 on: February 04, 2010, 09:27:29 am »
Quote
* b1.0.9 - 2010-02-04 Getrix - added update_table to add instances when they arrives. T3 is being added to tblv2

"Tier 3 - Thoth-Amon's Tower" will be added when upgrading module.
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: Instance Bound Tracker
« Reply #49 on: February 04, 2010, 11:13:22 am »
Quote
* b1.0.10 - 2010-02-04 Getrix - fixed typos that caused it to crash

*remind myself of testing before releasing no mather how big the change was*
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 GBH

  • BeBot Hero
  • ******
  • Posts: 69
  • Karma: +0/-0
Re: Instance Bound Tracker
« Reply #50 on: February 04, 2010, 12:41:00 pm »
What would be excellent is if there was a way to force it to show all your bounds from all your characters using the alts database.

I have a huge number of level 80's and I swop between many of them regularly. While I know you can check the bound info of a specific character one at a time, what would be much easier is to do !bound all and have it show (and be able to change) your bound status on ALL your linked characters.

It's probably only a smallish change as most of the code is there but would save me hacking it ;)

GBH



Offline Yite

  • BeBot Apprentice
  • ***
  • Posts: 152
  • Karma: +0/-0
    • Niflheim - Crom
Re: Instance Bound Tracker
« Reply #51 on: February 04, 2010, 04:25:58 pm »
I'd be happy if a !bound registeredalt would allow me to change the bind info for that alt.

-Yite [Crom]

Offline Drizzurdeen

  • BeBot Apprentice
  • ***
  • Posts: 193
  • Karma: +0/-0
    • Obsidian-Cult
Re: Instance Bound Tracker
« Reply #52 on: February 11, 2010, 02:39:04 pm »
have added the t3 boss-encounter in the bound module ... further i changed the list ... every boss would be now able to bound

here is the code

Code: [Select]
<?php
/*
* _Bound.phps - Instance bound tracker.
* <Copyright Getrix @ Fury AoC>
*/ 
$version "b1.0.7 - 2009-12-13";
// b1.0.7 - 2009-12-13 Getrix - Added "!bound raid" for LEADER(default) to bound whole raid within a instance.
// b1.0.6 - 2009-11-21 Kyr    - added setting for ServerResetTime
// b1.0.5 - 2009-11-21 Getrix - Fixed typos
// b1.0.4 - 2009-11-19 Getrix - Fixed bug in function bound()
// b1.0.3 Added !bound <nick>
// First release. Added "add interfaces"
/*
* BeBot - An Anarchy Online & Age of Conan Chat Automaton
* Copyright (C) 2004 Jonas Jax
* Copyright (C) 2005-2007 Thomas Juberg StensÃ¥s, ShadowRealm Creations and the BeBot development team.
*
*/

$Bound = new Bound($bot);
$Bound -> version $version;

class 
Bound extends BaseActiveModule
{
    var 
$version;
   
    function 
__construct (&$bot)
    {
        
/* Constructor: Hands over a referance to the "Bot" class. */
        //Initialize the base module
        
parent::__construct(&$botget_class($this));
    
        
$this -> bot -> db -> query("CREATE TABLE IF NOT EXISTS " $this -> bot -> db -> define_tablename("bound""true") . " (
           `bound_id` int(10) unsigned NOT NULL auto_increment,
           `bound_instance_id` int(4) NOT NULL,
           `bound_charname` varchar(25) default NULL,
           `bound_week` int(3) default NULL,
           PRIMARY KEY  (`bound_id`)
        )"
);

        
$this -> bot -> db -> query("CREATE TABLE IF NOT EXISTS " $this -> bot -> db -> define_tablename("bound_instance""true") . " (
           `instance_id` int(10) unsigned NOT NULL auto_increment,
           `instance_shortname` varchar(25) default NULL,
           `instance_fullname` varchar(40) default NULL,
           PRIMARY KEY  (`instance_id`)
        )"
);
        
$this -> instance_add();
    
     
$this -> register_command("all""bound""MEMBER", array('raid' => 'LEADER'));
    
        
$this -> help['description'] = "This module helps you keep track of what instances your characters are bound.";
        
$this -> help['command']['bound <nick>'] = "Give you a list of bindings for a character.";
        
$this -> help['command']['bound list [instance_id]'] = "Shows list of instances and optionally what characters are bound to them.";
    
$this -> help['command']['bound raid [instance_id]'] = "Will bound every bot member inside same game instance as you to the choicen boss instance.";
        
$this -> help['notes'] = "(C) Module By Getrix@Fury\n";
        
$this -> bot -> core("settings") -> create("Bound""ServerResetTime"5"How many hours after midnight (GMT) Monday night does your server reset the raid instances   ?""1;2;3;4;5;6;7;8;9;10;11;12");
    }


    function 
command_handler($name$msg$origin)
    {
        
/*
            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"
        */
        
$com $this->parse_com($msg);
        switch(
$com['com'])
        {
            case 
'bound':
                return(
$this -> sub_handler($name$com1));
            break;
            default:
                return 
"Error 1";
            break;
        }
    }
    
    function 
sub_handler($name$com$type)
    {
        switch(
$com['sub'])
        {
        case 
'raid':
        return(
$this -> bound_raid($name$com['args']));
        break;
            case 
'add':
                return(
$this -> bound_add($com['args'], $name));
            break;
            case 
'rem':
                return(
$this -> bound_rem($com['args'], $name));
            break;
            case 
'list':
                return(
$this -> bound_list($com['args'], $name));
            break;
            default:
                return(
$this -> bound($name$com['sub']));
            break;
        }
    }

    function 
bound_rem($args$name) {
        
preg_match("/([0-9]+)$/i"$args$info);
        
$instance_id $info[1];
        
$bound_week  $this -> get_weeknr();
        
$this -> bot -> db -> query("DELETE FROM #___bound WHERE bound_charname='$name' AND bound_instance_id='$instance_id' AND bound_week='$bound_week' LIMIT 1");
        return 
"Removed the bound. ".$this->bound($name);
    }
    
    function 
bound_add($args$name) {
        
preg_match("/([0-9]+)$/i"$args$info);
        
$instance_id $info[1];
        
$bound_week  $this -> get_weeknr();
    
        
$chk_bound $this -> bot -> db -> select("SELECT bound_charname FROM #___bound WHERE bound_charname='$name' AND bound_instance_id='$instance_id' AND bound_week='$bound_week' LIMIT 1");
        if(!
$chk_bound) {
          
$chk_instance $this -> bot -> db -> select("SELECT instance_id FROM #___bound_instance WHERE instance_id='$instance_id' LIMIT 1");
          if (
$chk_instance) {
            
$this -> bot -> db -> query("INSERT INTO #___bound (bound_charname, bound_instance_id, bound_week) VALUES ('$name', '$instance_id', '$bound_week')");
            
$output "You are now bound to this instance!";
          }
          else { 
$output "Bind failed, instance doesn't exist!"; }
        }
        else {
          
$output "You are already bound to this instance.";
        }
        
$output .= " ".$this->bound($name);
        return 
$output;
    }
    
    
    function 
bound_raid($name$args="")
    {
    if (!empty(
$args)) {
        
preg_match("/([0-9]+)$/i"$args$info);
        
$instance_id $info[1];

        
$bound_week  $this -> get_weeknr();
        
        
$bound_count "0";
        
$output "<center>##ao_infoheadline##:::: Bounding the raid to instance  ::::##end##</center>\n";
        
        
$chk_instance $this -> bot -> db -> select("SELECT instance_id FROM #___bound_instance WHERE instance_id='$instance_id' LIMIT 1");
        if (
$chk_instance) {
        
$me_sql "SELECT location FROM whois WHERE nickname='".$name."'";
        
$me_result $this -> bot -> db -> select($me_sql);
        if (!empty(
$me_result)) {
            
$instanceID $me_result[0][0];
            
$sql  "SELECT t1.nickname,level,class, ";
            
$sql .= "t2.notify,user_level ";
            
$sql .= "FROM whois AS t1 ";
            
$sql .= "LEFT JOIN #___users AS t2 ON t1.nickname = t2.nickname ";
            
$sql .= "WHERE location='".$instanceID."' AND notify='1' AND user_level='2' ";
            
$sql .= "ORDER BY nickname";
            
$result $this -> bot -> db -> select($sql);
            if(
$result) {
              foreach (
$result as $val) {
            
$bound_nick $val[0];
            
$chk_bound $this -> bot -> db -> select("SELECT bound_charname FROM #___bound WHERE bound_charname='$bound_nick' AND bound_instance_id='$instance_id' AND bound_week='$bound_week' LIMIT 1");
            if(!
$chk_bound) {
                
$this -> bot -> db -> query("INSERT INTO #___bound (bound_charname, bound_instance_id, bound_week) VALUES ('$bound_nick', '$instance_id', '$bound_week')");
                
$output .= $bound_nick $this->brfix();
            }
            else {
                
$output .= $bound_nick $this->brfix(); // Allready bounded
            
}
            
$bound_count $bound_count 1;
              }
              
$output .= $this->brfix(2)."In total: $bound_count in raid was bound.";
            } else { 
$output "Didnt find any at your location"; }
        } else { 
$output "Didnt find your location $instanceID ($instance_id)."; }
        
        } else { 
$output "Bind failed, instance doesn't exist!";  }
    
    } else {
        
$chk_inst $this -> bot -> db -> select("SELECT instance_id, instance_fullname FROM #___bound_instance");
        if (!empty(
$chk_inst)) {
        
$output "<center>##ao_infoheadline##::::  Bound raid to instance  ::::##end##</center>\n";    
        foreach (
$chk_inst as $ir) {
        
$instance_id   $ir[0];
        
$instance_name $ir[1];
        
$output .= "<a href='chatcmd:///tell ".$this -> bot -> botname." !bound raid $instance_id'>$instance_name</a>".$this->brfix();
        }
        
$output $this -> bot -> core("tools") -> make_blob("Instance list"$output);
        return 
$output;
        }
        else { return 
"Instances not found $args"; }
        }
    
        return 
$this -> bot -> core("tools") -> make_blob("Raid bound info"$output);
    }
    
    function 
bound($name$args="") {
        if (!empty(
$args)) {
          
$bound_name mysql_real_escape_string($args);
        } else {
          
$bound_name $name;
        }

        
$current_week $this->get_weeknr();
        
$output "<center>##ao_infoheadline##:::: Bound info week $current_week for: $bound_name ::::##end##</center>\n";

        
$select  "SELECT i.*, b.bound_week ";
        
$select .= "FROM #___bound_instance AS i ";
        
$select .= "LEFT JOIN #___bound AS b ON ";
        
$select .= "i.instance_id=b.bound_instance_id AND b.bound_charname='$bound_name' AND b.bound_week='$current_week'";
        
$chk_char $this -> bot -> db -> select($select);
        if (!empty(
$chk_char)) {
          foreach (
$chk_char as $ar) {
            
$instance_id         $ar[0];
            
$instance_shortname  $ar[1];
            
$instance_fullname   $ar[2];
            
$bound_week          $ar[3];
            
            if (
$current_week == $bound_week) {
              
$bound_color "red";
              if (
$bound_name == $name) { $bound_link  "- <a href='chatcmd:///tell ".$this -> bot -> botname." !bound rem $instance_id'>Unbound</a>"; }
            }
            else {
              
$bound_color "green";
              if (
$bound_name == $name) { $bound_link  "- <a href='chatcmd:///tell ".$this -> bot -> botname." !bound add $instance_id'>Bound</a>"; }
            }
            
$output .= "<font color=$bound_color>$instance_fullname $bound_link</font>".$this->brfix();  
          }
        }
        else {
          
$output .= "You are not bound to any instances!";
        }
        
$output $this -> bot -> core("tools") -> make_blob("Bound info for $bound_name"$output);
        return 
$output;
    }
    
    function 
bound_list($args$name) {
      
$bound_week $this->get_weeknr();
      
$output "<center>##ao_infoheadline##:::: Bound chars week $bound_week ::::##end##</center>\n";
      if (
is_numeric($args)) {
        
$select "SELECT instance_id,instance_fullname FROM #___bound_instance WHERE instance_id='$args' LIMIT 1";
      }
      else {
        
$select "SELECT instance_id,instance_fullname FROM #___bound_instance WHERE instance_shortname='$args' LIMIT 1";
      }
    
      
$chk_inst $this -> bot -> db -> select($select);
      if (!empty(
$chk_inst)) {
        foreach (
$chk_inst as $ir) {
          
$instance_id   $ir[0];
          
$instance_name $ir[1];
        
          
$output "<center>##ao_infoheadline##:::: $instance_name ::::##end##</center>\n";

          
$chk_char $this -> bot -> db -> select("SELECT bound_charname FROM #___bound WHERE bound_instance_id='$instance_id' AND bound_week='$bound_week' ORDER BY bound_charname"); 
          if (!empty(
$chk_char)) {
            foreach (
$chk_char as $ar) {
              
$output .= $ar[0].$this->brfix();
            }
          }
          else { 
$output .= "No chars bound."; }
        }
      }
      else {
        
$chk_inst $this -> bot -> db -> select("SELECT instance_id, instance_fullname FROM #___bound_instance");
        if (!empty(
$chk_inst)) {
          
$output "<center>##ao_infoheadline##::::  Instance list  ::::##end##</center>\n";    
          foreach (
$chk_inst as $ir) {
            
$instance_id   $ir[0];
            
$instance_name $ir[1];
            
$output .= "<a href='chatcmd:///tell ".$this -> bot -> botname." !bound list $instance_id'>$instance_name</a>".$this->brfix();
          }
          
$output $this -> bot -> core("tools") -> make_blob("Instance list"$output);
          return 
$output;
        }
        else { return 
"Instances not found $args"; }
      }
    
      
$output $this -> bot -> core("tools") -> make_blob("Bound list for instance: $instance_name"$output);
      return 
$output;
    }
    
    function 
get_weeknr($date="") {
        if (empty(
$date)) { $date gmmktime(); }
        else { 
$date strtotime($date); }
        
$day_number  date("N"$date);
        
$week_number date("W"$date);
        
$hour_number = (int)date("H"$date);
        
$reset_number = (int)$this -> bot -> core("settings") -> get("Bound""ServerResetTime");
        if (
$day_number == "1" || ($day_number == "2" && $hour_number $reset_number)) { $week_number $week_number 1; }        
        return 
$week_number;
    }
    
    function 
brfix($count=1) {
        if (
$count == 2) { $br "<b></b><br><b></b><br>";}
        elseif (
$count == 3) { $br "<b></b><br><b></b><br><b></b><br>"; }
        else { 
$br "<b></b><br>"; }
        return 
$br;
    }
    
    function 
instance_add() {
      
$chk_inst $this -> bot -> db -> select("SELECT instance_id FROM #___bound_instance LIMIT 1");
      if(!
$chk_inst) {    
        
$this -> bot -> db -> query("INSERT INTO `#___bound_instance` (`instance_id`, `instance_shortname`, `instance_fullname`) VALUES
            (1, 'T1kom', 'Tier 1 - T1 komplett'),
            (2, 'T1Kymde', 'Tier 1 - Kyllikki - Meister d. Ehrengarde'),
            (3, 'T1Ky', 'Tier 1 - Kyllikki'),
            (4, 'T1Yak', 'Tier 1 - Yakhmar'),
            (5, 'T1Vis', 'Tier 1 - Vistrix'),
            (6, 'T2kom', 'Tier 2 - komplett'),
            (7, 'T2rEx', 'Tier 2 (Rechts) - Excorant'),
            (8, 'T2rYa', 'Tier 2 (Rechts) - Yaremka'),
            (9, 'T2rSa', 'Tier 2 (Rechts) - Sabazios'),
            (10, 'T2lAZ', 'Tier 2 (Links) - Ahazu Zagam'),
            (11, 'T2lIn', 'Tier 2 (Links) - Incubus&Succubus'),
            (12, 'T2lSe', 'Tier 2 (Links) - Seruah'),
            (13, 'T2lCh', 'Tier 2 (Links) - Chatta'),
            (14, 'T2mAB', 'Tier 2 (Mitte) - Athyr Bast'),
            (15, 'T2mLe', 'Tier 2 (Mitte) - Leviathus'),
            (16, 'T3kom', 'Tier 3 - Toth Amons Festung : komplett'),
            (17, 'T3KDI', 'Tier 3 - Kharon, Daimore und Ixion'),
            (18, 'T3HKa', 'Tier 3 - Hathor-Ka'),
            (19, 'T3Arb', 'Tier 3 - Arbanus'),
            (20, 'T3FoL', 'Tier 3 - Favored of Louhi'),
            (21, 'T3KoA', 'Tier 3 - Keeper of Artefacts'),
            (22, 'T3TAm', 'Tier 3 - Toth-Amon')"
);
        
$this->bot->log("Bound""DB""Added T1+T2 instances");
      }
    }
}
?>
   

Offline keirou

  • BeBot Apprentice
  • ***
  • Posts: 90
  • Karma: +0/-0
Re: Instance Bound Tracker
« Reply #53 on: February 11, 2010, 07:54:40 pm »
drizz the issue i see with yours

player A goes for a wing 1 raid, drops after excorant, but the group in there kills yaremka and sabazio.. player A is still raid locked to that instance unless they completly dropped raid, then rezoned to get bound to a different ID.

Offline Drizzurdeen

  • BeBot Apprentice
  • ***
  • Posts: 193
  • Karma: +0/-0
    • Obsidian-Cult
Re: Instance Bound Tracker
« Reply #54 on: February 11, 2010, 08:11:15 pm »
.... just make the db's empty an everything ist fine ;) ... done it by our bot ... this workaround works fine ... mybee make the db's empty on monday evening ... should be ok so i think

Offline Zar

  • BeBot Rookie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Instance Bound Tracker
« Reply #55 on: February 22, 2010, 06:43:41 pm »
drizz the issue i see with yours

player A goes for a wing 1 raid, drops after excorant, but the group in there kills yaremka and sabazio.. player A is still raid locked to that instance unless they completly dropped raid, then rezoned to get bound to a different ID.

Once the first boss in an instance is killed your char is bound to that instance just the Raid instance name is needed.

I have been having an Issue with !bound raid . From reading I assume a box should pop up and  the raid leader can choose what raid instance to bind everyone to and everyone in that Raid instance at that time should be bound. We've tried a few times and nothing happens when we do !bound raid

Does the Raid leader need specific rights to the BeBot to be able to do this?

Thanks
Z

Offline Drizzurdeen

  • BeBot Apprentice
  • ***
  • Posts: 193
  • Karma: +0/-0
    • Obsidian-Cult
Re: Instance Bound Tracker
« Reply #56 on: February 22, 2010, 06:56:15 pm »
yes he needs minimum leader access to the bot

Offline Kyr

  • BeBot Apprentice
  • ***
  • Posts: 177
  • Karma: +0/-0
Re: Instance Bound Tracker
« Reply #57 on: March 03, 2010, 01:30:47 am »
Just one small change here.  Not with Drizzurdeen version since he started with .7 and most recent changes were in .10.  I might look at merging Drizzurdeen's changes into the .11 version some other time.
 
 - changed ! to <pre> so bots that don't use ! for the syntax character will work
« Last Edit: March 03, 2010, 06:53:23 am by Kyr »

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: Instance Bound Tracker
« Reply #58 on: March 03, 2010, 09:18:05 am »
I realy dont see the point of Drizzurdeen's changes with adding all the bossnames.
Whenever you enter W1 and kill the first boss you are bound to that instance. Boss 2-3 etc doesnt have anything todo with bound. Better make a separated BossKillCount module.

Keep it simpel, T1-Vistrix, T1-Yak, T1-Kyl(Bounded after HG down), T2-W1, T2-W2, T2-W3, T3
« Last Edit: March 03, 2010, 09:20:47 am by Getrix »
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 Kyr

  • BeBot Apprentice
  • ***
  • Posts: 177
  • Karma: +0/-0
Re: Instance Bound Tracker
« Reply #59 on: March 03, 2010, 09:23:15 am »
Yes, after reviewing his changes I agree with you.

That said if Drezz or others want to have a custom list of instances or bosses, they can.  If public changes are made to the module it would affect the ease of installing them.

 

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