mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2013
Posts: 140
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 140
Please help improving this:
Quote:
on *:text:!birthday *:#:{
var %nick = $iif($2,$2,$nick)
if ($isbday(%nick) == 1) {
msg # 13Today is $+(%nick,'s) birthday! 5Jayyy!!!
}
elseif ($v1 == 0) {
var %bday = $readini(bday.ini,nicks,%nick)
var %month = $gettok(%bday,1,45)
var %day = $gettok(%bday,2,45)

msg # 5 $+(%nick,'s) birthday is on day %day of %month : He must wait $duration($todate(%month,%day))) from now!!!
}
else {
msg # No birthday recorded for %nick
}
}


That returns message: Nick's birthday is on day 12 of month 2 : He must wait 35wks 6days 2hrs 9mins 5secs from now!!!

would like to replace the %month with the name something like:
if %month = 1 then %name = January | if %month = 2 then %name = February etc

To return: Nick's birthday is on day 12 of February : He must wait 35wks 6days 2hrs 9mins 5secs from now!!!

Last edited by raycomp; 05/06/15 08:22 PM.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Well, you can use $asctime($calc($ctime + 21694145),mmmm)
where 21694145 is you $duration($todate)) reply.


Dont give a fish - teach to fish!
Joined: May 2013
Posts: 140
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 140
not working that returns today's date and time: Sat Jun 06 08:40:33 2015 unless I am using it incorrectly in my code

in the ini file the date stored is 2 12 2=month 12=day

my code returns 2 12 in msg - would like to return February 12

Last edited by raycomp; 06/06/15 06:47 AM.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Try this: msg # 5 $+(%nick,'s) birthday is on day %day of $asctime($calc($ctime + $todate(%month,%day)),mmmm) : He must wait $duration($todate(%month,%day))) from now!!!


Dont give a fish - teach to fish!
Joined: May 2013
Posts: 140
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 140
thanks. Works perfectly

Last edited by raycomp; 06/06/15 08:46 AM.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Ok, what is your $todate alias then?


Dont give a fish - teach to fish!

Link Copied to Clipboard