L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2008, 02:15:35 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)  (Read 1068 times)
0 Members and 1 Guest are viewing this topic.
Wanuarmi
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 121


Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« on: December 16, 2005, 11:57:47 PM »

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:
<?
$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 27, 2005, 08:56:15 PM by Wanuarmi » Logged
Wanuarmi
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 121


Re: Beast Day
« Reply #1 on: December 17, 2005, 01:45:48 AM »

updated, fixed a typo in a variable
Logged
Wanuarmi
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 121


Re: Beast Day
« Reply #2 on: December 17, 2005, 02:34:11 PM »

updated, put in the right starting day
Logged
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #3 on: October 22, 2006, 04: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-
Logged
Wolfbiter
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 141



WWW
Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #4 on: October 22, 2006, 05:12:46 PM »

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)
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));

Logged

220 Doctor | 220 Adventurer | 220 Shade
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #5 on: October 22, 2006, 05:14:36 PM »

Cheers :-)

-jj-
Logged
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #6 on: October 30, 2006, 02:32:17 AM »

Different order of days, please update.
Blame Coen :-P

Code:
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";
}
Logged
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #7 on: December 12, 2006, 07:51:03 PM »

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-
Logged
Areteh
Rookie
**
Offline Offline

Posts: 23


Re: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« Reply #8 on: January 06, 2007, 06:07:21 AM »

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, 06:15:00 AM by Areteh » Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: Beast Day (RK1 - hellcom/pandebot 6 2 6 2 deal)
« previous next »
 
Jump to:  

Recent
Change text in remember "...
by gerborg
[November 21, 2008, 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 20
Total: 21
xlDanek

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.168 seconds with 28 queries. (Pretty URLs adds 0.03s, 4q)
Loading...