English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 16 August 2021, 10:11   #1
Foebane
Banned
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
WHDLoad transfer script from archive to DH0 doesn't work

I am trying to write a script that will examine the contents of a WHDLoad archive (with any name, hence the first line) and to see if the folder of the game exists in a folder on DH0. If it doesn't, then I want it to copy those files to that folder. The second part of the script will then run the game from DH0 instead of the archive, which is read-only.

The problem is, I am rusty on such things and thought I could approach it this way:

Code:
s:spat cd #?.dir
assign >nil: dh0:games/b/blackviper
if warn
  copy all to dh0:games/b/blackviper
endif
cd dh0:games/b/blackviper
wbrun blackviper
But the assign completely fails. What am I doing wrong?

EDIT: I forgot to put "exists" at the end of the assign, but when I added it, it still didn't work.
Foebane is offline  
Old 16 August 2021, 10:36   #2
torsti76
Registered User
 
Join Date: May 2018
Location: Germany, Baden-Wuerttemberg
Posts: 387
assign >NIL: blackviper: dh0:games/b/blackviper

You forgot to tell assign what drive name you wanted your path to be assigned to.

Also, while testing something like this, it may prove beneficial to leave out the >NIL: first. Redirecting to NIL: effectively "swallows" all error messages.

Last edited by torsti76; 16 August 2021 at 10:42.
torsti76 is offline  
Old 16 August 2021, 10:48   #3
torsti76
Registered User
 
Join Date: May 2018
Location: Germany, Baden-Wuerttemberg
Posts: 387
To check if a folder exists, rather than doing an assign, I'd try:

failat 21 (don't know the error level really, you'd have to look it up}
dir >NIL: dh0:/path/to/game
if warn
...
failat (whatever it was before)
torsti76 is offline  
Old 16 August 2021, 12:32   #4
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
If you want to check for exists of file/directory then use IF EXISTS. See https://wiki.amigaos.net/wiki/AmigaO...d_Reference#IF
daxb is offline  
Old 16 August 2021, 18:43   #5
Foebane
Banned
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
Thanks for the advice, torsti76 and daxb, especially the "IF EXISTS" command.

I changed my script to this:

Code:
s:spat cd #?.dir
if not exists dh0:games/b/blackviper
  copy all to dh0:games/b
endif
cd dh0:games/b/blackviper
wbrun blackviper
And after testing, it seems to work. The first time I booted, it copied the files over then ran, and rebooting made it run directly. So I think that's a success. I've yet to test it on my other games, but I see no problems now.
Foebane is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eat the whistle WHDLoad versione doesn't work on Amiga 600 with Furia Accelerator... Aminta support.Games 14 04 March 2020 23:17
formatting DH0:NDOS, doesn't work Fender72 support.WinUAE 8 07 July 2016 15:34
transfer/convert DH0/1 from NTFS to Hardfile tjukken support.WinUAE 1 10 June 2016 16:24
McDonald Land WHDLoad doesn't work on my setup Amiga1992 support.Games 7 17 January 2014 19:42
How does one work out the 16-bit key for an RNC archive? MethodGit Coders. General 20 28 December 2011 00:23

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 15:35.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.22027 seconds with 13 queries