Jump to content

Fucntion Drivestatus


nykoman
 Share

Recommended Posts

Guys,

I have a simple script that automates the ripping process in ExactAudioCopy (eac)

Everything seems to be working, but...

Eac is set to auoeject the media after the ripping process is complete.

I want the script to repeat itself when the new media is inserted.

can i use the function drivestatus for this?

I want the script to repeat from a particular line in the script when de drive (d:\) reports a status "ready"

Thank in advance!!

Nico

Link to comment
Share on other sites

I used this in one of my scripts. I'm sure there's a more economical way to do it, but here's what I've done. Just call the function when you need it to check.

Func CheckDrive()   
Do 
   Sleep( 5000 )
Until DriveStatus("D:\") = "READY"
BeginBurn()
EndFunc
Edited by Distrophy
Link to comment
Share on other sites

Thanks!

But when i'm trying it in a test script like this:

CODE
Func CheckDrive()

Do

Sleep( 5000 )

Until DriveStatus("D:\") = "READY"

MsgBox(0, "Tutorial", "Hello World!")

EndFunc

Nothing happens!

All I want is the script to proceed (actually loop from a particular line in the script)

AFTER i insert a cd.

Nico

Link to comment
Share on other sites

did you run the function example like this: CheckDrive()

or did you try running the function just as you posted it.

functions must be called

Try this example

checks if drive exists and type matches CDROM - return type for CD/DVD)

has option for timeout - default 0 infinite wait for "READY' or enter number of seconds (15 or greater) for timeout fail

return boolean (True/False 1/0) instead of string ready/notready - no need to string match, easier for use in conditional statements

use like this:

If CheckDrive($Drive,30) Then 
    _Burn()
Else
    Exit
EndIfoÝ÷ Ù«­¢+Ù1½°ÀÌØíÉÙMÑÐ)1½°ÀÌØíÉ¥ÙôÅÕ½ÐíèÀäÈìÅÕ½Ðì(ÀÌØíÉÙMÑÐô
¡­É¥Ù ÀÌØíÉ¥Ù°ÌÀ¤ìÉ¥Ù±ÑÑȹѥµ½ÕÐÙ±Õ¥¸Í½¹Ì°µ¥¹¥µÕ´Ù±ÕÄÔ°Àô¥¹¥¹¥ÑÝ¥Ð)5Í ½à ÐÀäØ°ÅÕ½ÐíMÑÑÕÌÅÕ½Ðì°ÀÌØíÉÙMÑеÀìÅÕ½ÐìèÀõ9=QIdÄõIdÅÕ½Ðì¤()Õ¹
¡­É¥Ù ÀÌØíÉÙMÑÐôÀ°ÀÌØíQ¥µ½ÕÐôÀ¤(%1½°ÀÌØí¤°ÀÌØí¥Q¥µôÄÔ(%MÝ¥Ñ É¥ÙÑQåÁ ÀÌØíÉÙMÑФ($%
ÍÅÕ½Ðí
I=4ÅÕ½Ðì($%
ÍÅÕ½ÐìÅÕ½Ðì($$%
½¹Ñ¥¹Õ
Í($%
ͱÍ($$%IÑÕɸÀ(%¹MÝ¥Ñ (($%M±À ÄÀÀÀ¤($%%ÀÌØíQ¥µ½ÕÐÐìôÀÌØí¥Q¥µQ¡¸($$$ÀÌØí¤¬ôÄ($$%%ÀÌØí¤ôÀÌØíÑ¥µ½ÕÐQ¡¸IÑÕɸÀ($%¹%(%U¹Ñ¥°É¥ÙMÑÑÕÌ ÀÌØíÉÙMÑФôôÅÕ½ÐíIdÅÕ½Ðì(%IÑÕɸÄ)¹Õ¹
Edited by rover

I see fascists...

Link to comment
Share on other sites

Thanks!

But when i'm trying it in a test script like this:

CODE
Func CheckDrive()

Do

Sleep( 5000 )

Until DriveStatus("D:\") = "READY"

MsgBox(0, "Tutorial", "Hello World!")

EndFunc

Nothing happens!

All I want is the script to proceed (actually loop from a particular line in the script)

AFTER i insert a cd.

Nico

Hi Nico,

No wonder nothing happens! The code Distrophy supplied is an Function... you have to make a call to it from your main loop.

I think that what you want can be done like this:

;MAIN
$Drive2Rip = "D:\"
$ProgExit = False

Do
    If DriveCheck($Drive2Rip) Then DoRip($Drive2Rip)
   ; Check here for your Program Exit cause, can be an GUI application or whatever
Until $ProgExit

Exit

;======================
; Functions
;======================
Func CheckDrive($drive)
  $ret = False
  If DriveStatus($drive) = "READY" Then $ret = True
  Return $ret
EndFunc

Func DoRip($drive)
 ; do your ripping here
EndFunc

This is only an example!

Grtz,

Paul

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...