mIRC Home    About    Download    Register    News    Help

Print Thread
#123824 27/06/05 08:59 PM
Joined: Mar 2005
Posts: 19
W
Wishie Offline OP
Pikka bird
OP Offline
Pikka bird
W
Joined: Mar 2005
Posts: 19
Hello!

I've successfully completed a script that will help me update my website, but it does have one flaw! In the document I will need the current month, hence I use the $asctime(mmmm) function. This works great! It's just that my website is in Swedish, not English. This is why I tried to create a custom identifier that would return the current month in Swedish, based on the $asctime(mmmm) function. Here's my code:

Code:
manad {
  if ( $asctime(mmmm) == January ) return januari
  else if ( $asctime(mmmm) == February ) return februari
  else if ( $asctime(mmmm) == March ) return mars
  else if ( $asctime(mmmm) == April ) return april
  else if ( $asctime(mmmm) == May ) return maj
  else if ( $asctime(mmmm) == June ) return juni
  else if ( $asctime(mmmm) == July ) return juli
  else if ( $asctime(mmmm) == August ) return augusti
  else if ( $asctime(mmmm) == September ) return september
  else if ( $asctime(mmmm) == October ) return oktober
  else if ( $asctime(mmmm) == November ) return november
  else if ( $asctime(mmmm) == December ) return december
}


However, this doesn't seem to work! Whenever I try to do //echo -a $manad I get "* /echo: insufficient parameters", and I can't refer to it in scripts either.

I'll gladly take any comments/help on this! (Yes, I did leave the {}-brackets on purpose, since it would mess up the code completely imo. smile)

Regards,
Wishie

#123825 27/06/05 09:07 PM
Joined: Mar 2004
Posts: 359
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
I cleaned it up a bit: If your wanting this to go in the remote section leave it how it is, however if you want it in the aliases section remove the word "alias" at the beginning.
Code:
alias manad {
  if ($asctime(mmmm) == January) return januari
  elseif ($asctime(mmmm) == February) return februari
  elseif ($asctime(mmmm) == March) return mars
  elseif ($asctime(mmmm) == April) return april
  elseif ($asctime(mmmm) == May) return maj
  elseif ($asctime(mmmm) == June) return juni
  elseif ($asctime(mmmm) == July) return juli
  elseif ($asctime(mmmm) == August) return augusti
  elseif ($asctime(mmmm) == September) return september
  elseif ($asctime(mmmm) == October) return oktober
  elseif ($asctime(mmmm) == November) return november
  elseif ($asctime(mmmm) == December) return december
}

#123826 27/06/05 09:12 PM
Joined: Mar 2005
Posts: 19
W
Wishie Offline OP
Pikka bird
OP Offline
Pikka bird
W
Joined: Mar 2005
Posts: 19
Oh, it was as simple as that... blush This is why I never got my custom identifiers to work! I put them in the wrong section (remotes instead of aliases). *feels as dumb as a donkey*

Well well, thanks a lot LostServ! I appreciate your concern. smile

Regards,
Wishie

#123827 27/06/05 09:16 PM
Joined: Mar 2004
Posts: 359
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
Quote:
Oh, it was as simple as that... blush This is why I never got my custom identifiers to work! I put them in the wrong section (remotes instead of aliases). *feels as dumb as a donkey*

Well well, thanks a lot LostServ! I appreciate your concern. smile

Regards,
Wishie


You can still do them in the aliases section, putting alias infront like I did lets you put them in a remote file. One other thing I noticed is you had else if instead of elseif (its together). Anyway, your welcome smile

#123828 27/06/05 09:36 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
You can also try this

Code:
alias manad return $replace($asctime(mmmm),January,januari,February,februari,March,mars,May,maj,June,juni,July,juli,August,augusti,october,oktober)
  


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#123829 28/06/05 02:22 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
or
Code:
alias manad return $gettok(januari februari mars april maj juni juli augusti september oktober november december,$date(m),32)


Link Copied to Clipboard