Author Topic: Arctic Moon Phases  (Read 5840 times)

0 Members and 1 Guest are viewing this topic.

Joseph Norton

  • Fodder
  • *
  • Posts: 89
Arctic Moon Phases
« on: February 01, 2014, 09:51:50 AM »
Loking for Nuitari in particular.  How long does it take from New to Full?

Oligo

  • Guest
Re: Arctic Moon Phases
« Reply #1 on: February 04, 2014, 06:20:00 PM »
Lasse did a study of moon phases. See following link for his Perl scripts.

Code: [Select]
#!/usr/bin/perl

if(defined($ARGV[0])) {
    if($ARGV[0] eq "q") {
qx{grep -E "orrery|\\*\\*\\*|Solinari is|Lunitari is|Nuitari is| Day of |Local Time|o'clock|Uptime     : " nil_G* >.nil};
qx{grep -Ev "says|shouts|tells" <.nil >.moons};
exit(0);
    } elsif($ARGV[0] eq "p") {
print qx(cat ????/.moons .moons |moons.pl);
#       print STDERR "DEBUG: Restricted database\n";print qx(cat .moons |moons.pl);
exit(0);
    } else {
print "Use 'q' to grep, 'p' to show results.\n";
exit(0);
    }
}
       
#use:
#  moons.pl q
#  cat ????/.moons .moons |moons.pl|sort -n >nil

%rlcal = ( "Jan" => "01","Feb" => "02","Mar" => "03",
       "Apr" => "04","May" => "04","Jun" => "06",
       "Jul" => "07","Aug" => "08","Sep" => "09",
       "Oct" => "10","Nov" => "11","Dec" => "12",
       );

%cal = (
 "Winter" => "01",
 "Winter Wolf" => "02",
 "Frost Giant" => "03",
 "Old Forces" => "04",
 "Grand Struggle" => "05",
 "Spring" => "06",
 "Nature" => "07",
 "Futility" => "08",
 "Dragon" => "09",
 "Sun" => "10",
 "Heat" => "11",
 "Battle" => "12",
 "Dark Shades" => "13",
 "Shadows" => "14",
 "Long Shadows" => "15",
 "Ancient Darkness" => "16",
 "Great Evil" => "17",
"Aelmont" => "01",
"Winter Night" => "02",
"Deepkolt" => "03",
"Brookgreen" => "04",
"Spring Dawning" => "05",
"Chilsmont" => "06",
"Fleurgreen" => "07",
"Corij" => "08",
"Fierswelt" => "09",
"Summer Run" => "10",
"Paleswelt" => "11",
"Reorxmont" => "12",
"Reapember" => "13",
"Autumn Twilight" => "14",
"Darkember" => "15",
"Frostkolt" => "16",
"Winter Come" => "17",
 );

%mcycle = (
   "Lunitari" => 28,
   "Solinari" => 36,
   "Nuitari" => 8,
   );

%mphases =(
    "low" => 1,
    "new" => 2,
    "waxing" => 3,
    "high" => 4,
    "waning" => 5,
    "full" => 6,
);


