Sign in to follow this  
Followers 0
nykoman

Fucntion Drivestatus

6 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Yes you can do that, use drivestaus in a do until statement.

Edited by rmarino

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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...

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0