English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 20 January 2015, 14:58   #1
Gordon
Settler

Gordon's Avatar
 
Join Date: Feb 2007
Location: Serf City
Posts: 1,204
Amiga equivalent of a .BAT file and scripting

Every so often I back up my my gave saves by manually going in to the game directory and copying the file to a floppy.

Is there an Amiga equivalent of a .BAT file that I could write a script to copy it automatically when I run the exectubale script.

And if so could someone write an example line so i can see syntax please. I would like it to force overwrite.
e.g
COPY DF1:SWOS:swos.save DF0:backup

Thanks

Last edited by Gordon; 20 January 2015 at 15:09.
Gordon is offline  
Old 20 January 2015, 16:03   #2
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 35
Posts: 591
Didn't you try just to add icon to txt file containing that line and set default tool to iconx?

and the line I'd say is good.
If a TO file name already exists, COPY overwrites the TO file with the FROM file.

Last edited by Cobe; 20 January 2015 at 16:11.
Cobe is offline  
Old 20 January 2015, 18:50   #3
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,027
There are some ways doing that automatically. First, an equivalent of a .bat file is more or less the same (just text files saved with a text editor). So you may name your script file "swos.txt" or "backup.txt" or "swosbackup" or how do you like. After saveing the text file it can launched via shell like this:

execute path_to_script:swosbackup

You can set the executable bit "s" with the Protect command to avoid typing execute:

protect path_to_script:swosbackup s add

path_to_script:swosbackup

Next you could add an alias if you still want to use CLI. You can add an alias in S:shell-startup. E.g.:

Alias b COPY DF1:SWOS:swos.save DF0:backup CLONE QUIET

Now In CLI you just type "b".

I would add CLONE to your command line and maybe QUIET later:

COPY DF1:SWOS:swos.save DF0:backup CLONE QUIET

If you want to backup by double click on an icon like Cobe already mentioned you just add an icon to your script file:

swosbackup
swosbackup.info

The icon must be of type "Project" (can be changed in icon information). In the default tool line there must be "IconX".

There are some more possibilities like lauch the script from an menu entry or a button what a programm delivers or via hotkey. It all depands on what you like.

If you want to backup each time after quit playing SWOS you can have automatic starting SWOS and backup in one script.
daxb is offline  
Old 20 January 2015, 20:05   #4
Cobe
Registered User

 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 35
Posts: 591
Yes, when we come to writing script the possibilities are endless.

Personally I would take a diskette
format it
name the diskette SWOS_Backup, for example
make drawer S
in S drawer make txt file startup-sequence
and in startup-sequence write
copy SWOS:swos.save SWOS_Backup: CLONE

I wouldn't go with QUIET in this case, I d want to see when it writes at the end file copied. But just to be sure if swos care about timestamp, comments, and protection bits of save file which I doubt CLONE is better, wont make any harm or prolong anyway.
I pressume that swos diskette is named SWOS and the save file has name swos.save and is to be found in root of diskette.
We all overseen your mistyping in your line DF1:SWOS:swos.sav
You cant have twice ":"
If you meant you would insert backup diskette in df0: and SWOS diskette in df1: the above script will do it any way cause it will look for specific volume SWOS_Backup: no matter in which drive it is or ask for it if you didn't insert it.
Cobe is offline  
Old 20 January 2015, 23:13   #5
BigFan
Registered User

BigFan's Avatar
 
Join Date: Feb 2014
Location: Germany
Posts: 261
Gordon, do you run your copying from full fledged WB on a harddrive or are you "diskjockeying"?
What version of WB are you running?


in addition to the answers above, a more general script:
Code:
.key file/A,source/K,target/K

if not <source>
    set src "df1:"
else
    set src <source>
endif

if not <target>
    set dest "df0:"
else
    set dest <target>
endif

cd $src

if exists <file>
    copy <file> to $dest clone
else 
    copy `requestfile drawer $src` $dest clone
endif
Name it to whatever you like, store it in S, protect +s:

source and target are optional, if omitted df1 is source, df0 is target

if file is not found, it will be requested

eg:
backup swos.save
>> file swos.save will be copied from df1 to df0

backup swos.save source=df2: target=ram:
>> file swos.save will be copied from df2 to ram

if you copy from/to subfolders, they must exist before calling backup
eg:
backup swos.save source=df2: target=ram:backups/
will fail if drawer backups does not exist

info file in attachement might be corrupt

greetz
Attached Files
File Type: lha bak.lha (1.1 KB, 54 views)
BigFan is offline  
Old 21 January 2015, 10:38   #6
Gordon
Settler

Gordon's Avatar
 
Join Date: Feb 2007
Location: Serf City
Posts: 1,204
Cobe thank you for your suggestions and script writing help. My disk is called BACKUP becuase I back up other games i play, as well as SWOS. All the save files are in the root and I just overwrite when prompted. Thanks for the Startup tip, but I rather not back up to floppy everytime i start Amiga as it will delay start up because i back up other games too.


daxb, thank you for you help and examples. I did not know about protection bits until now. But what is QUIET? Does that mean no pop up shell window?



BigFan, thank you for example script as well. Very helpful. I am doing my copying manually from DOPUS at the moment. But I will try writing a script next time I am on my Amiga.
Gordon is offline  
Old 21 January 2015, 15:25   #7
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,027
It is good to know about protection bits but not so important IMHO. At least the s bit (script bit). For example if you use an editor that don`t care about already existing s bit. So after saving it is lost and you have set it manually. I found it simpler to just use "execute <scriptfile>" (should work always).

In case of Copy command QUIET hides copy dialog output (file names that will be copy). So if you don`t want to see what happens then you might use QUIET. Just try it with and without. Used in a script started via icon (iconx) you won`t see output if no error happens. QUIET is primary used when copy a lot of files from/to HD/Ram because the output is too fast for reading and can slowdown copy process.

More information you can find in your Amiga DOS manual.

If you start DOS Games from floppy disk they contain S:Startup-Sequence to launch the game. If you add your copy command line to the end of this S:Startup-Sequence you don`t need an extra script for backup.
daxb 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
How do Game Saves work? diablothe2nd Coders. General 3 21 September 2013 14:55
Bards Tale game saves Washac support.Games 2 13 March 2012 10:15
game saves llama1978 support.Games 2 10 July 2010 14:17
backing up Arkanoid boing_1000 support.Apps 61 29 July 2008 18:30
Backing up an Amiga HD Galaxy support.Apps 8 13 September 2004 10:10

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


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.09070 seconds with 14 queries