$warn=0;
$time="";$date="";$process=0;
while(<>) {
    $line++;
    if(/look orrery/) {
$time="";$date="";$clock="";$uptime="";undef(%phase);
#if($process) {$warn++;} #print STDERR "Process warning 1 ($line)..\n";}

#print "Processing..\n";
$process=1;next;

    }
    if(/:\*{42}([^\*]+|\Z)/) {
#print "Finished..\n";
if(!$process) {$warn++;} #print STDERR "Process warning 2 ($line)..\n";}
elsif(("$time" ne "") && ("$clock" ne "") && ("$date" ne "") &&
      defined(%phase)) {
    $date=sprintf("%s+%02d",$date,$clock);
    foreach $moon (sort keys %phase) {
$moons{"$moon"}{"$date"}{'phase'}=$phase{"$moon"};
$moons{"$moon"}{"$date"}{'uptime'}=$uptime;
$moons{"$moon"}{"$date"}{'time'}=$time;
    }
    $time="";$date="";$clock="";$uptime="";undef(%phase);
}
$process=0;
next;
    }

    if($process) {
if(/Local Time : \w+ (\w+) (\d+) (\d+):.* 20(\d+) ([A-Z]{3,4})/) { #PST|PDT|EST|EDT|CDT etc
    $time="$4-$rlcal{$1}-$2+$3";    
    #print "Time matched: $time\n";
    next;
}
if(/Uptime     : (.*)/) {
    $uptime="$1"; $utd=0;$uth=0;$utm=0;
    if($uptime=~/(\d+) day/) {$utd=$1;}
    if($uptime=~/(\d+) hour/) {$uth=$1;}
    if($uptime=~/(\d+) min/) {$utm=$1;}
    $uptime=sprintf("%2dd %2dh %2dm",$utd,$uth,$utm);
    #print "Uptime matched: $uptime\n";
    next;
}
if(/It is (\d+).*clock (am|pm)/) {
    $clock=$1;if("$2" eq "pm") {$clock+=12;}
    #print "Clock matched: $clock\n";
    next;
}
if(/The (\d+)\w* Day of the Month of (.*), Year (\d+)\./) {
    $year=$3;$day=$1;
    $mons=$2;$mons =~s/the //g;$mon=$cal{$mons};
    $date=sprintf("%03d-%02d-%02d",$year,$mon,$day);
    #print "Date matched: $date ($mons)\n";
    next;
} elsif (/The (\d+)\w* Day of (.*), Year (\d+)\./) {
    $year=$3;$day=$1;
    $mons=$2;$mons =~s/the //g;$mon=$cal{$mons};
    $date=sprintf("%03d-%02d-%02d",$year,$mon,$day);
    #print "Date matched: $date ($mons)\n";
    next;
}
if(/(Nuitari|Solinari|Lunitari) is.* (high|low|waxing|waning|full|new) .*\./) {
    $phase{"$1"}=$2;
    #print "Phase matched: $1=$2\n";
    next;
}
    }
}
if($warn>0) {print STDERR "$warn warnings.\n";}

$prevPhase=0;$prevprevPhase=0;$prevDate=0;
foreach $keyMoon (sort keys %moons) {
    foreach $keyDate (sort keys %{$moons{"$keyMoon"}}) {
$tmp=sprintf("$keyMoon:$keyDate\t=$moons{$keyMoon}{$keyDate}{'phase'}");
$tmp=sprintf("%-30s $moons{$keyMoon}{$keyDate}{'uptime'} ($moons{$keyMoon}{$keyDate}{'time'}) ",$tmp);
#Find out if we passed full-moon
$currPhase=$mphases{$moons{$keyMoon}{$keyDate}{'phase'}};
$keyDate=~ /\-(\d+)\-(\d+)\+/; $currDate=$1*$mcycle{$keyMoon}+$2;
#Mark passing of full-moon with stars

if($prevDate<($currDate-$mcycle{$keyMoon})) {$tmp.="**";}
elsif($currPhase==$mphases{"full"}) {$tmp.=".";$passed=0;}
elsif(!$passed && $prevprevPhase>$currPhase && $prevPhase>$currPhase &&
      $prevprevPhase!=$mphases{"full"} && $prevPhase!=$mphases{"full"}) {
    $passed=1;$tmp.="*";}

print "$tmp ";
print "\t($currPhase,$prevPhase,$prevprevPhase:$passed)\n";

if("$prevPhase" ne "$currPhase") {
    $prevprevPhase=$prevPhase; $prevPhase=$currPhase;$passed=0;}
$prevDate=$currDate;    
    }
}

snax

  • Guest
Re: Arctic Moon Phases
« Reply #2 on: February 05, 2014, 12:57:59 AM »
damn that's a pretty high end perl script for something so banal.  Hope he's making some money by now with web 3.98 and html 7z

Joseph Norton

  • Fodder
  • *
  • Posts: 89
Re: Arctic Moon Phases
« Reply #3 on: February 05, 2014, 02:07:46 AM »
Wow, that script is going to take me a while to figure out.   Might have to write my own based off that one to do my own research.


Thanks for that,
Brad

endiel

  • Newbie
  • Posts: 2
Re: Arctic Moon Phases
« Reply #4 on: February 20, 2014, 06:55:15 AM »
Hi Brad,

for starting point you can have my ancient notes about the cycles:

MOONS cycles and RL durations:

Nuitari :  8 days =  3h 12min
Lunitari: 28 days = 11h 12min
Solinari: 36 days = 14h 24min
Triple Full: 28x36 = 1008*24min = 16.8 days


A day is 24 ticks = 24 minutes.
A month is 35 days = 14h
A year is 17 months (595 days) = 9d 22h
Days: Moon, Bull, Deception, Thunder, Freedom, Great Gods, Sun
Days: Gileadai, Palast, Nuindai, Dead Eye, Dream Dance, Bakukal, Boreadai

