mIRC Home    About    Download    Register    News    Help

Topic Options
#62631 - 02/12/03 07:39 PM disk info
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
Somone that have any good idea how to calc the space of my HD's, and also show it in a %var ?? like total/free .. i tryed to use moo.dll , but it gives way to much info, and to strip it down would be to much work, it would be a huge script for a simple thing.. somone that have any other idea then moo.dll ? smile
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#62632 - 02/12/03 08:12 PM Re: disk info
pleur Offline
Ameglian cow

Registered: 16/10/03
Posts: 30
Loc: Netherlands, The
yeh, it's kinda easy to create your own DLL's, so you can make an output as you wish

i saw a tut lately, just use google


it ain't that hard, it's just a bit difficulter then mIRC scripting, but i pays you real bucks wink
_________________________
------
Cheers m8!

Top
#62633 - 02/12/03 08:20 PM Re: disk info
starbucks_mafia Offline
Hoopy frood

Registered: 09/12/02
Posts: 2962
Loc: Norwich, UK
Take a look at $disk in the helpfile.
_________________________
Spelling mistakes, grammatical errors, and stupid comments are intentional.

Top
#62634 - 02/12/03 09:53 PM Re: disk info
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
I never even tryed to make a DLL befor.. so dont say it easy, it's like tell me i can fly if i make me self wings of feders wink

and i tryed to use $disk, but couldent get it to do what i wanted it to.. so dunno if i did somthing wrong, but the size of the disks was wrong.. :tongue:
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#62635 - 03/12/03 12:02 AM Re: disk info
starbucks_mafia Offline
Hoopy frood

Registered: 09/12/02
Posts: 2962
Loc: Norwich, UK
$disk works perfectly for me, exactly as it says in the helpfile. The .free and .size properties return the size of the hard drive in bytes.
eg.
Code:
//echo -a $bytes($disk(c:).free).suf $+ / $+ $bytes($disk(c:).size).suf
_________________________
Spelling mistakes, grammatical errors, and stupid comments are intentional.

Top
#62636 - 03/12/03 10:23 AM Re: disk info
Doqnach Offline
Hoopy frood

Registered: 18/01/03
Posts: 1063
Code:
{
  var %drives = CDEFGHIJKLMNOPQRSTUVWXYZ , %count = 1
  while ($mid(%drives,%count,1)) {
    var %current = $mid(%drives,%count,1)
    if ($disk(%current).type == fixed) {
      var %hdinfo = $iif(%hdinfo,%hdinfo 3|) 3[14 $+ %current $+ 3:14 $+ $upper($left($disk(%current).label,1)) $+ $lower($right($disk(%current).label,-1)) $+ 3]: $gettok($bytes($calc($disk(%current).size - $disk(%current).free),m),1,46) $+ 3/ $+ $gettok($bytes($disk(%current).size,m),1,46) 3( $+ $round($calc((($disk(%current).size - $disk(%current).free) / $disk(%current).size) * 100),2) $+ $chr(37) $+ 3) 3( $+ $doqstatsbar($int($calc((($disk(%current).size - $disk(%current).free) / $disk(%current).size) * 100)),14) $+ 3)
    }
    inc %count
  }
  return %hdinfo
}


this is the code I use... it searches through all your local drives but skips cd-rom and network drives (aswell as A+B which are reserved for disk stations)

PS: it shows used / total, instead of free / total btw...
_________________________
If it ain't broken, don't fix it!

Top
#62637 - 03/12/03 11:05 AM Re: disk info
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
What in your code making it skip CD-rom's ?? i have been tryinh a while now.. and i cant get it to skip my CD-rom's smirk
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#62638 - 03/12/03 11:14 AM Re: disk info
Collective Offline
Planetary brain

Registered: 10/12/02
Posts: 3138
Loc: London, UK
if ($disk(%current).type == fixed) {

For cdroms $disk(%current).type returns cdrom.

It can also return "removable", don't know if there are any others.

Top
#62639 - 04/12/03 11:10 AM Re: disk info
qwerty Offline
Hoopy frood

Registered: 07/01/03
Posts: 2523
Btw, remember that mirc now supports $disk(N), which lets you use an index, for example you can use $disk(5) to get the properties of the 5th disk. So you could find the total number of disks with $disk(0) and then use $disk(%i).property to get the various properties. This way you don't have to loop 24 times but $disk(0) times.
_________________________
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Top
#62640 - 04/12/03 11:18 AM Re: disk info
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
I'm still using 6.03 grin grin grin but thnx anyway smile
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#62641 - 04/12/03 01:32 PM Re: disk info
Doqnach Offline
Hoopy frood

Registered: 18/01/03
Posts: 1063
the original script was written for mIRC 5.91 *G* but thnx, didn't know that!
_________________________
If it ain't broken, don't fix it!

Top