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: addition to !timers or something of the like  (Read 2454 times)

0 Members and 1 Guest are viewing this topic.

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
addition to !timers or something of the like
« on: January 25, 2008, 02:16:26 pm »
Would love to be able to set a timer that will restart itself when ever it ends for towers.

maybe something like

!towers 25 9:34:81 Discription

This would count down and like an hour before that site goes hot it would say something in org chat or in the raid bot.  and when it goes to 25% it would tell ya then also.  Then it would continue on till like an hour before 5% and then spam chat, then when it changes to 5% it would also say something.   and back to 75% and keep going in a circle until you delete the timer.

Not sure if it could read in from aochat if the tower was taken or not but that would be a nice feature also.  Would automatically delete the timer if the base was lost.

Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: addition to !timers or something of the like
« Reply #1 on: January 27, 2008, 01:26:44 pm »
Should be fairly easy to do using timed events - that way you can react to the notifies and ends of timers yourself. The module would just have to cover bot downtimes in some way...

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: addition to !timers or something of the like
« Reply #2 on: January 30, 2008, 10:01:37 pm »
The module would just have to cover bot downtimes in some way...

My APF module does this by using a seed time and an interval. The seed time is a known occurrence of the event. From there, the interval is added until the bot sees that nextime >= time().

I repeating timer that persisted through bot restarts would be similar.

!retimer <remaining> <interval> <description>

<remaining>: Time remaining until the next occurrence.
<interval>: Interval for repetition.
<description>: Description of the event.

Store time()+<remaining> in the database (as well as <interval> and <description>) and you can calculate your timer indefinitely. Computers can do simple math quickly enough so you wouldn't necessarily have to update the seed time.

Offline Threeze

  • BeBot Rookie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: addition to !timers or something of the like
« Reply #3 on: March 22, 2008, 02:54:00 am »
Attached is an outdated rtimer module, if anyone would kindly update it then im sure this is exactly what the OP was looking for [and me as well ;D]


Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: addition to !timers or something of the like
« Reply #4 on: March 22, 2008, 04:30:43 am »
Added to the list of TODOs for the  module mentioned in http://bebot.link/module-requests/personal-org-tower-info-tool/msg8617
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Threeze

  • BeBot Rookie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: addition to !timers or something of the like
« Reply #5 on: March 22, 2008, 05:43:36 am »
I was just hoping for a standalone rtimer for keeping track of 18 hour dynas hehe.

That's a nice idea to add it to the neat tower tracking module you're working on, though :o

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: addition to !timers or something of the like
« Reply #6 on: March 22, 2008, 11:48:29 am »
Repeated timer are on my todo list for the timer core. Though they've been there for quite a time now.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: addition to !timers or something of the like
« Reply #7 on: March 22, 2008, 01:45:54 pm »
!rtimer implemented.

For the 0.4 branch use the files below, for SVN best do an svn update.

Timer Core, save as core/Timer_Core.php
TimerGUI, save as modules/TimerGUI.php

Offline Threeze

  • BeBot Rookie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: addition to !timers or something of the like
« Reply #8 on: March 22, 2008, 07:02:07 pm »
Quote
Fatal error: Call to undefined method Bot::core() in C:\...\modules\TimerGUI.php on line 181

v0.4.3

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: addition to !timers or something of the like
« Reply #9 on: March 22, 2008, 07:30:00 pm »
And here I was sure I converted all those...

Removed the core() calls, simply redownload from above link.

Offline Threeze

  • BeBot Rookie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: addition to !timers or something of the like
« Reply #10 on: March 23, 2008, 07:28:45 am »
Changed
Code: [Select]
elseif (preg_match("/^" . $this -> bot -> commpre . "rtimer ([a-z]+ )?([1-9][0-9]*[mshd]?) ([1-9][0-9]*[mshd]?) (.*)/i", $msg, $info))
{
return $this -> add_timer($name, $info[2], $info[4], $info[1], $info[3], $channel);
}
elseif (preg_match("/^" . $this -> bot -> commpre . "rtimer ([a-z]+ )?([0-9]+(:[0-9][0-9]){0,3}) ([0-9]+(:[0-9][0-9]){0,3}) (.*)/i", $msg, $info))
{
return $this -> add_timer($name, $info[2], $info[6], $info[1], $info[4], $channel);
}
to
Code: [Select]
elseif (preg_match("/^" . $this -> bot -> commpre . "rtimer ([a-z]+ )?([1-9][0-9]*[mshd]?) ([1-9][0-9]*[mshd]?) (.*)/i", $msg, $info))
{
$this -> bot -> send_output($name, $this -> add_timer($name, $info[2], $info[4], $info[1], $info[3], $channel), $channel);

}
elseif (preg_match("/^" . $this -> bot -> commpre . "rtimer ([a-z]+ )?([0-9]+(:[0-9][0-9]){0,3}) ([0-9]+(:[0-9][0-9]){0,3}) (.*)/i", $msg,

$info))
{
$this -> bot -> send_output($name, $this -> add_timer($name, $info[2], $info[6], $info[1], $info[4], $channel), $channel);
}
Which I think is what you intended [to notify that a timer was created], and also added a help info for rtimer

Code: [Select]
$this -> help['command']['rtimer initial#[mshd] interval#[mshd] title']="Adds a timer that starts in initial # minutes (m), seconds (s), hours (h) or days (d), and is repeated every interval # minutes (m), seconds (s), hours (h) or days (d). If no time unit is added it's # seconds.";
$this -> help['command']['rtimer initial#[:##[:##[:##]]] interval#[:##[:##[:##]]] title']="Adds a timer that starts in initial time, and is repeated every interval time, using the format days:hours:minutes:seconds, with the lowest time unit always being seconds (so 1:20 means 1min 20secs, 1:03:05 means 1hour 3mins 5secs). On every : there have to follow exactly two numbers. You don't have to enter all numbers.";
Attached in TimerGUI.phps.

Thanks for the quick coding work Alreadythere, but one thing still odd I noticed. After the intitial timer is set, ones that follow on the interval dont give the "Timer X has one minute left, name!, Timer X has 30 seconds left, name!" etc - it just gives Timer X has finished, name!

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: addition to !timers or something of the like
« Reply #11 on: March 23, 2008, 11:47:22 am »
Thanks for those fixes, missed them when I backported from trunk.

Redownload the Timer_Core.php linked above please, I think I fixed the notification problem. Was another backporting bug.

 

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