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: Offline AA training timer module  (Read 222593 times)

0 Members and 3 Guests are viewing this topic.

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Offline AA training timer module
« on: June 08, 2010, 03:28:45 pm »
Just putted togheter a fast module so i didnt need to log all my 80s and check whenever i could put new AA Offline training.
I dont wanna give any promise of more functions but if anyone wants to contribute with more function you are welcome to do publish it here and be credited.

URL: http://dump.sjef.biz/aoc/bebot/TimerAA/TimerAA.phps

description:
This module helps you keep track of Offline AA time training.

command:
timeraa show <nick> Show how long time left on AA training
timeraa set 18 Set the training time for current AA. Only use hours.
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 Runemy

  • BeBot Apprentice
  • ***
  • Posts: 97
  • Karma: +0/-0
    • Exalted [Age of Conan guild - Aquilonia EU]
Re: Offline AA training timer module
« Reply #1 on: June 08, 2010, 04:15:06 pm »
Thanks for this one mate! :)

But one thing, it only seems to work when I'm on the owner of the bot. Others experiencing the same?
Wood of Exalted
Age of Conan
Aquilonia - EU

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: Offline AA training timer module
« Reply #2 on: June 08, 2010, 05:01:40 pm »
Uploaded new version.
This requires a DROP of #__timer_aa database because i changed some stuff in database. Or you can alter and add "timeraa_end" to "#__timer_aa" after "timeraa_start". But then everyone needs to update their AA timer.

Also run "!commands update all timeraa M" to be sure it works for members.

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: Offline AA training timer module
« Reply #3 on: June 09, 2010, 04:34:33 pm »
Cheers for this I was just starting to write my own - saved me the hassle so I owe you one ;)

G

Offline Kyr

  • BeBot Apprentice
  • ***
  • Posts: 177
  • Karma: +0/-0
Re: Offline AA training timer module
« Reply #4 on: June 09, 2010, 07:56:34 pm »
Thanks for this module!

My guild really likes it.

~Kyr

Offline Yite

  • BeBot Apprentice
  • ***
  • Posts: 152
  • Karma: +0/-0
    • Niflheim - Crom
Re: Offline AA training timer module
« Reply #5 on: June 09, 2010, 09:41:58 pm »
NOTE: These are code snippets, to use them copy them into the main module. If you are not sure about that leave it for now and wait for an updated module (if Getrix want this to be part of his module that is)

I added a new function showall (code below) basically returns a blob with the times of all alts as well.

Code: [Select]
    function timer_show_all($name, $args) {
        if (!empty($args)) {
          $name = mysql_real_escape_string($args);
        }

        $findmain = $this -> bot -> db -> select("SELECT main FROM alts WHERE alts.alt='$name'");
if (empty($findmain)) {$main=$name;}
else {$main = current($findmain[0]);}
$output = "<Center>##ao_infoheadline##:::: Offline timer info for $main and alts ::::##end##</Center>\n\n";

$chk_time = $this -> bot -> db -> select("SELECT * FROM #___timer_aa WHERE timeraa_username='$main'");
          if (!empty($chk_time)) {
            foreach ($chk_time as $aa) {
                $timeraa_start      = $aa[2];
                $timeraa_end        = $aa[3];
                $timeraa_cooldown   = $aa[4];
                $today  = time();
                $diff = $this->get_time_difference($today, $timeraa_end);

                $output .= "$main has ".$diff['days']." days, ".$diff['hours']." hour, ".$diff['minutes']." min, ".$diff['seconds']." sec left until cooldown.\n";
            }
        }
        else { $output .= "$main has no timer set.\n"; }

$altlist = $this -> bot -> db -> select("SELECT alt FROM alts WHERE alts.main='$main'");
if (!empty($altlist)) {
  foreach ($altlist as $charlist) {
   foreach ($charlist as $charname) {
    $chk_time = $this -> bot -> db -> select("SELECT * FROM #___timer_aa WHERE timeraa_username='$charname'");
            if (!empty($chk_time)) {
              foreach ($chk_time as $aa) {
                $timeraa_start      = $aa[2];
                $timeraa_end        = $aa[3];
                $timeraa_cooldown   = $aa[4];
                $today  = time();
                $diff = $this->get_time_difference($today, $timeraa_end);
                $output .= "$charname has ".$diff['days']." days, ".$diff['hours']." hour, ".$diff['minutes']." min, ".$diff['seconds']." sec left until cooldown.\n";
              }
    }
    else { $output .= "$charname has no timer set.\n"; }
  }
}
}
$output = $this -> bot -> core("tools") -> make_blob("AA timers for $main", $output);
return $output;
}

