mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
so what i want to do is loop through
drives 2 - 10 if they are $true
i want to display the drive info but not on a different line on the same line.

any ideas

i was trying to use $gettok and $addtok so i could get the tokenised info and message it in one

but that wouldnt work or i couldnt get it to

can you help me please

alias HDD {
var %i = 2,%t = 11
while (%i < %t) {
if ($disk(%i) == $true) {
set %HDD = $addtok(%HDD,$disk(%i).path,44)
}
inc %i
}
var %b = 1
while ($gettok(%HDD,%b,44)) {
var %message = $addtok(%t,$gettok(%HDD,%b,???
inc %b
}

}


i want the message to be like
Drive C:\ Free: 2.0GB Of: 20GB - Drive D:\ Free ......


please help

thanks alot

Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
$disk(N).size -> Total size of it
$disk(N).free -> Free space

Since those values are in bytes, also use the $bytes() identifier. Check /help $disk and /help $bytes for more info.

Hope this helps,
Zyzzyx smile


"All we are saying is give peace a chance" -- John Lennon
Joined: Apr 2003
Posts: 85
K
Babel fish
Offline
Babel fish
K
Joined: Apr 2003
Posts: 85
or just use a dll like moo.dll that already does this function.


--

katsklaw
Rather experienced Admin
Rather experienced mIRC Scripter
Amateur C Coder
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
alias HDD {
  var %i = 2, %hddinfo
  while (%i &lt; 11) {
    if ($disk(%i)) { %hddinfo = %hddinfo Drive $disk(%i).path Free: $bytes($disk(%i).free,g) $+ GB Of: $bytes($disk(%i).size,g) $+ GB }
    inc %i
  }
  $iif(!$isid,echo -a,return) %hddinfo
}


Usage:
/HDD
Or
//echo -a $HDD


New username: hixxy
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
awesome i got it working now thanks

heres what i got:

alias HDD {
var %i = 2,%t = 11
while (%i < %t) {
if ($disk(%i) == $true) {
set %HDD $addtok(%HDD,$disk(%i).path,44)
}
inc %i
}
var %b = 1
while ($gettok(%HDD,%b,44)) {
var %x = $gettok(%HDD,%b,44))
set %message $addtok(%message, 4[10 %x 4] Free: [10 $size($disk(%x).free) 4] Total: [10 $size($disk(%x).size) 4] Used: [10 $size($calc($disk(%x).size - $disk(%x).free)) 4],160)
inc %b
}
echo -a %message
unset %message
unset %HDD
}


thanks again
smile

Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
lol oops i didnt see that post

smile thanks alot for that

i think ill use urs looks a bit more useable
and understandable

any way i can see how much space inall the drives added togather
and all the space used aswell
smile
thanks

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
alias HDD {
  var %i = 2, %hddinfo, %size, %used, %free
  while (%i &lt; 11) {
    if ($disk(%i)) { 
      %hddinfo = %hddinfo Drive $disk(%i).path Free: $bytes($disk(%i).free,g) $+ GB Of: $bytes($disk(%i).size,g) $+ GB
      [color:red]inc %size $disk(%i).size
      inc %used $calc($disk(%i).size - $disk(%i).free)
      inc %free $disk(%i).free[/color]
    }
    inc %i
  }
  $iif(!$isid,echo -a,return) %hddinfo [color:red]:: Size: $bytes(%size,g) $+ GB Free: $bytes(%free,g) $+ GB Used: $bytes(%used,g) $+ GB[/color]
}


New username: hixxy
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
awesome just what i wanted

smile

thanks alot


Link Copied to Clipboard