Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: Gulliver on September 03, 2009, 03:49:45 AM

Title: I need help on a a script!
Post by: Gulliver on September 03, 2009, 03:49:45 AM
Hi, I am trying to get the following script to do the following:
Check if omniscsi.device exists
else quit this script and run PlayCD
if not exists omniscsi.device then continue with the following part:

IF NOT EXISTS ENV:PlayCDpatch
    SETENV PlayCDpatch=""
    STACK 8192
    RUN >NIL: Playcdkludge 3    ;Unit number of your CD-ROM Drive here!  
    STATUS >ENV:PlayCDpatch COMMAND Playcdkludge
    PlayCD
    BREAK $PlayCDpatch
    DELETE >NIL: ENV:PlayCDpatch
ENDIF

Any help appreciated. I am sorry, I am not good at all with programming, even lame scripts!
Title: Re: I need help on a a script!
Post by: mike- on September 03, 2009, 04:13:05 AM
IF NOT EXISTS ENV:PlayCDpatch
    SETENV PlayCDpatch=""
    STACK 8192
    RUN >NIL: Playcdkludge 3    ;Unit number of your CD-ROM Drive here!  
    STATUS >ENV:PlayCDpatch COMMAND Playcdkludge
    PlayCD
ELSE (?)
    BREAK $PlayCDpatch
    DELETE >NIL: ENV:PlayCDpatch

ELIF
SYS:inet/merlin http://media.photobucket.com/image/baileys/BioPuritas/Baileys.jpg
FI
;loadwb
newshell
Title: Re: I need help on a a script!
Post by: Gulliver on September 03, 2009, 04:19:58 AM
just like i would do it, but without bailey, unluckily ;)
Anyway, is there someone who can help me?
Title: Re: I need help on a a script!
Post by: Thomas on September 03, 2009, 09:15:25 AM
Which part of the script is giving you problems ? Looks ok to me, although it does not mention omniscsi.device anywhere. I am not sure what you need.
Title: Re: I need help on a a script!
Post by: pVC on September 03, 2009, 09:49:50 AM
If the problem is to detect if there is omniscsi.device... I guess there would be better solution too, but atm this kludge comes in my mind :)

failat 21
version omniscsi.device >nil:
if fail
 echo "does not exist"
else
 echo "exists"
endif

Put anything you want instead those echos... quit command quits the script :)
Title: Re: I need help on a a script!
Post by: Gulliver on September 06, 2009, 05:15:44 AM
Thanks @pVC just what i was looking for!