getJFM - feedback? - 13/08/19 06:54 PM
As an exercise I wrote this, but I'd like feedback!
Code
alias getJFM { ; sha-512 of JSON For mIRC.mrc v1.0.4000 var %sha512 b29de8c964b002d089fa030a9a5357e3c737f17cd16309c0fa82142120a590db2223d4703cafe97f37b65de170bb4d9dbf7bb508f4052a47a2127fc74c10a6d6 ; check if JSON For mIRC is loaded if ($isalias(JSONVersion)) { var %file $isalias(JSONVersion).fname if ($sha512(%file,2) != %sha512) .unload -rs $qt(%file) | return $getJFM else return 0 } elseif ($1 isnum) { if ($urlget($1).state == fail) { echo -a Downloading failed. Are you connected to the internet? | halt } elseif ($zip($urlget($1).target,eo,scripts)) { var %dir $+(scripts\,JSON-For-Mirc-1.0.4000) var %file $qt($findfile(%dir,JSON For mIRC.mrc,1)) if (($sha512(%file,2) == %sha512) && ($input(Would you like to load $nopath(%file) $+ ?,yq))) .load -rs %file .remove $urlget($1).target } else { echo -a Something went wrong unzipping $urlget($1).target } } else { var %url https://github.com/SReject/JSON-For-Mirc/archive/v1.0.4000.zip var %target JFM.zip return $urlget(%url,gf,%target,getJFM) } }