Hallå, undrar om det är någon som kan en del inom programmering och som skulle kunna hjälpa mig med ett script till mirc?
Nej, ingen bot. Vill bara ha ett script som matar ut stats med utrymmet på mina hårddiskar (både fysiska och mappade)
Tog ett redan existerande, där /hds skriver ut de fysiska och /hds -m skriver ut de mappade. Jag vill ha båda två på samma rad, och genom att lägga in en till loop och byta till %type = remote så har jag fixat så alla mappas. Det som jag nu vill ha hjälp med är att räkna in de mappade till total. Postar koden under, och ni som kan mrl förstår vad det är jag pratar om. Ni kan också se ändringen som jag gjort med %typer =remote och %iir och sedan editerat loopen.
hdds hds $1-
hds {
unset %?
if (l isin $1-) var %labels = 1
if (e isin $1-) var %hd.echo = 1
if (m isin $1-) var %type = remote
else var %type = fixed
var %typer = remote
var %ii = 99
var %iir = 99
while (%ii < 123) {
if ($disk($chr(%ii)).type == %type) var % [ $+ [ $chr(%ii) ] ] $iif(%labels == 1 && $disk($chr(%ii)).label,( $+ $disk($chr(%ii)).label $+ )) $round($calc($calc($disk($chr(%ii)).free / 1024 / 1024) /1024),2) $+ / $+ $round($calc($calc($disk($chr(%ii)).size / 1024 / 1024) / 1024),2)
inc %ii
if ($disk($chr(%iir)).type == %typer) var % [ $+ [ $chr(%iir) ] ] $iirf(%labels == 1 && $disk($chr(%iir)).label,( $+ $disk($chr(%iir)).label $+ )) $round($calc($calc($disk($chr(%iir)).free / 1024 / 1024) /1024),2) $+ / $+ $round($calc($calc($disk($chr(%iir)).size / 1024 / 1024) / 1024),2)
inc %iir
}
var %ii = 99, %iir, %hdsay
while (%ii < 123) {
var %tmp.v = $chr(37) $+ $chr(%ii)
if ($eval(%tmp.v,2)) var %hdsay = %hdsay ( $+ $upper($right(%tmp.v,-1)) $+ :) $eval(%tmp.v,2) -
inc %ii
}
ghds %type
if (%thds > 1) $iif(%hd.echo == 1,n.echo normal -atg,say) free space: %hdsay (total: %thdf $+ / $+ %thds GB)
else n.echo info -atg /hds: no %type drives found
}
ghds {
if ($1) var %type = $1
unset %thdfree %thdsize
set %ii 99
while (%ii < 123) {
if ($disk($chr(%ii)).type == %type) inc %thdfree $disk($chr(%ii)).free
inc %ii
}
set %ii 99
while (%ii < 123) {
if ($disk($chr(%ii)).type == %type) inc %thdsize $disk($chr(%ii)).size
inc %ii
}
set %thdf $round($calc($calc(%thdfree /1024/1024) /1024),2)
set %thds $round($calc($calc(%thdsize /1024/1024) /1024),2)
}
Har en lösning dock så tar det bort alternativet att man kan välja "remote" eller "local" hårddiskar.
Finns säkert en lösning på det också med lite if o sånt men jag fick inte det att funka tyvärr.
hds {
unset %?
if (l isin $1-) var %labels = 1
if (e isin $1-) var %hd.echo = 1
var %ii = 99
while (%ii < 123) {
if ($disk($chr(%ii)).type == fixed) var % [ $+ [ $chr(%ii) ] ] $iif(%labels == 1 && $disk($chr(%ii)).label,( $+ $disk($chr(%ii)).label $+ )) $round($calc($calc($disk($chr(%ii)).free / 1024 / 1024) /1024),2) $+ / $+ $round($calc($calc($disk($chr(%ii)).size / 1024 / 1024) / 1024),2)
if ($disk($chr(%ii)).type == remote) var % [ $+ [ $chr(%ii) ] ] $iif(%labels == 1 && $disk($chr(%ii)).label,( $+ $disk($chr(%ii)).label $+ )) $round($calc($calc($disk($chr(%ii)).free / 1024 / 1024) /1024),2) $+ / $+ $round($calc($calc($disk($chr(%ii)).size / 1024 / 1024) / 1024),2)
inc %ii
}
var %ii = 99, %hdsay
while (%ii < 123) {
var %tmp.v = $chr(37) $+ $chr(%ii)
if ($eval(%tmp.v,2)) var %hdsay = %hdsay ( $+ $upper($right(%tmp.v,-1)) $+ :) $eval(%tmp.v,2) -
inc %ii
}
ghds %type
if (%thds > 1) $iif(%hd.echo == 1,n.echo normal -atg,say) free space: %hdsay (total: %thdf $+ / $+ %thds GB)
else n.echo info -atg /hds: no drives found
}
ghds {
if ($1) var %type = $1
unset %thdfree %thdsize
set %ii 99
while (%ii < 123) {
if ($disk($chr(%ii)).type == fixed) inc %thdfree $disk($chr(%ii)).free
if ($disk($chr(%ii)).type == remote) inc %thdfree $disk($chr(%ii)).free
inc %ii
}
set %ii 99
while (%ii < 123) {
if ($disk($chr(%ii)).type == fixed) inc %thdsize $disk($chr(%ii)).size
if ($disk($chr(%ii)).type == remote) inc %thdsize $disk($chr(%ii)).size
inc %ii
}
set %thdf $round($calc($calc(%thdfree /1024/1024) /1024),2)
set %thds $round($calc($calc(%thdsize /1024/1024) /1024),2)
}
Edit: Kom ihåg att ta bort menu shortcuts.
Senast ändrat 2010-09-04 14:54:35