It will also need an extra case in the sub_handler:

Code: [Select]
            case 'showall':
                return($this -> timer_show_all($name, $com['args']));
            break;


Usage: (As I didn't update the help)
!timeraa showall [character]

It will find the character's main and then list all timers in a blob, if no character is specified it will show for the person who typed the command.
-Yite [Crom]

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: Offline AA training timer module
« Reply #6 on: June 09, 2010, 10:07:35 pm »
Thanx Yite.
I modified it abit to support some changes i did in calculation in b1.0.2

// b1.0.3 Added "timeraa showall <nick>" to include alts of a chars. (Thanks to Yite@BeBot Forum)

URL: http://dump.sjef.biz/aoc/bebot/TimerAA/TimerAA.phps
« Last Edit: June 09, 2010, 10:09:10 pm 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 dillinger

  • BeBot Apprentice
  • ***
  • Posts: 91
  • Karma: +0/-0
Re: Offline AA training timer module
« Reply #7 on: June 10, 2010, 08:21:02 am »
Yeah, very nice and useful module, thanx @ Getrix! This makes the AA overview much easyer, even with 8 lvl 80 chars!  ;)

Offline GBH

  • BeBot Hero
  • ******
  • Posts: 69
  • Karma: +0/-0
Re: Offline AA training timer module
« Reply #8 on: June 10, 2010, 09:56:56 am »
Yay showall saved me todays bit of coding too!

You guys rock or something ;)

G

Offline Yite

  • BeBot Apprentice
  • ***
  • Posts: 152
  • Karma: +0/-0
    • Niflheim - Crom
Re: Offline AA training timer module
« Reply #9 on: June 10, 2010, 11:15:59 am »
It 'cost' me a few hours until I found that the select statement provided an array of arrays.

What I would like to still do on the showall is:
* filter out non 80's (non 80's can't train on time)
* sort the output by skill time left (probably a matter of putting the output strings in an array and sorting it
-Yite [Crom]

Offline GBH

  • BeBot Hero
  • ******
  • Posts: 69
  • Karma: +0/-0
Re: Offline AA training timer module
« Reply #10 on: June 10, 2010, 01:04:28 pm »
It 'cost' me a few hours until I found that the select statement provided an array of arrays.

Yep being a noob with PHP/SQL that caught me out a few times and I still don't completely understand why it does it.

G

Offline Yite

  • BeBot Apprentice
  • ***
  • Posts: 152
  • Karma: +0/-0
    • Niflheim - Crom
Re: Offline AA training timer module
« Reply #11 on: June 11, 2010, 09:29:47 am »
What I would like to still do on the showall is:
* filter out non 80's (non 80's can't train on time)
* sort the output by skill time left (probably a matter of putting the output strings in an array and sorting it
Still working on this, have some nice ideas but raids prevented me from executing them :)
-Yite [Crom]

Offline Shendar

  • BeBot Rookie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: Offline AA training timer module
« Reply #12 on: June 12, 2010, 04:30:14 pm »
Version 1.0.3 works perfectly. Thanks for great mod.

Offline Salpa

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Offline AA training timer module
« Reply #13 on: June 13, 2010, 07:09:38 pm »
Great module, thank you for your hard work.

I just wanted to ask... what happens when the bot is down? (maintenance or something) will the time spend in offline state be counted or will it just mess things up and delay the counter, so that the actual time-left is incorrect?

Thanks for answering me :)

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: Offline AA training timer module
« Reply #14 on: June 13, 2010, 10:01:45 pm »
Its not working as the !timer function. so its no real "countdown" but a fixed endtime of your timer thats always static in your database. calculation is done on each time you run the command.
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.

 

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