Hi!
I?am looking for a script thats convert swedish money to euro, dollar, pund, danish, and so on. anybody know such a scrip? or can make on?
hi me want 1 that makes gold :]
but if you really do want 1 go ahead maybe some 1 is kind enough to make you 1
;)
sorry :( i wud have liked to try this one, but i have not time as i have to install my linux partitions agen, setup all devices, and lotsa other stuff b4 i erase windows full stop :)
but if i do get a little time i will give it a shot
btw you will probably have to give me the change ratio
Ratio +/- cahnges every day...
/shipis
well average wud do until i made a backbone for the script, so it can be changed
here is a site http://www.forex.se/ where u an the latest curancy
rates = dofile("rates.dat") or {}
function save()
local f = openfile("rates.dat", "w+")
write(f, "rates = {\n")
for currency, rate in rates do
write(f, "\t"..format("[%q]", currency).." = "..rate..",\n")
end write(f, "}") closefile(f)
end
function DataArrival(user, data)
if strsub(data, 1, 1) ~= "<" then return end
local s, e, cmd, args = strfind(data, "^%b<> %!(%S*)%s*(.*)|$")
if s then
cmd = strlower(cmd)
if cmd == "rconv" then
local s, e, currency, amount = strfind(args, "^(%a+)%s*(%d*)$")
if not s then user:SendData(">> syntax: !rconv [amount]") return 1 end
local rate = rates[currency]
if not rate then user:SendData(">> unknown currency") return 1 end
amount = tonumber(amount)
if amount and amount ~= 1 then currency = currency.."s" else amount = 1 end
user:SendData(">> "..amount.." "..currency.." = "..rate*amount.." kronen or whatever")
elseif cmd == "rset" then
if not user.bOperator then user:SendData(">> you cant change conversion rates") return 1 end
local s, e, currency, value = strfind(args, "^(%a+) ([%d%.]+)$")
if not s then user:SendData(">> syntax: !rset ") return 1 end
user:SendData(">> 1 "..currency.." = "..value.." kronen or whatever")
rates[currency] = tonumber(value) save()
else return
end return 1
end
end -- tezlo
OPs can !rset
anyone can !rconv [amount]