Shoutbox

[Release] - Currency Converter - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Release] - Currency Converter (/showthread.php?tid=66909)

[Release] - Currency Converter by Montago on 10-03-2006 at 12:03 AM

This nifty script will let you convert currencies on the fly

the best part, is that the currencies are gotten from the danish national bank, that are updated each day (nice aint it ?)

however the long names of the currencies are therefore danish... but i think you can handle it :)

/Currency
^ this function takes 2 or 3 arguments: 1st the amount, 2nd The 'from' currency and the optional 3rd 'to' currency

all currency arguments are ISO (except that €, $ and £ also works)

examples:
/Currency 100 USD GBP <-- converts USD to Pound Sterling
/Currency 250 USD <-- note that the default output is Danish Kroner

the result are shown in a toast window

Also /Currency_Available will show what currencies are available

While typing a messege, you may write [250 USD] or [300 USD GBP] which then converts the 'boxed' expression... the first will output xx DKR, the second xxx GBP


download here: http://www.mdk-photo.com/MSNScripts/Currency.plsc


RE: [Release] - Currency translator by CookieRevised on 10-03-2006 at 06:00 AM

nice idea for script...

But, the commands aren't reconized as commands!

Also, are you sure you use the correct convertions? They do not seem right to me, at least after cross referencing them with other currency converters. Make sure you do not use exchange units, but currency convertion units. They are different! Exchange units are the units that banks charge you (they always charge you more than the actual convertion)


Tip: add a GUI where you can select your default output currency (this can be even in the form of an submenu of the Plus! icon in the main contactlist (like a global setting) and convo window (like a temporary setting) where you simply tick the currency of your choice).

Tip: Use http://www.xe.com/ for all your currency converting, it contains every possible currency there is (more than 180 currencies in over 250 geographical locations) and is updated every minute!

Tip: for your symbols look at http://www.xe.com/symbols.htm

Tip: for(i=0;i<arr.length;i++) {} isn't needed with arrays you can simply do for(i in arr) {}


RE: [Release] - Currency translator by Montago on 10-03-2006 at 09:29 AM

xe.com charge for their Currency XML Table... so i dropped them as my reference...

i know im not using exhange rates, and instead bank rates... however, i could put on 5% on each currency, to make it more real...

How are the commands not recognized as a commad ??

Ill make the option for default output currency, ill make it not temporary, but saved in a file...

i need help on the GUI... however i believe that /Currency_output would be enough...


thanks for your tips :)


RE: [Release] - Currency translator by Underlord on 10-03-2006 at 10:08 AM

It should be called currency converter. One cannot translate currency unless they are translating the text on the currency.


RE: [Release] - Currency Converter by Montago on 10-03-2006 at 02:00 PM

*Renamed to Currency converter


RE: RE: [Release] - Currency translator by CookieRevised on 10-03-2006 at 05:07 PM

quote:
Originally posted by Montago
xe.com charge for their Currency XML Table... so i dropped them as my reference...
you don't need to use the XML table though, you can use their (very easy to use) forms...

quote:
Originally posted by Montago
How are the commands not recognized as a commad ??
when you have entered the command the usuall "this isn't reconized as a command, if you meant to send text, put a double // in front of it" message appears. This is because you do not make it clear to the ChatWndSendMessage event that you have handled the text. In other words, return a value (in this case an empty string) if you have handled the command.

quote:
Originally posted by Montago
Ill make the option for default output currency, ill make it not temporary, but saved in a file...
No, I didn't meant that. Read carefully what I suggested ;) (or slap me for being not so clear instead :p your choice :D)

What I meant was: provide a way to set a default output option (you got that). But you do not need a full blown GUI for this. You can easly use the submenus for this, since it only will be a selection from a list anyways.

The way you could implement it is to let the user select his global default output via the contactlist Plus! menu.

And as a added feature, you can let the user select another temporary currency output via the plus! menu in a conversation window. But this selection would only be temporary for that specific convo window. Aka: it will overwrite the global default setting.

EDIT: forget about the above... You can't have menu items ticked with a tickmark in Plus! (something for Patchou to add? Will be used a lot if it was available I'd imagine). I assumed you could have menu items ticked...

---------------

Also, whatever you do, don't save it in a file, save it in the registry. Using a file for only 1 settings is a bit over the top.
RE: [Release] - Currency Converter by jameslives on 10-04-2006 at 07:37 PM

this sounds a nice idea for a script
but ill wait until improvements are made before i use it


[Update] by Montago on 10-10-2006 at 08:51 PM

/Currencies_Set_Default
will let you set the default global output... however you need to do this everytime you start messenger :( since i dont know how to adjust Registry values... maybe another day :)


The error message is gone


just download the script again from my first link