Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
meddlesome
Wanderer


Joined: 24 Aug 2012
Posts: 70

PostPosted: Thu Oct 18, 2012 2:14 pm   

Can someone tell me why I get this line feed? [FIXED]
 
I built this calculator which calculates the combination codes for using what is known as a FaeOrb in the mud that I play. The output looks like this...

EARTH TIME
The current system time is Thu Oct 18 10:08:06 2012
Medievia restart time was Tue Oct 9 17:46:12 2012

MEDIEVIA TIME
It is 10:19 pm, on the Day of Valor.
The 5th Day of the Month of Winter Night, Year 548.
The Medievia day rolls over Thu Oct 18 11:10:46 2012 Earth time.

[Medievia Star] [ EARTH TIME ]
Gets Light: Wed Oct 17 23:18:00 2012 Fog Starts
Sun Rises: Wed Oct 17 23:56:00 2012
Sun Sets: Thu Oct 18 09:18:00 2012 Fog Starts
Gets Dark: Thu Oct 18 09:56:00 2012

[Medievia Moon] [ EARTH TIME ]
Next New Moon: Mon Oct 22 20:10:46 2012 Fae Clams making Frae
Next Full Moon: Tue Oct 30 08:10:46 2012
Eclipse Start: Tue Oct 23 14:55:46 2012 Fae Clams making Stae
Eclipse End: Tue Oct 23 22:22:14 2012

Medievia has 7 days a week, 5 weeks a month, 35 days a month, 17 months a year, and 595 days per year. One Medievia day equals 15 Earth hours.

XP COMBO: Power:7 Duration:6 Frequency:2 Fae needed: 1,000,000

LOCATE SERPENTS: Power:6 Duration:6 Frequency:79 Fae needed: 36,000
CREATE RAINSTORM: Power:8 Duration:5 Frequency:63 Fae needed: 40,000
REMOVE STORM: Power:8 Duration:10 Frequency:90 Fae needed: 100,000
ROAD INTERSECTION FARSIGHT: Power:5 Duration:5 Frequency:5 Fae needed: 25,000

For some reason I get a line feed after I do the XP COMBO: line and I just can't find it. Any ideas?

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <class name="FaeOrbCalculation" copy="yes">
    <trigger priority="233730" copy="yes">
      <pattern>Next New Moon:   %w (%w) (%d) (%d):(%d):(%d) (%d)</pattern>
      <value>;%1 = Month
#IF (%1=%time(mmm)) {#VAR MoonMonth %time(m)} {#MATH MoonMonth (%time(m)+1)}
;%2 = Day
#VAR MoonDay %2
;%3 = Hours
#VAR MoonHours %3
;%4 = Minutes
#VAR MoonMinutes %4
;%5 = Seconds
#VAR MoonSeconds %5
;%6 = Year
#VAR MoonYear %6
#MATH OnMoon (((((@MoonMonth-1-%mod((@MoonMonth-1),2))/2))*30) + ((((@MoonMonth-1-%mod((@MoonMonth-1),2))/2))*31) + (%mod((@MoonMonth-1),2)*31)+(@MoonDay -1))
;Are we past Feb, if so there are only 28 days in that month not 30
;But are we in a leap year? There could be 29 days in Feb
#VAR LeapYear 0
#IF ((%mod(@MoonYear,4)=0) || (%mod(@MoonYear,100)!=0)) {#VAR LeapYear 1};
#IF ((%mod(@MoonYear,4)=0) || (%mod(@MoonYear,100)=0) || (%mod(@MoonYear,400)=0)) {#VAR LeapYear 1};
#IF ((((@MoonMonth-1-%mod((@MoonMonth-1),2))/2))>1) {#IF (@LeapYear) {#ADD OnMoon -1} {#ADD OnMoon -2}}
#UNVAR LeapYear
;#SHOW We Are on day @OnMoon

;Ok, So now I know how many days have passed, now the fun job of
;converting the remaining hours and Minutes into seconds, and adding
;the additional seconds to have a total number of seconds that
;have passed since the beginning of the year.

