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: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)  (Read 5606 times)

0 Members and 1 Guest are viewing this topic.

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« on: December 17, 2005, 05:57:47 am »
This will show if the current day is Clan/Omni/FFA Beast day. (oh btw this is for Atlantean RK1)

Id like some feedback as I can have made a mistake somewhere.

!beastday


modules/BeastDay.php
Code: [Select]
<?
$beastDay = new BeastDay($bot);

$commands["tell"]["beastday"] = &$beastDay;
$commands["pgmsg"]["beastday"] = &$beastDay;
$commands["gc"]["beastday"] = &$beastDay;


class BeastDay
{
var $bot;

var $start_date;
var $day_cycle;

var $omni_color;
var $clan_color;
var $ffa_color;


function BeastDay (&$bot)
{
$this -> bot = &$bot;
       
$this -> day_cycle = 6 + 2 + 6 + 2;
$this -> start_date = gmmktime(0, 0, 0, 12, 3, 2005);

$this -> omni_color = "#FFFF31";
$this -> clan_color = "#00FF00";
$this -> ffa_color = "#FF0000";
}

function tell($name, $msg)
{
$this -> bot -> send_tell($name, $this -> beast_day());
}

function pgmsg($name, $msg)
{
$this -> bot -> send_pgroup($this -> beast_day());
}

function gc($name, $msg)
{
$this -> bot -> send_gc($this -> beast_day());
}


function beast_day()
{
$ocolor = $this -> omni_color;
$ccolor = $this -> clan_color;
$fcolor = $this -> ffa_color;

$seconds_since_start = gmmktime() - $this -> start_date;
$seconds = $seconds_since_start % ($this -> day_cycle * (24*60*60));
$days = floor( $seconds / (24*60*60) ) + 1;

if ($days <= 6)
{
$end = 6 - $days;
return "Today is <font color=$ocolor>Omni</font> day $days. There are $end more days until <font color=$fcolor>FFA</font>.";
}
else if ($days > 6 && $days <= 8)
{
$end = 8 - $days;
$day = $days - 6;
return "Today is <font color=$fcolor>FFA</font> day $day. There are $end more days until <font color=$ccolor>Clan</font>.";
}
else if ($days > 8 && $days <= 14)
{
$end = 14 - $days;
$day = $days - 8;
return "Today is <font color=$ccolor>Clan</font> day $day. There are $end more days until <font color=$fcolor>FFA</font>.";
}
else if ($days > 14)
{
$end = 16 - $days;
$day = $days - 14;
return "Today is <font color=$fcolor>FFA</font> day $day. There are $end more days until <font color=$ocolor>Omni</font>.";
}
}

}
?>
« Last Edit: December 28, 2005, 02:56:15 am by Wanuarmi »

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Re: Beast Day
« Reply #1 on: December 17, 2005, 07:45:48 am »
updated, fixed a typo in a variable

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
Re: Beast Day
« Reply #2 on: December 17, 2005, 08:34:11 pm »
updated, put in the right starting day

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #3 on: October 22, 2006, 11:30:23 pm »
http://jjones.kicks-ass.net/files/beastday.php

- updated for 7/7/7.
- shows 7 days previous and 14 in front.
- appalling code but works.

-jj-

Offline Wolfbiter

  • Contributor
  • *******
  • Posts: 149
  • Karma: +0/-0
    • KAZE
Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #4 on: October 23, 2006, 12:12:46 am »
Some quick changes to make code "cleaner" (and also help people set day interval).

Code: (As usual, don't try and add this if you have no idea what you're doing) [Select]
var $start;
var $end;
....
$this->start = -7;
$this->end = 14;
....
for($i=$this->start;$i<=$this->end;$i++)
$list.=$this->beast_day_calc(gmmktime($hours,$minutes,$seconds,$month,$day+$i,$year));

Too many toons.

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #5 on: October 23, 2006, 12:14:36 am »
Cheers :-)

-jj-

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #6 on: October 30, 2006, 08:32:17 am »
Different order of days, please update.
Blame Coen :-P

Code: [Select]
if ($days <= 7)
{
return "$dateis is <font color=$ocolor>FFA</font> day $days.\n";
}
else if ($days >= 8 && $days <= 14)
{
$day = $days - 7;
return "$dateis is <font color=$fcolor>Omni</font> day $day.\n";
}
else if ($days >= 15)
{
$day = $days - 14;
return "$dateis is <font color=$ccolor>Clan</font> day $day.\n";
}

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #7 on: December 13, 2006, 01:51:03 am »
http://jjones.kicks-ass.net/files/beastday.php

Updated to reflect new order : FFA/Clan/Omni.

Blame Coen['s hairdresser] again!

Or you can just manually change the code if u use Wolfbiter's version.

-jj-

Offline Areteh

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #8 on: January 06, 2007, 12:07:21 pm »
Well, originally this was just going to be a help file, but I didn't like that you had to click the calendar to get the current day, so I changed it.  Of course, if you prefer the previous version, you can still use this help file with it.

specifically, I changed
[Bot]: Beastday Calendar :: <a>click to view</a>
to
[Bot]: Sat 06 Jan 07 is FFA day 6. :: <a>Beastday Calendar</a>

edit: oops, uploaded the helpfile twice instead of the php file.  fixed.
« Last Edit: January 06, 2007, 12:15:00 pm by Areteh »

 

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