I was testing that following code in a windows vps and then the mIRC hangs, i cannot reproduce the same hang in Windows 10 so i cannot understand what is happening here.
alias conv {
if (!$2) && (!$3) && (!$4) && ($2 !isnum) { return }
if ($3 == $4) { return }
var %v = conv_ $+ $ctime $+ $ctime $+ $ticks $+ $ticks
jsonopen -ui %v https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol= $+ $upper($3) $+ &convert= $+ $upper($4) $+ &CMC_PRO_API_KEY=4ca2446d-9d3c-4587-8249-288143152362
if ($jsonerror) { echo 4 -s JSON ERROR: $jsonerror | jsonclose %v | return }
var %data = $json(%v,data,$upper($3),quote,$upper($4),price).value
if (!%data) { return }
; THE FOLLOWING LINE HANGS OUT THE MIRC
var %24h_percentage = $json(%v,data,$upper($3),quote,$upper($4),percent_change_24h).value
; After a lot of time spending in a lot of testing cases, when i disable that line the stuck stopped.
if (%24h_percentage) { var %24h = (0 $+ $iif($left(%24h_percentage,1) == -,4,9+) $+ %24h_percentage $+ % /5 24h) }
jsonclose %v
var %price = $calc($abs($2) * %data)
if (!%price) { return }
echo -a The currently amount of $abs($2) $upper($3) %24h to $upper($4) is: $bytes(%price,b)
}
Hello,
I was testing that following code in a windows vps and then the mIRC hangs, i cannot reproduce the same hang in Windows 10 so i cannot understand what is happening here.
JSON Version:
2.0.4000
Tested under:mIRC 7.61
Windows VPS Machine Specs: http://speccy.piriform.com/results/x5ywqsssPIvmAHrEHlhbmpK
JSON Raw:
Code:
Usage:
/conv 0 <amount> <from-crypto> <to-currency>
Example:/conv 0 1 btc usd