Also, for long time some moons (at least Solinari) used to have bugged phases:
PHASES              DUR  TIME-TO  (Observed variation)
full    -> waning1  0h20 14h 40m  (0h19m-0h26m)
waning1 -> low1     1h40 14h 20m  (1h27m-1h58m)
low1    -> new      1h40 12h 40m  (1h24m-1h44m)
new     -> low2     0h20 11h 00m  (0h18m-0h33m)
low2    -> waxing   1h40 10h 40m  (1h25m-1h41m)
waxing  -> high     3h40  9h 00m  (3h21m-4h01)
high    -> waning2  3h40  5h 20m  (3h36m-3h41m)
waning2 -> full     1h40  1h 40m  (1h40m-)



The bugged part was how it went from high to waning before becoming suddenly full, same with going "low" twice around "new" moon.

Probably better that you verify if those hold anymore; orreries are great for that. I'm afraid to great any more 'test' characters. Player too many of those with stupid names to high levels.

That mentioned Perl script is pretty much useless : it's purpose was to analyze logs to automatically count those cycles. And even then it assumed the log had lot of specific "look orrery; time" trigger actions.

                - Lasse

P.S. Oh how I cringe every time I see my old, dirty and ugly code. But guess that's happens to everyone in the field
P.P.S. Quickly counted Arctic folder has some fifty Perl scripts for 15k lines (although who-list analyser alone is 5k+)
P.P.P.S. Not quite in Web-development at the moment, instead writing some Perl modules for database integration







Gnua

  • Immortal
  • Zone Leader
  • *
  • Posts: 489
Re: Arctic Moon Phases
« Reply #5 on: February 20, 2014, 12:32:32 PM »
The bugged part was how it went from high to waning before becoming suddenly full, same with going "low" twice around "new" moon.

I thought I was imagining that. I seem to recall something similar in one of the good the alignment shades

gulca

  • Zone Leader
  • ***
  • Posts: 318
Re: Arctic Moon Phases
« Reply #6 on: February 20, 2014, 01:07:31 PM »
P.P.S. Quickly counted Arctic folder has some fifty Perl scripts for 15k lines (although who-list analyser alone is 5k+)

I wrote a simple who list analyser and don't think it has more than 4 screens of code. What evil algorithm were you going through? Don't tell me it can predict what the next char someone is going to make! And when they are going to do it! :p

Joseph Norton

  • Fodder
  • *
  • Posts: 89
Re: Arctic Moon Phases
« Reply #7 on: February 20, 2014, 02:37:05 PM »
Referring to the above post.

If you have that script you need to look into horse racing.  My buddy wrote a trifecta script just for fun, to have it pick the trifecta on its first run! Never won one since then... But was awesome when it did fluke it. Many free beers.

Brad

Aristox

  • Overlord
  • Zone Leader
  • ******
  • Posts: 373
Re: Arctic Moon Phases
« Reply #8 on: February 20, 2014, 03:51:11 PM »
Lasse, your post made me think of this quote which I see the truth in repeatedly:

"Always wanted to travel back in time to try fighting a younger version of yourself? Software development is the career for you!"

fulloflife

  • Newbie
  • Posts: 27
Re: Arctic Moon Phases
« Reply #9 on: February 20, 2014, 08:34:45 PM »
a who analyzer to estimate probability of character multi's is going to take more than 4 lines

gulca

  • Zone Leader
  • ***
  • Posts: 318
Re: Arctic Moon Phases
« Reply #10 on: February 20, 2014, 09:09:11 PM »
a who analyzer to estimate probability of character multi's is going to take more than 4 lines
If you are referring to my post, I said 4 screens worth of code. Not 4 lines. Unless you are coding in line prompt where 1 line is 1 screen. :)

I don't mean to put down on Lasse's coding ability. Rather it is the other way. My analyzer is very crude thus the small amount of code. His code probably have some fuzzy logic to take care of char sharing/botting/multing and a "confidence" level.

Mine assumes that if 2 names are on the who list at any single time, they are 2 different people period. Also I don't store my info into a database.

Back on topic, I don't see a reason enough to actually analyze moon phases. If I need something enchanted, I'll just hold on to the item till I remember to check the moon for "full" and get it enchanted.

The moon effect integration to the robe class isn't that big a deal to actually need to know when the next full moon is going to appear.

It's not like at full moon, your spells are five times as strong and at new moon, you get 10% of your spell power.