hdd.mrc – Show harddrive statistics
June 20th, 2007
No comments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | ;;;; HDD Listing v1.3.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Written by: ;; ;; Brian Schmidt aka. brianMan. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; Readme / Help ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Load this script in mIRC, if you don't know how to do this, then perhaps ;; ;; you shouldn't be using this script. ;; ;; ;; ;; Simple script, wich many others have allready made in various forms and ;; ;; shapes, that very simple lists all harddrives connected, their sizes, ;; ;; free space, and a total size/total free space. ;; ;; ;; ;; Commands available: ;; ;; /hdd ;; ;; /hdd total ;; ;; /hdd drives ;; ;; /hdd C ;; ;; ;; ;; Identifiers available: ;; ;; $hdd ;; ;; $hdd(0).total ;; ;; $hdd(0).totalfree ;; ;; $hdd(0).totalfreeprc ;; ;; $hdd(0).c ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; Changelog ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; v1.3.1 ;; ;; * Corrected a few $csize to $bytes ;; ;; * Changed the format the HDD info was output ;; ;; ;; ;; v1.3.0 ;; ;; + Removed the csise.mrc dependency, now uses built-in $bytes instead ;; ;; ;; ;; v1.2.0 ;; ;; + Added drive specific calls, both as identifiers and regular output ;; ;; ;; ;; v1.1.0 ;; ;; - Moved the "Convert Size" to external script "csize.mrc". ;; ;; + Added identifiers for use in other scripts. ;; ;; + Can now be called with "total" and "drives" options ;; ;; ;; ;; v1.0.0 ;; ;; + Initial release. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; alias hdd { var %num = 99 var %i = 0 if ($len($prop) == 1 || $len($1) == 1) { if ($isid == $true) { var %HD.tmp = $prop } else { var %HD.tmp = $1 } if ($disk(%HD.tmp)) { var %HD.single = $upper(%HD.tmp) $+ : Capacity: $bytes($disk(%HD.tmp).size).suf $+ . Used: $bytes($calc($disk(%HD.tmp).size - $disk(%HD.tmp).free)).suf ( $+ $round($calc(($disk(%HD.tmp).size - $disk(%HD.tmp).free) / $disk(%HD.tmp).size * 100),1) $+ $chr(37) $+ ) Free: $bytes($disk(%HD.tmp).free).suf ( $+ $round($calc($disk(%HD.tmp).free / $disk(%HD.tmp).size * 100),1) $+ $chr(37) $+ ) } else { var %HD.single = No such drive: $upper(%HD.tmp) $+ : } } else { while ( %num <= 122 ) { inc %i if ($disk($chr(%num))) { if (%num > 99) { var %HD.out = %HD.out - } var %HD.out = %HD.out $upper($chr(%num)) $+ : $bytes($disk($chr(%num)).free).suf $+ / $+ $bytes($disk($chr(%num)).size).suf ( $+ $round($calc($disk($chr(%num)).free / $disk($chr(%num)).size * 100),1) $+ $chr(37) $+ ) var %HD.total = $calc(%HD.total + $disk($chr(%num)).size) var %HD.totalfree = $calc(%HD.totalfree + $disk($chr(%num)).free) } inc %num } } if ($isid == $true) { if ($prop == total) { return %HD.total } elseif ($prop == totalfree) { return %HD.totalfree } elseif ($prop == totalfreeprc) { return $round($calc(%HD.totalfree / %HD.total * 100),1) } elseif (%HD.single) { return %HD.single } else { return %i } } if ($1 == total) { msg $active Free total: $bytes(%HD.totalfree).suf $+ / $+ $bytes(%HD.total).suf ( $+ $round($calc(%HD.totalfree / %HD.total * 100),1) $+ $chr(37) $+ ) } elseif ($1 == drives) { msg $active Free: %HD.out } elseif (%HD.single) { msg $active %HD.single } else { msg $active Free: %HD.out msg $active Free total: $bytes(%HD.totalfree).suf $+ / $+ $bytes(%HD.total).suf ( $+ $round($calc(%HD.totalfree / %HD.total * 100),1) $+ $chr(37) $+ ) } } |