#MATH SecondsPassedMoon ((@OnMoon *24 *60 *60)+(@MoonHours *60 *60)+(@MoonMinutes*60)+@MoonSeconds)
;#SHOW There have been @SecondsPassedMoon seconds since JAN 1.
#UNVAR OnMoon
</value>
    </trigger>
    <trigger priority="233920" copy="yes">
      <pattern><![CDATA[Eclipse Start:   %w (%w) (&%dSunDay) (&%dSunHours):(&%dSunMinutes):(&%dSunSeconds) (&%dSunYear)]]></pattern>
      <value>;%1 = Month
#IF (%1=%time(mmm)) {#VAR SunMonth %time(m)} {#MATH SunMonth (%time(m)+1)}

#MATH OnSun (((((@SunMonth-1-%mod((@SunMonth-1),2))/2))*30) + ((((@SunMonth-1-%mod((@SunMonth-1),2))/2))*31) + (%mod((@SunMonth-1),2)*31)+(@SunDay -1))
;Are we past Feb, if so there are only 28 days in that month not 30
;But are we in a leap year? There could be 29 days in Feb
#VAR LeapYear 0
#IF ((%mod(@SunYear,4)=0) || (%mod(@SunYear,100)!=0)) {#VAR LeapYear 1};
#IF ((%mod(@SunYear,4)=0) || (%mod(@SunYear,100)=0) || (%mod(@SunYear,400)=0)) {#VAR LeapYear 1};
#IF ((((@SunMonth-1-%mod((@SunMonth-1),2))/2))>1) {#IF (@LeapYear) {#ADD OnSun -1} {#ADD OnSun -2}}
#UNVAR LeapYear
;#SHOW {%ansi(bold,Magenta)We Are on day @OnSun}

;Ok, So now I know how many days have passed, now the fun job of
;converting the remaining hours and Minutes into seconds, and adding
;the additional seconds to have a total number of seconds that
;have passed since the beginning of the year.

#MATH SecondsPassedSun ((@OnSun *24 *60 *60)+(@SunHours *60 *60)+(@SunMinutes*60)+@SunSeconds)
;#SHOW There have been @SecondsPassedSun seconds since JAN 1.
#UNVAR OnSun</value>
    </trigger>
    <trigger priority="234070" repeat="true" copy="yes">
      <pattern>Medievia has 7 days a week, 5 weeks a month, 35 days a month</pattern>
      <value><![CDATA[#MATH OnDay (((((%time(m)-1-%mod((%time(m)-1),2))/2))*30) + ((((%time(m)-1-%mod((%time(m)-1),2))/2))*31) + (%mod((%time(m)-1),2)*31)+(%time(d) -1))
;Are we past Feb, if so there are only 28 days in that month not 30
;But are we in a leap year? There could be 29 days in Feb
#VAR LeapYear 0
#IF ((%mod(%time(yyyy),4)=0) || (%mod(%time(yyyy),100)!=0)) {#VAR LeapYear 1}
#IF ((%mod(%time(yyyy),4)=0) || (%mod(%time(yyyy),100)=0) || (%mod(%time(yyyy),400)=0)) {#VAR LeapYear 1}
#IF ((((%time(m)-1-%mod((%time(m)-1),2))/2))>1) {#IF (@LeapYear) {#ADD OnDay -1} {#ADD OnDay -2}}
#UNVAR LeapYear
;#SHOW We Are on day @OnDay

;Ok, So now I know how many days have passed, now the fun job of
;converting the remaining hours and Minutes into seconds, and adding
;the additional seconds to have a total number of seconds that
;have passed since the beginning of the year.

#MATH SecondsPassed ((@OnDay *24 *60 *60)+(@curHours *60 *60)+(@curMins*60)+@curSecs)
;#SHOW There have been @SecondsPassed seconds since JAN 1.
#UNVAR OnDay

;That wasn't so hard, but this next part may just take it's time.
;I now have to calculate this back til the beginning of Medievia time.

;Well, how much time are we talking about.

;Medievia has 7 days a week, 5 weeks a month, 35 days a month, 17 months a year, and 595 days per year. One Medievia day equals 15 Earth hours.

;The key is that One Medievia day = 15 Earth hours.


;------------------------------------------------------------------

#MATH Power (2+((@SecondsPassedSun - @SecondsPassed)/60/60/24))
#MATH Duration (2+((@SecondsPassedMoon - @SecondsPassed)/60/60/24))
#SHOW {%ansi(bold,Magenta)"XP COMBO:                   "%ansi(bold,cyan)"Power:"%ansi(bold,red)@Power%ansi(bold,cyan)" Duration:"%ansi(bold,red)@Duration%ansi(bold,cyan)"  Frequency:"%ansi(bold,red)"2"%ansi(bold,cyan)"     Fae needed: "%ansi(bold,yellow)%format("&9.0n",1000000)}
#MATH Power (1+((@SecondsPassedSun - @SecondsPassed)/60/60/24))
#MATH Duration (2+((@SecondsPassedMoon - @SecondsPassed)/60/60/24))
#SHOW {%ansi(bold,Magenta)"LOCATE SERPENTS:            "%ansi(bold,cyan)"Power:"%ansi(bold,red)@Power%ansi(bold,cyan)" Duration:"%ansi(bold,red)@Duration %ansi(bold,cyan)" Frequency:"%ansi(bold,red)"79"%ansi(bold,cyan)"    Fae needed: "%ansi(bold,yellow)%format("&9.0n",%eval(@Power * @Duration *1000))}
#MATH Power (3+((@SecondsPassedSun - @SecondsPassed)/60/60/24))
#MATH Duration (1+((@SecondsPassedMoon - @SecondsPassed)/60/60/24))
#SHOW {%ansi(bold,Magenta)"CREATE RAINSTORM:           "%ansi(bold,cyan)"Power:"%ansi(bold,red)@Power%ansi(bold,cyan)" Duration:"%ansi(bold,red)@Duration%ansi(bold,cyan)"  Frequency:"%ansi(bold,red)"63"%ansi(bold,cyan)"    Fae needed: "%ansi(bold,yellow)%format("&9.0n",%eval(@Power * @Duration *1000))}
#MATH Power (3+((@SecondsPassedSun - @SecondsPassed)/60/60/24))
#MATH Duration (6+((@SecondsPassedMoon - @SecondsPassed)/60/60/24))
#SHOW {%ansi(bold,Magenta)"REMOVE STORM:               "%ansi(bold,cyan)"Power:"%ansi(bold,red)@Power%ansi(bold,cyan)" Duration:"%ansi(bold,red)@Duration%ansi(bold,cyan)" Frequency:"%ansi(bold,red)"90"%ansi(bold,cyan)"    Fae needed: "%ansi(bold,yellow)%format("&9.0n",100000)}
#SHOW {%ansi(bold,Magenta)"ROAD INTERSECTION FARSIGHT:" %ansi(bold,cyan)"Power:"%ansi(bold,red)5%ansi(bold,cyan)" Duration:"%ansi(bold,red)"5"%ansi(bold,cyan)"  Frequency:"%ansi(bold,red)"5"%ansi(bold,cyan)"     Fae needed: "%ansi(bold,yellow)%format("&9.0n",25000)%char(10)}
#UNVAR Power
#UNVAR Duration
#UNVAR MoonDay
#UNVAR MoonHours
#UNVAR MoonMinutes
#UNVAR MoonSeconds
#UNVAR MoonMonth
#UNVAR MoonYear
#UNVAR SecondsPassed
#UNVAR SecondsPassedMoon
#UNVAR SecondsPassedSun
#UNVAR SunDay
#UNVAR SunHours
#UNVAR SunMinutes
#UNVAR SunMonth
#UNVAR SunSeconds
#UNVAR SunYear
#UNVAR curHours
#UNVAR curMins
#UNVAR curSecs]]></value>
    </trigger>
    <trigger priority="234110" copy="yes">
      <pattern>The current system time is %w %w %d (&amp;%dcurHours):(&amp;%dcurMins):(&amp;%dcurSecs) %d</pattern>
      <value>;This trigger is only used to capture the current system time, not the date.</value>
    </trigger>
  </class>
</cmud>
_________________
Intel Core 2 Quad Q9450 @2.66GHz
MDAC 2.8 SP1 ON WINDOWS XP SP3
Msjet40.dll ver 4.0.9511.0 + Security Bulletin MS08-028
CMUD v237
Order number: **7829

Last edited by meddlesome on Thu Oct 18, 2012 3:16 pm; edited 1 time in total
Reply with quote
meddlesome
Wanderer


Joined: 24 Aug 2012
Posts: 70

PostPosted: Thu Oct 18, 2012 3:15 pm   
 
Well, for some reason it just started working...All I did was modify the Moon section which doesn't make sense cause if it was that then it should have been doing it 3 more times.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <class name="FaeOrbCalculation" copy="yes">
    <trigger priority="233730" copy="yes">
      <pattern><![CDATA[Next New Moon:   %w (%w) (&%dMoonDay) (&%dMoonHours):(&%dMoonMinutes):(&%dMoonSeconds) (&%dMoonYear)]]></pattern>
      <value>;%1 = Month
#IF (%1=%time(mmm)) {#VAR MoonMonth %time(m)} {#MATH MoonMonth (%time(m)+1)}
#MATH OnMoon (((((@MoonMonth-1-%mod((@MoonMonth-1),2))/2))*30) + ((((@MoonMonth-1-%mod((@MoonMonth-1),2))/2))*31) + (%mod((@MoonMonth-1),2)*31)+(@MoonDay -1))

#VAR LeapYear 0
#IF ((%mod(@MoonYear,4)=0) || (%mod(@MoonYear,100)!=0)) {#VAR LeapYear 1};
#IF ((%mod(@MoonYear,4)=0) || (%mod(@MoonYear,100)=0) || (%mod(@MoonYear,400)=0)) {#VAR LeapYear 1};
#IF ((((@MoonMonth-1-%mod((@MoonMonth-1),2))/2))>1) {#IF (@LeapYear) {#ADD OnMoon -1} {#ADD OnMoon -2}}
#UNVAR LeapYear
#SHOW We Are on day @OnMoon

#MATH SecondsPassedMoon ((@OnMoon *24 *60 *60)+(@MoonHours *60 *60)+(@MoonMinutes*60)+@MoonSeconds)
#SHOW There have been @SecondsPassedMoon seconds since JAN 1.
</value>
    </trigger>
    <trigger priority="233920" copy="yes">
      <pattern><![CDATA[Eclipse Start:   %w (%w) (&%dSunDay) (&%dSunHours):(&%dSunMinutes):(&%dSunSeconds) (&%dSunYear)]]></pattern>
      <value>;%1 = Month
#IF (%1=%time(mmm)) {#VAR SunMonth %time(m)} {#MATH SunMonth (%time(m)+1)}

#MATH OnSun (((((@SunMonth-1-%mod((@SunMonth-1),2))/2))*30) + ((((@SunMonth-1-%mod((@SunMonth-1),2))/2))*31) + (%mod((@SunMonth-1),2)*31)+(@SunDay -1))
#VAR LeapYear 0
#IF ((%mod(@SunYear,4)=0) || (%mod(@SunYear,100)!=0)) {#VAR LeapYear 1};
#IF ((%mod(@SunYear,4)=0) || (%mod(@SunYear,100)=0) || (%mod(@SunYear,400)=0)) {#VAR LeapYear 1};
#IF ((((@SunMonth-1-%mod((@SunMonth-1),2))/2))>1) {#IF (@LeapYear) {#ADD OnSun -1} {#ADD OnSun -2}}
#MATH SecondsPassedSun ((@OnSun *24 *60 *60)+(@SunHours *60 *60)+(@SunMinutes*60)+@SunSeconds)
#UNVAR OnSun</value>
    </trigger>
    <trigger priority="234070" repeat="true" copy="yes">
      <pattern>Medievia has 7 days a week, 5 weeks a month, 35 days a month</pattern>
      <value><![CDATA[#MATH OnDay (((((%time(m)-1-%mod((%time(m)-1),2))/2))*30) + ((((%time(m)-1-%mod((%time(m)-1),2))/2))*31) + (%mod((%time(m)-1),2)*31)+(%time(d) -1))
#VAR LeapYear 0
#IF ((%mod(%time(yyyy),4)=0) || (%mod(%time(yyyy),100)!=0)) {#VAR LeapYear 1}
#IF ((%mod(%time(yyyy),4)=0) || (%mod(%time(yyyy),100)=0) || (%mod(%time(yyyy),400)=0)) {#VAR LeapYear 1}
#IF ((((%time(m)-1-%mod((%time(m)-1),2))/2))>1) {#IF (@LeapYear) {#ADD OnDay -1} {#ADD OnDay -2}}

#MATH SecondsPassed ((@OnDay *24 *60 *60)+(@curHours *60 *60)+(@curMins*60)+@curSecs)
#UNVAR OnDay

;------------------------------------------------------------------

#MATH Power (2+((@SecondsPassedSun - @SecondsPassed)/60/60/24))
#MATH Duration (2+((@SecondsPassedMoon - @SecondsPassed)/60/60/24))
#SHOW {%ansi(bold,Magenta)"XP COMBO:                   "%ansi(bold,cyan)"Power:"%ansi(bold,red)@Power%ansi(bold,cyan)" Duration:"%ansi(bold,red)@Duration%ansi(bold,cyan)"  Frequency:"%ansi(bold,red)"2"%ansi(bold,cyan)"     Fae needed: "%ansi(bold,yellow)%format("&9.0n",1000000)}
#MATH Power (1+((@SecondsPassedSun - @SecondsPassed)/60/60/24))
#MATH Duration (2+((@SecondsPassedMoon - @SecondsPassed)/60/60/24))
#SHOW {%ansi(bold,Magenta)"LOCATE SERPENTS:            "%ansi(bold,cyan)"Power:"%ansi(bold,red)@Power%ansi(bold,cyan)" Duration:"%ansi(bold,red)@Duration %ansi(bold,cyan)" Frequency:"%ansi(bold,red)"79"%ansi(bold,cyan)"    Fae needed: "%ansi(bold,yellow)%format("&9.0n",%eval(@Power * @Duration *1000))}
#MATH Power (3+((@SecondsPassedSun - @SecondsPassed)/60/60/24))
#MATH Duration (1+((@SecondsPassedMoon - @SecondsPassed)/60/60/24))
#SHOW {%ansi(bold,Magenta)"CREATE RAINSTORM:           "%ansi(bold,cyan)"Power:"%ansi(bold,red)@Power%ansi(bold,cyan)" Duration:"%ansi(bold,red)@Duration%ansi(bold,cyan)"  Frequency:"%ansi(bold,red)"63"%ansi(bold,cyan)"    Fae needed: "%ansi(bold,yellow)%format("&9.0n",%eval(@Power * @Duration *1000))}
#MATH Power (3+((@SecondsPassedSun - @SecondsPassed)/60/60/24))
#MATH Duration (6+((@SecondsPassedMoon - @SecondsPassed)/60/60/24))
#SHOW {%ansi(bold,Magenta)"REMOVE STORM:               "%ansi(bold,cyan)"Power:"%ansi(bold,red)@Power%ansi(bold,cyan)" Duration:"%ansi(bold,red)@Duration%ansi(bold,cyan)" Frequency:"%ansi(bold,red)"90"%ansi(bold,cyan)"    Fae needed: "%ansi(bold,yellow)%format("&9.0n",100000)}
#SHOW {%ansi(bold,Magenta)"ROAD INTERSECTION FARSIGHT:" %ansi(bold,cyan)"Power:"%ansi(bold,red)5%ansi(bold,cyan)" Duration:"%ansi(bold,red)"5"%ansi(bold,cyan)"  Frequency:"%ansi(bold,red)"5"%ansi(bold,cyan)"     Fae needed: "%ansi(bold,yellow)%format("&9.0n",25000)%char(10)}
#UNVAR Power
#UNVAR Duration
#UNVAR MoonDay
#UNVAR MoonHours
#UNVAR MoonMinutes
#UNVAR MoonSeconds
#UNVAR MoonMonth
#UNVAR MoonYear
#UNVAR SecondsPassed
#UNVAR SecondsPassedMoon
#UNVAR SecondsPassedSun
#UNVAR SunDay
#UNVAR SunHours
#UNVAR SunMinutes
#UNVAR SunMonth
#UNVAR SunSeconds
#UNVAR SunYear
#UNVAR curHours
#UNVAR curMins
#UNVAR curSecs
#UNVAR LeapYear]]></value>
    </trigger>
    <trigger priority="234110" copy="yes">
      <pattern>The current system time is %w %w %d (&amp;%dcurHours):(&amp;%dcurMins):(&amp;%dcurSecs) %d</pattern>
      <value>;This trigger is only used to capture the current system time, not the date.</value>
    </trigger>
  </class>
</cmud>
_________________
Intel Core 2 Quad Q9450 @2.66GHz
MDAC 2.8 SP1 ON WINDOWS XP SP3
Msjet40.dll ver 4.0.9511.0 + Security Bulletin MS08-028
CMUD v237
Order number: **7829
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net