User avatar
Gernot66

Posted Thu Aug 11, 2022 5:59 am

Intentionally i liked to post this in "0x05A" but it's to far from pure graphical enhancements what i like to post here.
You will find here (perhaps with the help of other members) script examples for O.S.1.3 mostly because it can be a difficult task to work around the leaks in O.S.1.3 such as missing backtabbing or very limited handling of environment variables and the complete leak of per process variables.

I would have a couple of scripts started but recently only one is in a state that i dare to publish it.

The first script i will show off here is "Float Dir" which supports "NoIconPos" (v1.0 4-nov-87 AMSoft), noiconpois is a CLI command to as the name intents clear the position of an icon - one single icon. NoIconPos has a drawback it won't perform its action if you pass the suffix ".info" to it thus it can't be run with "DPAT" or "ARP FOR" that's why i scripted this batch proggie.
Sure "FloatIcon" on the other hand as program gives you the opportinity to shift click on a range of icons to float, but if you like to float 100 icons this is stupid and often you will move one unintentinally out of the drawer or if unintentionally doubleclicked move the icon of the drawer containing the icon in its own drawer though it's swallowed by itself in a sort of way.

"Float Dir" does it better if you like to float a whole drawer, it allows you
a) to run the script from CLI and specify a directory
b) to run it from CLI without argument and it will pop up a filerequester to select the desired directory
c) to shift click on the desired drawer on WB
d) to launch the script from it's icon and it will even pop up the filerequester

Let's see how that appears:
Nice little script for what i missed since decades.

Before i post the script a list of the the used programs:
- NOICONPOS v1.0 4-nov-87 AMSoft (fish disks, aminet)
- BATCHREQUESTER v1.1 1990 by Christoph Teuber (simple OS1.3 requestfile, aminet)
- FILTER (hack) by Russell Wallace (part of CLI_Utilities, fish disks, aminet)
- REPSTRING v1.0 1988 Luciano Bertato (much easier to use as to program edit, aminet)
- SOUND by GRAMMA SOFTWARE 07 Mar 1991 RLStockton (aminet)

NoIconPos is of course the thing it is all about

Batchrequester i found after a deep search respectively after i tried out a felt 1000 filerequester demos which are useless in a batch but this is exactly what one will need, a bit limited but OK for OS1.3 especially since it is the only really useful i found. The strongest drawback is that it leaks of an errolevel setting for the operation "cancel", it isn't by far the only CLI program which leaks of this all so natural and needed feature for a batch. The author worked around this leak by defaulting the start directory to RAM: and to set as default file "Test" this can be checked if cancel is pressed or OK is pressed without to select a directory other than RAM:, i do not understand proper why in this manner the erorlevel return would be what one expects.

Filter is what you like to filter binaries out of strings, but this thing leaks of filtering LF (0x0A) and filters uselessly all above 0x7E, the tilde thus it was a must to hack it to my needs since as a Swiss i need the umlauts, french citicens will need the apostrophe and nordic users the rest of quirky phonetic characters and so on...
Suggested adresses and values to hack FILTER:
0x0155 from 0x7F to 0xFE (extends qualified character range)
0x015D from 0x0A to 0x1B (keeps "ESC" instead of "LF", thought you have a script edited with M-EMACS or similar which will contain binary instructions for FF, BEL or ESC to have escape sequnces in a text/script without to echo them to it)
0x0165 from 0x09 to 0x07 (keeps "BEL" instead of "TAB", which is the least needed change but i listed it to show the left last qualifier you can hack to your needs)

RepString replaces in a comfortable way a given string with a new string and it is also possible to erase a section of a string in a simple manner. No need to get yourself a messed up brain by using "edit" or "bawk" for the same task just enter the two qualifiers and the in and output files. RepString will always process the whole file and change all occurances of the qualifier, exactly what i need to strip ".icon" off the directory listing to make it suitable for the use with NoIconPos which needs the icon names to be passed to it without the suffix.

Sound, a rather optional program but i like if my scripts play a SFX, as intro, at end and to report positive or negative selections/answers.

"Das scriptli" explained:

Code: Select all

.KEY DIR
.BRA {
.KET }
.
. -----------------------------------------------------------------------------
. OS1.3 Script to float all icons in a directory using NoIconPos, of course
. one could use DPAT, "ARP FOR" or similar commands but unfortunately NoIconPos
. allows no suffix for the icons which means all of the possible commands
. won't work for NoIconPos since under OS1.3 all will pass the suffix to
. NoIconPos.
. This script simply creates a list from the icons in the selected or to
. the script passed directory and erases the suffixes from the listed files,
. unfortunately OS1.3 doesn't supports a formatting of the string with %M
. (lists only names without suffix), as result you will have a nice script
. which can be executed by IconX from an Icon just like a standalone program.
. It will open a file-requester to select the directory and shows in the output
. window the progress of the running script (listing).
.
. ADVANTAGES:
. - Can be invoked from CLI
. - Can be invoked from WB by shift clicking on the desired directory
. - Opens a filerequester if invoked without argument
. - You always missed this possibility to float a whole directory
.
. DISADVANTAGES
. - lumpy script
. - uses many non standard commands/programs
. - not all possible errors are handled proper
. - You might not need it at all
. -----------------------------------------------------------------------------
.
. -----------------------------------------------------------------------------
. ARP CLS or ECHO "*E[H*E[J" NOLINE
. give the window a different color as WB background
. -----------------------------------------------------------------------------
ECHO "*E[42;33m*E[H*E[J" NOLINE
.
. -----------------------------------------------------------------------------
. Show help in sys:system/help which is my default help dir for my scripts
. this makes a) the scripts smaller b) gives the possibility to read the help
. of a "silent executed" script like this without to invoke it from CLI.
.
IF "{DIR}" EQ "H"
   RUN >NIL: >NIL: EXECUTE S:showhelp FloatDir
   QUIT
ENDIF
.
. -----------------------------------------------------------------------------
. use filerequester if DIR is empty
. -----------------------------------------------------------------------------
IF "{DIR}" EQ ""
   LAB #START#
   RUN <NIL: >NIL: D:SOUND SFX:beep/beep13 Q D V32
   D:BATCHREQ >NIL: ENV:FD{$$}A "Select directory (no file!)" RAM:
.
. -----------------------------------------------------------------------------
. assumed it's invoked from CLI or from WB with shift-click
. -----------------------------------------------------------------------------
ELSE
   RUN <NIL: >NIL: D:SOUND SFX:beep/beep13 Q D V32
   ECHO >ENV:FD{$$}A "{DIR}/" NOLINE
ENDIF
. 
. -----------------------------------------------------------------------------
. check if cancel is pressed, directory variable is empty
. -----------------------------------------------------------------------------
SETENV FD{$$}B 0
IF "$FD{$$}A" EQ ""
   D:SOUND SFX:Voice/ah Q D V48 8000
   SKIP #EXIT#
ENDIF
.
. -----------------------------------------------------------------------------
. check if OK is pressed and directory is still RAM:
. -----------------------------------------------------------------------------
IF "$FD{$$}A" EQ "RAM:"
   D:SOUND SFX:Voice/ah Q D V48
   DELETE >NIL: T:FD{$$}#? ENV:FD{$$}#?
   SKIP #START# BACK
ENDIF
.
. -----------------------------------------------------------------------------
. if everything is fine report this acoustical
. -----------------------------------------------------------------------------
D:SOUND SFX:Voice/ja Q D V48
.
. -----------------------------------------------------------------------------
. FILTER possible linefeed (0x0A) using FILTER HACK
. -----------------------------------------------------------------------------
D:FILTER >T:FD{$$}B ENV:FD{$$}A
.
. -----------------------------------------------------------------------------
. create an executable temp file to list the selected directory
. -----------------------------------------------------------------------------
ECHO >T:FD{$$}A "LIST " NOLINE
ECHO >T:FD{$$}C "#?.info LFORMAT *"SYS:Tools/NOICONPOS ***"%S%S***"*" TO T:FD{$$}E"
JOIN T:FD{$$}A T:FD{$$}B T:FD{$$}C TO T:FD{$$}D
.
. -----------------------------------------------------------------------------
. execute the temp file
. -----------------------------------------------------------------------------
EXECUTE T:FD{$$}D
.
. -----------------------------------------------------------------------------
. erase suffix ".info" from temp list because NOICONPOS allows no suffix 
. -----------------------------------------------------------------------------
D:REPSTRING >NIL: T:FD{$$}E T:FD{$$}F .info" ""
.
. -----------------------------------------------------------------------------
. execute temp script to clear position of all listed icons
. -----------------------------------------------------------------------------
RUN <NIL: >NIL: D:SOUND SFX:BARIS/liftoff Q D V32
IF EXISTS T:FD{$$}F
   EXECUTE T:FD{$$}F
ENDIF
.
. -----------------------------------------------------------------------------
. wait for SOUND to finish (this is even a standalone helper script)
. -----------------------------------------------------------------------------
LAB #LOOPY#
STATUS >ENV:COM{$$} COMMAND D:SOUND
IF "$COM{$$}" EQ ""
   WAIT
ELSE
   WAIT
   SKIP #LOOPY# BACK
ENDIF
DELETE >NIL: ENV:COM{$$}
.
LAB #EXIT#
. -----------------------------------------------------------------------------
. play a nice end sfx and clean up the mess
. -----------------------------------------------------------------------------
D:SOUND SFX:beep/beep15 Q D V32
DELETE >NIL: T:FD{$$}#? ENV:FD{$$}#?
WAIT 2
.
. -----------------------------------------------------------------------------
. clear the screen in case it's invoked from CLI
. -----------------------------------------------------------------------------
ECHO "*E[0m*E[H*E[J" NOLINE
.
. -----------------------------------------------------------------------------
. This script uses following additional programs:
. SOUND by GRAMMA SOFTWARE 07 Mar 1991 RLStockton
. BATCHREQ(UESTER) v1.1 1990 by Christoph Teuber (simple OS1.3 requestfile)
. FILTER (hack) by Russell Wallace (part of CLI_Utilities, Fish Disks)
. REPSTRING v1.0 1988 Luciano Bertato (much easier to use as to program edit)
.
. At last but not at least:
. NoIconPos v1.0 4-nov-87 AMSoft
.
. FILTER (hack)
. FILTER unfortunately filters "umlauts", for english typing users FILTER will
. be fine but it will strip ALL characters after "~" (0x7E) like "umlauts"
. or "accent" which is very sad. I hacked FILTER and exceeded the range of
. qualified characters from " " (0x20) to "ý" (0xFD) therefore it strips now
. linefeed (0x0A) but keeps "ESC" (0x1B, for pre-made esc sequences, i.e. with
. M-EMACS) and BEL (0x07) to keep the bell command in scripts or texts,
. a further inclusion of qualified characters will need a recompiling of the
. source. The original FILTER keeps linefeed (0x0A), tab (0x09) and all
. from 0x20 to 0x7E.
. Adresses to hack:
. 0x0155 from 0x7F to 0xFE  (extends qualified character range)
. 0x015D from 0x0A to 0x1B  (keeps "ESC" instead of "LF")
. 0x0165 from 0x09 to 0x07  (keeps "BEL" instead of "TAB")
.
. SFX:
. beep13 - invoke program, parametric synthesizer
. beep15 - exit/cancel program, parametric synthesizer
. ja - settlers "ja!" (OK)
. ah - settlers "ah..." (Cancel)
. LiftOff - BARIS "liftoff" (successfully run final script)
.
. SOUND is my preferred SFX player it is the most comfortable i found for
. OS1.3. It could be only slightly better if it could be terminated even
. if the status bar isn't shown any else is fine it properly recognizes
. stereo 8SVX and can even play stereo files with a wrong header or proper
. made stereo raw samples. Stereo 8SVX is an abuse of the so called 
. "high octave" for 8SVX which means the left channel will follow the right
. channel both as mono streams very unlike other formats where right and
. left channel is sampled byte-wise or word-wise, if a raw stream is sectioned properly
. at half of the total filesize the option "S" will play this sample in stereo.
. When you encounter that a stereo 8SVX is played twice pass even "S" as option
. to SOUND and the sample will be played correctly (with the drawback that the
. header will produce a short noise). This unique behave of stereo 8SVX makes
. it possible to join two complete different samples of the same filesize to
. a quasi stereo sample. SOUND even recognizes and plays back proper
. Fibonacci compressed files if they are played from RAM, if played from
. DISK (using option D) it will stutter since the decompressing needs more
. time as the playback speed is. The comnpression ratio of fibonacci compressed
. files is quite good but extracting needs to long especially for larger SFX
. which makes it unsuitable to use under OS1.3.
. But samples with 8bit depth and a sample rate of 8000 to 12000 Hz won't
. use more space as a 128kB/s MP3, sure not as useful on a real Amiga
. if i guess that i was a lucky A2000 user with a whopping 250MB rigid disk.
. But well a CD-ROM drive attached to it would allow to play music in this
. format, sure meager 12kHz@8bit but me aged 56 can't hear any difference
. no more except a noise floor, this static noise of an 8bit sample can be
. reduced if the sample is sampled without to dither the wave, for i.e. 
. "Audacity" this would mean the output dithering is set to "no" instead of
. "rectangular", "triangular" or "formed" (which would offer the smoothest
. dithering for >= 16bit samples).
. Brute force noise reduction:
. It is possible to lower the noise floor of an existing sample, but take
. care this method can and will destroy data. You can use a recent Hex-Editor
. and change i.e. all FF to 00 or vice versa this will erase the static noise
. of complete silent passages, but if you clean-up the complete stream in this
. manner it will leave a hard crackle for low volume passages. However it can
. be handy to erase the noise of silent passages if only these are altered.
.
. Directory D:
. this is my second C: directory which contains all non standard CLI programs
. to keep C: clean from them (i did that already on my A2000 which i do not own
. anymore since long), programs with the same name in D: won't interfere with 
. those in C: even if D: is in the searchpath because C: has priority over all
. if C: is additionally set by PATH in the startup-sequence, i.e. "List" will
. always invoke "C:List" and never "D:List" (the ARP list).
. imho it's very useful to have a D: directory where you can manipulate, hack,
. and put new programs in, even if D: is a tohou-wabohou C: will stay clean.

Not even a long script if you strip off all comments while i have shortened it a lot, when i started off i used a "requestchoice" (QUICKREQ) to decide between "Proceed" and "Cancel", it wasn't as easy as it looks to find out how the author of "BATCHREQ" has meant to use it if "Cancel" or "OK" without selection is pressed. thjs in the beginning i had some more of intermediate steps until the temp script was set up to be executed.

The help, suggested to put in "SYS:system/help" it will be called by the "FloatDir" script if "H" is passed as argument to it and will reside as a standalone help in "Help" (the short s:showhelp script will follow in the next entry here).

Code: Select all

[H[J[43;32m[K[2f[K[3f[K[4f [42;33m[K[5f[1D[43;32m[K[5f [42;33m[K[6f[1D[43;32m[K[6f [42;33m[K[7f[1D[43;32m[K[7f [42;33m[K[8f[1D[43;32m[K[8f [42;33m[K[9f[1D[43;32m[K[9f [42;33m[K
[10f[1D[43;32m[K[10f [42;33m[K[11f[1D[43;32m[K[11f [42;33m[K[12f[1D[43;32m[K[12f [42;33m[K[13f[1D[43;32m[K[13f [42;33m[K[14f[1D[43;32m[K[14f [42;33m[K[15f[1D[43;32m[K[15f [42;33m[K
[16f[1D[43;32m[K[16f [42;33m[K[17f[1D[43;32m[K[17f [42;33m[K[18f[1D[43;32m[K[18f [42;33m[K[19f[1D[43;32m[K[19f [42;33m[K[20f[1D[43;32m[K[20f [42;33m[K[21f[1D[43;32m[K[21f [32m2022GS66[33m[K[0m
[H[2;3f[1;43;32mFLOATDIR[0;43;32m [DIR][5;3f[1;42;33m[DIR][0;42;31m optional directory path, if "H" is omitted this help is shown.[7;3f[42;33mThis script can be invoked from CLI but it is intentionally meant to be started
[8;3f[42;33mfrom Workbench. However, if you invoke it from CLI you can either pass a path to[9;3f[42;33ma directory with icons to float to it or if [DIR] is not omitted it will open a
[10;3f[42;33mfilerequester to select the desired directory. As a second possibility you can[11;3f[42;33mshift click on a directory on Workbench and it will float all icons in this
[12;3f[42;33mdirectory. As third option you can invoke the script from WB without any argument[13;3f[42;33mand it will even open the filerequester to select a directory.
[14;3f[42;33mIf you press "Cancel" in the filerequester the whole operaton is cancelled.[15;3f[42;33mIf you press "OK" and have no directory selected except the preset RAM: it will
[16;3f[42;33mreturn and open the filerequester again, it won't check if icons are present[17;3f[42;33min the selected directory neither if unintentionally a file is selected. 
[18;3f[42;33mBy default the Icon of this script opens a RAW window and if the script hangs[19;3f[42;33mit must be closed by entering "endcli" and then press CTRL+ENTER to exit.
[0m

[J
Cough, the as binary marked respectively now blanked out character in this "code" (a code wthout binaries?) is 0x1B "ESC" (leads the bracket "[")
More will nicely display this as shown below:
22.png
Last but not at least a zip of the used SFX place them anywhere i suggest to set up an assign for a specific SFX drawer like used in this example "SFX:" where that resides won't matter, personally or if you have the chance to use a second rigid disk drive put it there though it will play most smoothly, but on slow machines it is intented to play from RAM:.
However no matter how "slow" i setup the virtual Amiga SOUND seems to have no problems to play proper from disk thus the disk speed might be what is more important as the machine speed.
FloatDir_SFX.zip
(76.13 KiB)
And at last but for sure not at least the icon for "FloatDir" no special thing it's a copy from the icon for "FloatIcon".
Perhaps i will create a new one especially since i like to update all icons to a size of 80x40.
However it contains the call for "Xicon" if you would like to use "IconX" you will need to make a tiny script to execute S:showhelp <filename>
Most often i use "IconX" and not "XIcon" this is an exclusion.
FloatDir_info.zip
(482 Bytes)
...worng as wrong can be...
i liked to link this help ansi
FloatDir.zip
(1 KiB)
End of Script #1 "FloatDir"
Last edited by Gernot66 on Thu Aug 11, 2022 11:23 am, edited 4 times in total.

User avatar
Gernot66

Posted Thu Aug 11, 2022 9:07 am

Script #2 (or script #0 to be honest)

ShowHelp

Which is a rather short helper script to display the help for all of my scripts, that helps a) to keep the scripts short and neat because the help with a ton of escape sequences will confuse you if you peep in the scripts, b) allows to read the help for the script outside of CLI use mostly useful for scripts like the previous posted one which are invoked from Workbench.

Dunno if i can and will perform what i did for MS-DOS, but there i scripted an own ANSI reader for my help which can show more as one page in a neat way and plays a "flip page" SFX if a page is "flipped". I guess this rather "reference" style help is better.

How such a reference or help appears you have seen in the previous entry thus i can proceed rightaway to the code:

Code: Select all

.KEY FILE/A,READER
.BRA {
.KET }
. -----------------------------------------------------------------------------
. define the default reader (More)
. -----------------------------------------------------------------------------
.DEF READER SYS:Utilities/MORE
.
. -----------------------------------------------------------------------------
. play a special SFX, "intype" is the sfx of "Intellivision Vectron" when it
. splatters the results for each level on the screen. it's sampled @8kHz
. but played back quite faster.
. -----------------------------------------------------------------------------
RUN <NIL: >NIL: D:SOUND SFX:Various/Intype01 12000 Q D V32
.
. -----------------------------------------------------------------------------
. save the current directory in case the help is invoked from CLI
. -----------------------------------------------------------------------------
CD >T:RECENT{$$}
.
. -----------------------------------------------------------------------------
. change to sys:system/help though more will nicely only display the name
. of the help text in its title bar
. -----------------------------------------------------------------------------
CD SYS:System/Help
.
. -----------------------------------------------------------------------------
. Check if suffix .ansi is passed or not and decide action
. -----------------------------------------------------------------------------
ECHO >T:SH{$$}B "{FILE}"
SEARCH T:SH{$$}B .ansi
IF WARN
   "{READER}" "{FILE}.ansi"
ELSE
   "{READER}" "{FILE}
ENDIF
.
. -----------------------------------------------------------------------------
. the common "end of script" SFX
. -----------------------------------------------------------------------------
RUN >NIL: D:SOUND SFX:Beep/beep15 Q D V32
.
. -----------------------------------------------------------------------------
. return to current directory
. -----------------------------------------------------------------------------
CD >NIL: <T:RECENT{$$} ?
.
. -----------------------------------------------------------------------------
. clean up the "mess"
. -----------------------------------------------------------------------------
DELETE >NIL: T:RECENT{$$}

This helper script has no help, i guess it's self explaining since it does nothing special i only posted it because i use it for almost all scripts to show a reference for them.

Almost ;) i had to do a last minute edit, XIcon which is otherwise a handy replacement for IconX can perform evil things which has happened right now, it seems it brute forces to end the task when More is cosed (for some other programs it does the same fault) which means that SOUND will hang without to play the sound, i don't have to tell you that it is not allowed to force a soundplayer to exit without to tell the handler that the sound has endet it will result in a crash. But i used XIcon to display the Help to have the help file named the same as the icon which will execute then showhelp instead of the script with the same name. I had two options a) to get rid of the SFX - nah i don't like b) rename the help file or the script to be executed by IconX, i decided to rename the help files which have now the suffix .ansi because they are ansi code foremost.

The only thing i have to add here is the used SFX and my "Manual" icon (might be someone will like it):
InType_SFX.zip
(4.18 KiB)
Where you stash the SFX won't matter much just don't forget to change the call for it to your location.
"Beep15" i already posted with "FloatDir" (previous first entry).
Manual.gif
Manual_info.zip
(831 Bytes)
EDIT: erased showhelp and put "FloatDir.ansi"(.zip) in the proper entry.

next...
Last edited by Gernot66 on Thu Aug 11, 2022 11:28 am, edited 3 times in total.

User avatar
Gernot66

Posted Thu Aug 11, 2022 9:10 am

Again a big hug for the dude who fixed the code box parsing, some might remember that i nearly lost my temper because i couldn't post scripts, sometimes it worked well sometimes it refused to accept them, why it wasn't clear to me anything i tried gave me different results.

Erm, yes you might have noticed that i use ". " (dot space) to comment out whole lines that is better as to use the semicolon which is meant for in-line commenting any ". comment" will be completely disregarded by execute like this line wouldn't exist it is what REM is for MS-DOS further this is more compatible with ARP Execute which doesn't likes the semicolon at start of a line. While it is exactly vice-versa for the startup-sequence (but not for sub-scripts executed by the startup-sequence), it seems to me the startup-sequence is executet by the OS-ROM and this small execute can't interprete the dot at start of a line (therefore you can use redirection in it without to define ".KEY" respectively even this is not to interprete by it since it is a dot command)

Amiga Love is a neat forum sure i even post on the "english amiga board" but it's not as pleasing as to post here.

---

I posted here in a different thread already that i miss a proggie like NSet for MS-DOS, it is a simple string parser or database utility, very simple yet powerful. If i would have this at hand i would implement the help to the script using i.e. ". ;;;" and then parsing the lines to a temp file or to PIPE: which will be displayed then by "showhelp". NSet is a powerful little command and allows to have all in a single script, sub-scripts you could even parse in this manner and you can have several scripts in a single file.

Really i would like if someone would code a NSet for the Amiga nothing fancy like "edit" or "bawk" which has so many options and commands that it is hard to understand the function of all of them, it's just a program to parse strings but it can perform a lot.
What i further miss for scripting on the Amiga is a FOR (not like the ARP FOR which is meant to run a program for multiple instances, first i thought "great a FOR" argh no just another "WITH" similar to the DPAT script) a C like FOR to create FOR loops because even this is small and powerful to create nice scripts.
If you would peep in my scripted geometry using LUA they are full of FOR loops. Splatter windows on a building? -> FOR DO -> bang. The use of FOR is near to infinite.
Sure there is a workaround for FOR, one can use EVAL to count the instances it has to do but i tried once and the resulting script was slow as a turtle.
I use such a sort of FOR loop in OS3.1 to parse palette values to use with a color-cycle script but this scripts needs 20 seconds to parse 16 palettes.

BTW, the color-cycle script is major to what i found for OS3.1 to do color cycles on the WB, it's overall a nice and good looking program but heck it leaks of the most important thing - the settings can't be run without to open the editor hmmm... i just wonder.... it makes it useless how much effort he ever put in all the rest but this leak makes it useless.
It's due to that a nice toy to play around with but little else, a less fancy surface but having this feature would be golden.
Also it seems to forget other needed settings - the range of colors you like to cycle as well as the cycle speed, thus it's just a toy - a half finished toy, you wouldn't really need the parametrical editor whichs settings are kept but dammit the rest i mentioned. However one can toss it, my script is slower but better and won't forget a tiny single bit (since it is a script). Yeah sometimes it fails but that is no surprise because it is a quite complex script set which first parses the needed palettes, then runs the cycling, then it splatters randomly an image on either the workbench or a pub screen which will be exchanged after a random time as well as the color-cycle itself is random in duration and direction. About five scripts which have to work together and pass arguments from one to the other obviousely it is a bit unstable.

One of the core scripts is "JukeBox" (or playlist like i named it for OS3 but "jukebox" covers better the function of it), it will pick a random line from a list and remove it from the list (temp list to keep the original untouched) after it reached the last line it will reload the original list and perform the next turn. Apart from this use it is a cool "jukebox" because it never will select twice the same line except the list has ended and all restarts from top. Just guess such a cool player like Delitracker won't handle a playlist like this and will often play the same module twice using "JukeBox" this won't happen.
The script i started as well for OS1.3 but it isn't finished yet you can imagine that it is quite harder under OS1.3 to let the script perform what i like.

But the real challange is OS1.3 you need to have a lot of good ideas to work around the limitations of it.

User avatar
Gernot66

Posted Thu Aug 11, 2022 12:55 pm

Short addition to all of that you ight have noticed that i displayed the icon using "ViewIcon". Ever wondered for what one can use this useless proggie? Well it's to view an icon (what else).
Yes usually it has little use, but guessed you have a script to create icons this else useless program becomes very useful.

I will leave now the scripting and stay a bit with icon creation (not to long).

The script i made to create icons from brushes is still unfinished (it's not as smoooth as i like to have it yet) and honestly i use "Doctor Icon" to create icons from DPaint created brushes. There is recently one single reason to use this script or a program named "Make Icon" (not to confuse with "IconMaker" which makes icons on the fly for files without icons it's a very good but rather old program) "MakeIcon" is in general exactly like my scripted version, select one or two brushes and click decide what type it should be and then write the icon to an unfortunately existing file (it needs at least a dummy file to save the icon for it). The single use for this is wIconify whichs helper tool "info2icon" to create C style like icons for wIconify to use will be confused by the output of the little more advanced "Doctor Icon" (while you can use Doctor to export an icon to "C"). Doctor writes down an own style of OS1.3 icons they are fullly compatible with OS1.3 but will confuse programs which interprete standard OS1.3 icons, because a) it saves only a single canvas for both images, very unlike "Icon Merge" or similar programs which all will keep both canvas of both source icons used, further it "compresses" the canvas to an instruction instead to write a felt million zeroes for nothing. OS1.3 shows and handles them without any drawback they are just slightly smaller as any else created icons. Doctor is in my opinion major to IE whichs drawback is that you can't frame-save an icon and it will always fill the right side of the icon with zeroes until it reached a by IE given with, that is not what one will really like. One use i had for IE, you can determine for a drawer the frame color and if needed blank the window frame out except of its corners, this became handy for me for a special "Space1889" Workbench which displays a sort of steam-punk ship interior and the icons to start "1889" and to open the notepad for a sort of log or to show the copy-protection code and to show recently only two maps of the game "Mars" and "Venus" (Mercury and Earth i lost over all the decades), further some useless pictures from the manual. Instead to show the images on an own screeen it uses WBPic and exchanges the complete ship interior though it will look like all would be displayed on the big main screen of the vessel, the HAL operating system (shell) is as well fit to the screen size and borderless displayed.
"Displaying.... Map.... of Marrrs.... please wait"

wIconify i won't present here and neither in "0x05A" i will open an own thread for this powerful OS1.3 enhancer.

But quite soon my "Zap-Icon" script (Zap-Icon because EA's ZapIcon is the main part of it was often renamed and distributed as whatsoever but it is always the same ZapIcon from the EA IFF resource).
Zap-Icon makes use of ZapIcon :), Filerequester, Batchrequester (a simple requestchoice), Lift (to lift respectively drop down the text), Icontype (which can hang under OS1.3, runback or run <nil: >nil: will help) and the mentioned ViewIcon.
I found even a program on a fish disk to display a brush in such a tiny WB window but it has dived deep into the mass of downloaded fishes. But it isn't really needed to display the chosen brush before the icon is created you still can return and select a different brush if it's not the one you like.
template80x40.png
If you use DPaint to create the brushes a tempate like the above becomes useful, you can start DPaint with this image and have a template for all of your icon-brushes what else you like to put on it is your choice this is just a suggestion but feel free to use this image. Convert it to .iff using either XnView or GIMP, the GIMP iff exporter is better since it keeps the bitplane rule (2,4,8,16,32,64,128,256 colors) while XnView will always write a 8 bitplane iff (256 colors).

Or well download this zip
template80x40_iff.zip
(417 Bytes)
"What the heck is this orange field for?"
It is to check the size of the cut brush, if method is set to "opaque" you will see quite well if the brush leaps over its frame.

"Desktop, what desktop?"
It's just a by me often used text to put on special icons, in fact especially for my music directory which contains...
music :) Modules, MIDI, 8SVX and so on, each "Album" has an own desktop backdrop image mostly the album cover (sorta) to differ the single titles from the seperate to display backdrop i write "DESKTOP" over this special icon.
But see this also as a suggestion you can put a range of template snippets on this template canvas.
Each Song will display as well either the album cover or a random selected backdrop with one little difference;
Backdrops which are displayed by a tune will be replaced after playback with what you set as backdrop image (from ENV respectively ENVARC which i even use in OS1.3, you will see later why repectively this is part of the reason why).
The separate Album cover backdrop will stay permanently like the ones in the drawer(s) "Desktop/..." based on what you select "keep backdrop? yes/no".
If "Keep" is selected the backdrop scrpt(li) will be written to ENVARC: else it stays only in ENV: and vanishes at least at next reset, if it stays in ENVARC of course it will be displayed after next boot up (depending on your preference setting for backdrops "random or reload @boot"). The WB palettes which are independent to the images (while there are some which have an own set of palettes) will replace the SETCOLOR line in the backdrop script (quasi a preset) and won't stay permanently, this only manipulates the script in ENV:. Almost as cool as "WBPattern" in OS3.x - in fact even better as :) sounds more complicated as it is (dammit Gernot it was complicated to figure out and script all that turd it's just simple to use).
Tunes can have color-cycled (i chose "XTC" as suffix and sort for them, no it's of course not what you guess ;) it means XTra Colorcycle) backdrops, yes only the rotten four colors but depending on the image this is quite cool.

End of - no not transmission, end of backdrops and stuff this belongs to "0x05A".
Further the whole backdrop/desktop thingy is still under construction since it went through a massive change, most of what i posted above is brand new and the random selection of backdrops isn't set up proper yet respectively is broken because it's a remnant from my former setup for WB backdrops.

User avatar
Gernot66

Posted Thu Aug 11, 2022 1:59 pm

Minimalism

Are you aware that you can simply pass any string to the virtual device SPEAK: ?
Following will report if a shell window is closed

ENDCLI >SPEAK:

Maximalism
Overall not bad but the SPEAK device can't be altered to use a different pitch or speed and i like a female miggy since machines and computers are female.
It is somewhat complicated to pass the stdout of endcli to "Say" (you need to concat the strings) but it works well and will sound then like what you hear in the first part of this short clip, the second part shows the simple redirection to SPEAK: i have to use a copy of endcli (named endcli2) because "endcli" i have set as an alias in the shell-startup to let the miggy babble even if i type endcli in the shell (otherwise "off").

But well i wasn't satisfied with the ouput of "Say" and converted output of "Say" using "Say2RAW" to a set of snippets, numbers from "one" to "thirty two" (that shuld be enough to cover the amount of opened shells), "exit.", "process number", "amiga os. ready.". the snippets will be played back using SOUND and it leaves the possibility to me to lower the volume of it since my SFX are all not at maximum loudness (32 of 64 which isn't really half the volume is to imagine logarithmic and not linear) and the output of "Say" is simply to loud compared to my SFX.
Thus my shell opens with a female voice "amiga os - ready!" and exits with "process number # - exit!"
As a little extra i showed off how wIconfy opens a public screen for me set to the old style light green on black on a 1 bitplane screen which is very fast. Some might like a productivity screen or med-res, all is possible.

User avatar
Gernot66

Posted Thu Aug 11, 2022 2:25 pm

C'mon say "that is cool!" because it's really cool to have a shell on a own screen where you can work in without to be interfered by the mess on the WB, especially for OS1.3 where it is quite hard to find something like that.
Old dudes like me with a limited eye-sight will like a med-res or productivity screen and a brittle font like my GROM font.
Cough "my" it is not mine and it would be still copyrighted, it belongs to Intellivision resp. "Intelligentvision" the recent company. Since it is a blatant ripp of the GROM content using the tools of "SDK-1600" (Joe zbiciak) i'm not allowed to publish it one would have to do the ripp himself and create the font using the OS1.3 "FEd (i already leaned far out of the window by posting the character set, still this must be hand designed using "FEd").

What i could publish is joe's SDK-1600 font which is close to but not exactly like the GROM font.
I will see in future what i can get out of the "Vectron" font and "TRON SolarSailer" font (both sci-fi style).
Since they are all 8 pixels high and 8 pixels wide they are ideal to be used in OS1.3 as a fixed width font.

ATARI Breakout clone ("Brickout" - unreleased due to copyright issues - copyright issues? a battle was the so called video game wars)
Just to show the "Vectron" font which i used for this hack of "Brickout".
(Yeah i know this dude should be able to code his own "NSet" or whatsoever - not really i'm not much further coding in assembler as to pop up a "hello world" but it's a start).

"Yer out!" the unique SFX of "Intellivision Baseball - much more like Baseball" a spoken word without Intellivoice or anything like it, just a couple of instructions for the synthesizer.
OK, to be honest it rather sounds like a Bud-Frog.

FYI, or for those who aren't comfortable with this old console, it could have been and it is in a further sense the predecessor to the Amiga. The first Two releases "Intellivision" and "Intellivision II" used the 16bit processor GI1610 (which accepts so called decles, ten bit instructions). But the developers of the hardware was up to use the brand new and super hot M68000, all the dreams have been destroyed by the video game wars and a wrong business strategy.
For those who love the Inty it is no question it was and still is the best game console :)

User avatar
Gernot66

Posted Thu Aug 11, 2022 5:47 pm

Let's peep into the scripts i use to playback 8SVX or MIDI, i guess the MIDI player is of more interest, i use for OS1.3 obviuosely Bill Barton's midi.library and as well his limited Player (maybe one has a suggestion for a better MIDI player, the main drawback is for me that it can only buffer 32kB, this makes it unsuitable for some game MIDI files especially if you like to control an MT-32, or virtual MT (Munt) in my case. Certain parts of the limitations are rooted in Windows and are only to bypass if one would implement Munt (and as well Fluidsynth) in the Emulator like it is done for "DOS-Box ECE". That is to explain this a bit further the problem that Windows since Win10 swallows blatantly the sysex instructions and it is not longer possible to proper program an MT-32, the problem appears even with Munt itself as standalone application. An implementation would bypass this problem since the virtual synthesizer will be controlled from the emulator and the data stream won't be passed to windoze.
A second possibility is instead to send the sysex command in advance to the synth to put the sysex on top of each file, if that is a SMF (by which i mean a standard MIDI file respecting the MT standard and not a GM compatible MIDI, they differ a lot in the instrument set and any SMF will sound wrong on a GM device and vice versa, later more to this) it won't be no big deal since they often use only a short sysex if at all and the filesize usually is far under 32kB. BUT if you like to playback a GM on the MT device you need to reprogram the whole synthesizer and this sysex is already almost 32kB! in size. One could make it smaller by stripping out all the unused instruments for this track, but this isn't as easy as it sounds, it's easy to recognize the instruments but the programming itself follows as a long set of gibberish and it's nearly impossible to find out which belongs to what or would need a big effort to do so.
However i usually worked around this somewhat new nuisance by putting simply the whole "GM@MT" sysex on top of each file because this won't be swallowed by windoze, but this method blows i.e. a 8kB MIDI up to more as 32kB!

Yes of course i usually play back the game midi from DOS games in DOS-Box, this has another reason which would be an idea for a better MIDI player for the Amiga which will respect the famous Miles sound and its specialities. Miles MIDI which was the top notch thing between '90 and 93 aren't just "simple MIDI" streams, they are and they aren't. They make very often use of a so called "FAT" which is a kind of instrument library and can also program an MT or SoundCanvas device, so we have the use of sysex to program the device and additionally the FAT which is essential for OPL and AdLib playback and sometimes used for the MT-32 specific files. The FAT has an influence on the sound that's why i wrote "is and isn't simply the same". From now on i calll it SMF, while i noticed that it is often used in a wrong consense in Amiga forums, SMF would only cover MT specific files and has ittle to do with if it's a MIDI type 0 or 1 and it can never be a GM/GS compatible, really not you can program the instruments of an MT but there is no way to program a GM/GS device except for reverb and echo, this would need a rearrangement of the instruments in the file if that is at all possible because jsut as example the MT has "strings 1-3" the GM only "strings 1&2" just as one example of many differences, they are not only on different registers the whole set differs and if a SMF uses strings3 there is no way to reproduce this proper with "strings1 or strings2" on a GM compatible device, sure it will be "strings" just not "strings3".
Some instruments and especially SFX differ also completely here as example the "bird tweet" for a GM it is a premade sound of "bird tweet" which "tweets" already only if called while the MT only produces a single "bleep" with the same instruction.

As i said i usually play the DOS games MIDI using "DOS-Box ECE" and "Bristlehogs PX" which is a port of the "Miles XP" player. I sounds fantastic imho especially i like the very saturated sound of the MT it something complete different even to the best set of insruments available for soft-synthesizers (sorta waveblaster if you like though, GUS was the pretty first and it still sounds good to me). It a fresh clean synthesized wave maybe that is already the difference.
But i would like to play them back on an Amiga emulated or in future with my still existing hardware (A500, A4000).
And here is the problem, Bill's player or the library i'm not sure which limits it to 32kB and formost the leak of regarding the FAT because this will stay for all Amiga OS' and makes it impossible to proper playback in example the SMF of BARIS (Buzz Aldrins race into Space) they need the FAT to be played back, XP (or PX) willl refuse to play them without the FAT, sure you can play it back on a Miggy but the result is simply wrong.
I know for higher revison there are better libraries out there but still any will disregard the Miles sound specific FAT.

Why all this mess?
I would like to see a port of "Bristlehog's PX" for the Amiga, that's all.


And yes i would ike to get around the 32kB limitation for OS1.3.
See i like the MIDI stuff,

Ever heard a DOOM II MIDI in this quality?
OK i cheated for the clips, this is a mix of both Munt and Fluidsynth using the "FatBoy" soundfont.
But it is almost as played by humans isn't it?
I mean you can almost hear the rosin on the bow.
That is what Miles sound can do to a MIDI!
"It is the same yet it isn't"
Sure "Fatboy" is the best soundfont no question and the underlayed Munt output enhances all additionally, makes it wider and more saturated, adds a little "life" to it even if pure synthetic.
Also i have to admit that Bobby Prince is a brilliant composer, even the short and stumped down AdLib files (.imf) for "Commander Keen" show off his capabilities when simply converted to a MIDI (with a little bit arrangement experience by me).

But i liked to post a script here and not to write an essay about "Miles Sound".
It was just to explain a little what my problem is with MIDI on the Miggy.

I really could make use of a little help for Bill Barton's player/library, it has a set of accompaining tools which i do not all understand proper and formost i would like to know if it is possible or how it is possibe to control the player i.e. to do something simple as to loop a MIDI. Recently i can only play the MIDI back a single time and have to shut down the player manually after playback, it's not what one will like. But i know that it can be controlled therefore the player stays open after playback. On the other hand i see his player and tools similar to the Miles distribution they are examples and no end user programs, Miles intentionally is meant to be implenented in a game and not as standalone player, only Bristlehog made an end user player of the distro, similar i see the accompaining tools to the midi.library rather as examples.

However it is the only one i found which works well in OS1.3.
Finally to the script which is as well a sort of "scripting example".

Again i will list as first which program(s) i used to make the player script.
- PLAYMF (by Bill Barton and of course his midi.library)
Anyting else is standard OS1.3 content


It looks like i have to pause here it has getting quite late - or early in the morning.

User avatar
Gernot66

Posted Thu Aug 11, 2022 6:29 pm

Before i can post the player scripts i have to post this little helper script

GETSCREENMODE

Code: Select all

.KEY VERBOSE/S
.BRA {
.KET }
.
TYPE DEVS:System-Configuration TO T:tmp{$$} HEX
D:SPLIT >NIL: T:tmp{$$} ENV:TEST{$$} 709 1
IF $TEST{$$} GT 0
   SETENV SCREENMODE HRI
ELSE
   SETENV SCREENMODE HR
ENDIF
DELETE >NIL: ENV:TEST{$$} T:tmp{$$}
IF {VERBOSE} EQ VERBOSE
   IF $SCREENMODE EQ HRI
      ECHO "Interlace ON"
   ENDIF
   IF $SCREENMODE EQ HR
      ECHO "Interlace OFF"
   ENDIF
ENDIF

This helper script is executed at boot up
It doesn't needs to be commented because it's obvious what it performs, it writes the system-configuration to a text file using TYPE HEX, then it splits this file at the "address" where the value for interlaced mode is stored, and keeps only this single number, after that it compares the value to zero IF GT 0 screenmode is interlaced.
Store this in ENV:SCREENMODE as HRI for hi-res interlaced or HR for hi-res non interlaced this covers my two directories for either laced or non laced resolution images. Thus no matter if i set the Amiga to Interlaced or not WBPIC will display the proper pictures after next boot up.
GETSCREENMODE resides as well in Prefs to report what screenmode is set if that has changed for this is the switch VERBOSE.

I don't have to point out that this would be another use for a simple string parser like NSet.

User avatar
Gernot66

Posted Fri Aug 12, 2022 7:15 am

Looks like i have to delay the PlayMIDI script for a week since it needs a complete overhaul and since i have no own web access (poor dude ya know) it will take a few days before i return.

But i stumbled over this thing as i posted a screenshot
035.png
Last saved?
Assumed you have a game which you play from time to time but not weekly you might have forgot what your last savestate was, sure you can examine the folder and check which is the latest state.
But why not automate this?

"Last Saved" (until i have this only for CC2 but other will follow it's a very simple script)
a large section of this script is only an eyecandy, it's just to have in the titlebar of More not the fulll path of the file and instead to show the string "Info: " not really needed but...

Code: Select all

.KEY ""
.
. ---------------------------------------------------------------------
. the usual bleep
. ---------------------------------------------------------------------
RUN >NIL: D:SOUND SFX:beep/beep13 Q D V32
.
. ---------------------------------------------------------------------
. fancy stuff
. create a temporary directory in RAM and assign it to "Info:"
. ---------------------------------------------------------------------
MAKEDIR >NIL: RAM:X
ASSIGN >NIL: Info: RAM:X
.
. ---------------------------------------------------------------------
. program
. list files using ARP LIST of specified directory to a temp file
. it will list the directory by date with the newest on top of it
. ---------------------------------------------------------------------
D:LIST CC2_V11/save PAT ~(#?.map) SORT DATES QUICK TO T:TMP<$$>A
.
. ---------------------------------------------------------------------
. program
. extract first line using edit, i often use this a bit uncommon manner
. "EDIT >C A WITH B TO NIL:"
. because this leaves the source untouched but an output using TO
. will alter the source, not it's content if you use T for test
. but it's examined and written back in this manner, Notepad++
. i.e. will then argue "file has changed, reload?" due to the
. write back it alters the date of the source. stdout and TO NIL:
. won't write back to the source. Practically there is no real
. difference but unaltered is unaltered, basta. Erm perhaps it could
. be even a tiny bit faster in this manner since it won't write back
. and only reads to stdout
. it is in this case really not needed since the source is a temp list
. but it's a good example to show how you can leave the source untouched
. ---------------------------------------------------------------------
ECHO >T:TMP<$$>COM "M2 T1"
EDIT >T:TMP<$$>B T:TMP<$$>A WITH T:TMP<$$>COM NIL:
.
. ---------------------------------------------------------------------
. i only need the name of the savestate but List without a formatting
. of the output will export as well the date which i don't need to see
. thus split the string to extrat only the "name"
. this is set to 16 characters width which should be enough to cover
. a savestate name, since i use only a number far less would
. be as good as but 16 is fine for the size of the output window
. depending on what game and how long a savestate name can be 
. this would differ
. if you would have different savestates for differing hardness of the
. game you will give it mst probably a to this relevant name like
. suicide## or easy##, 16 characters are really enough for most
. the window for IconX is obviousely a RAW for a message but any is as
. good as.
. WINDOW=RAW:0/12/256/64/Info: /dsz 
. (dsz is conman specific nodrag, nosize, option z (system font topaz)
. note that the title is the same as the assigned "device:file"
. ---------------------------------------------------------------------
D:SPLIT >NIL: T:TMP<$$>B T:TMP<$$>C 0 16
.
. ---------------------------------------------------------------------
. program
. set up a nice message and concatenate the result of SPLIT to it
.
. fancy stuff
. concatenate file " " in "Info:"
. ---------------------------------------------------------------------
ECHO >"Info: " "*E[0;42;33m*E[J*NLast saved game: *E[31m" NOLINE
TYPE >>"Info: " T:TMP<$$>C
.
. ---------------------------------------------------------------------
. program / fancy stuff
. Display the turd using More in in black contrasting window 
. ---------------------------------------------------------------------
SYS:Utilities/More "Info: "
.
. ---------------------------------------------------------------------
. program / fancy stuff
. play the common end/cancel SFX remove assignment and delete the turd
. ---------------------------------------------------------------------
RUN >NIL: D:SOUND SFX:beep/beep15 Q D V32
ASSIGN >NIL: REMOVE Info:
DELETE >NIL: T:TMP<$$>#? RAM:X ALL
.
. ---------------------------------------------------------------------
. get happy
. ---------------------------------------------------------------------


Variation using QUICKREQ instead of MORE
036.png

Code: Select all

.KEY ""
.
. -----------------------------------------------------------------------------
. variation using "QuickReq" v2.0 1991 by Markus Aalto
. -----------------------------------------------------------------------------
RUN >NIL: D:SOUND SFX:beep/beep13 Q D V32
D:LIST CC2_V11/save PAT ~(#?.map) SORT DATES QUICK TO T:TMP<$$>A
ECHO >T:TMP<$$>COM "M2 T1"
EDIT >T:TMP<$$>B T:TMP<$$>A WITH T:TMP<$$>COM NIL:
D:SPLIT >NIL: T:TMP<$$>B T:TMP<$$>C 0 16
.
. -----------------------------------------------------------------------------
. concat string for use with QuickReq, this proggy has the neat feature to read
. the message text and the options from a specified file
. -----------------------------------------------------------------------------
ECHO >T:TMP<$$>A "*"Last saved game: " NOLINE
ECHO >T:TMP<$$>B "*" *" OK *" -C -P2"
JOIN T:TMP<$$>A T:TMP<$$>C T:TMP<$$>B TO T:TMP<$$>D
.
. -----------------------------------------------------------------------------
. run QuickReq using the string
. -----------------------------------------------------------------------------
D:QUICKREQ T:TMP<$$>D
.
. -----------------------------------------------------------------------------
. do the usual end script stuff
. -----------------------------------------------------------------------------
RUN >NIL: D:SOUND SFX:voice/ja Q D V32
DELETE >NIL: T:TMP<$$>#?


Have a relaxing weekend

In a third thread i will offer the games additions i made over the years i guess some can be of interest.
For CCII i made a set of 100 planets instead of the standard 40 which will give you far more variations of the game, some planets are naked moons with no food resources and either some metal or absolutely nothing on it, latter are suitable for the single player enemy the "Mechs" but unsuitable for human colonies, therefore some dwell of food but have little to no mineral or metal resources.
CCII i crammed on a single floppy with as much as possible of my additions (i used PP for this).
I also did the tedious work to make screenshots of all planets to examine them even if that isn't of need.
The "Appendix" holds instructions how to create planets without the editor and what tiles are unused by the editor or game but possible to have in the game. This is the oldest addition since i edited the planets decades ago when i had no editor at hand.

User avatar
Gernot66

Posted Fri Oct 14, 2022 8:56 am

Here we go, it was a mean little error i didn't noticed yesterday even if i ran the script several times for the cases "file instead dir" "dir contains no icons" and "dir ok". A shitty slash where no slash should have been but that is something you always have to take care of if you have to concentuate strings the result can contain errors which you don't notice except you type out the final string.
I'm aware that i posted a clip of that already but the script has changed since mostly i started to use a own error RC which i can use specifically for the scripts - which i now again start to remove from scripts where it has little use, but it's useful if you have a script that should return a certain state of something, like the two i outsourced from "FloatDir", one checks if a the selected icon is really a directory (it doesn't checks the icon it checks if it's a filename) the other checks if the selected directory contains any icons both return 5 (while that could be anything a "shithappens" would do it as well) if it's not true.
This i can use in the main script, in fact both will either do this silent, by returning a string or by opening a requester and also the used SFX can be muted or specified or one can use the default SFX i planned to use the sub-scripts maybe for other scripts as well that's why i keep them this flexible.
You might wonder why i define (definitions grow it's handy for repetive commands) the "SRC" with "ECHO >ENV:SRC NOLINE " instead of using SETENV, the reason is that i encountered problems with SETENV, SETENV won't wait for SETENV that means if it happens that two SETENV are processed at the same time one will fail, ECHO always waits for ECHO to finish and this will never happen in this manner (no i had no idea this happened several times until i noticed that SETENV won't wait for SETENV to finish). As you can see the follwing script returns no "SRC", it has but it's not useful, if something fails you will examine the script and won't even take a brief look at the SRC, usually i place a "echo foo" where i guess the error has happened and see if the script hangs before or after "foo" if i nailed the spot i type out the strings or results. Thus i use the script return code now only for such sub scripts or a script like the filerequester companion which will return a the same "5" when you selected cancel, to break the process using QUIT and an RC isn't wise as i found out since QUIT terminates anything and will leave most probably all varaibles in T: and ENV: instead of beeing deleted whe the script ends (yes sure one could delete them in advance of a QUIT, five times the same turd? nah! And how to delete a variable with a different process number without to pass the starting process number to the sub script? Nope, return to the main script and end the processing here)
Further i use now a version number for my scripts this is less of interest for myself as for the scripts i post, instead of using a common version number i have this weird manner to use a date string like 20221014 to me that makes far more sense as something like v0.1, we used such a numbering in industry and i think it's very handy since the year leads the month and the month leads the day the numbering is continous, clear and unique. This would leave the option for my "Ed" script (yes i use rotten Ed - i'm used to, mainly because it makes me crazy that i can type only 80 chars in MEMACS or similar and have to break the line, one i try out now is "HED" it's rather a programmers editor and fully configurable even the menu but foremost i can type the full 256 chars per line) to update the version number automated, it already creates the tiny icons you see in my "S" directory based on the file protection which i split to SRWD for scripts, RWED for projects and RWD for plain ASCII a doc file or a config file in example, for this i digged out "JMENU" it's the only i found which allows me to have more as just two or four choices, for JMENU you can have choices as much as can be placed on the screen. As a final option you can even set a specific own protection it will ask then to enter the protection bits. Further (but that's rather useless) it adds a filecomment based on the selected protection "script", "project", "ASCII" or "defined". Of course only for new files an icon will be created and you will be asked if at all (for this i simply compare a list output of the file if the file hasn't existed before it's a new file if the output of list has changed in any manner the file has been changed, it has never failed so far).

Meanwhile (since my last posts) i started to use "SIGNAL" and its companion "WAITFOR" they are handy to halt a script which was started with "RUN EXECUTE" which will be the case if you need to skip over an execute which else won't work.
But it seems (i'm not yet sure) it leaks a bit and gets confused if multiple instances of "WAITFOR" are running and i had the impression that it forgoes or misinterpretes an attached process number which would make the name for the WAITFOR variable unique. Thus i tossed that and mostly depend on "BREAK <$$> C" and pass the process number to the script either with a final ECHO >>T:whatsoever "BREAK <$$> C" or i already used a keyword CLI which expects a process number to use for BREAK. The WAIT command one likes to make to a definition which is .DEF WAIT "FAILAT 11*NWAIT #SECONDS*NFAILAT 10", the use of BREAK doesn't fails and if it fails you typed in something wrong and it's unique since it expects a unique process number. At start i thought "WAITFOR" should have been part of the OS but recently i didn't think so because i encountered problems with it, BREAK in combination with WAIT is better.

The script contains a "QUIET" keyword i had the idea to use "FloatDir" as companion to "SortIcons" but right today i tossed this idea because this would hinder me from the above described method to float and sort only a section of the directory. This QUIET doesn't only suppresses the SFX it supresses all output but it has become depracted exactly when i wrote this post.

The script isn't in its final state, i removed the requester as i said and therefore it should spit out a short help if called without a PATH argument. As i said this help isn't ready yet mainly since i'm not sure if i like to use a requester, that is neat as well, or my own help script which will open the help in More in an attentive orange bordered window.

Code: Select all

.KEY DIR,QUIET/S,WARN
.BRA {
.KET }
.DEF WARN "D:SOUND SFX:BARIS/WeAreNogo Q D V24"
.
. --------------------------------------------------------------------------
. $VER.FLOATDIR20221013
. floats all icons in a directory
. --------------------------------------------------------------------------
.
CLS
ECHO "*E[42;33m*E[H*E[J" NOLINE
.
IF "{DIR}" EQ "H"
  RUN >NIL: EXECUTE S:SHOWHELP FloatDir
  WAIT
  ENDCLI >NIL:
ENDIF
.
. --------------------------------------------------------------------------
. if [DIR] is "" call filerequester else add "/" to [DIR] if it's no device
. --------------------------------------------------------------------------
ECHO >ENV:SRC NOLINE
IF "{DIR}" EQ ""
  EXECUTE S:REQFILE "Select directory (no file!)" RAM: OUT T:FD{$$}DIR
  IF VAL $SRC GE 5
    DELETE >NIL T:FD{$$}DIR
    ENDCLI >NIL:
  ENDIF
ELSE
  EXECUTE ENV:SYS/SFX.IN NORUN
  ECHO >T:FD{$$}A "{DIR}/" NOLINE
  SEARCH >NIL: T:FD{$$}A :/
  IF NOT WARN
    D:REPSTRING >NIL: T:FD{$$}A T:FD{$$}DIR :/ :
  ELSE
    COPY T:FD{$$}A T:FD{$$}DIR
  ENDIF
ENDIF
.
IF NOT {QUIET} EQ QUIET
  ECHO "Checking selected directory"            
  D:SOUND SFX:BARIS/StatusCheck Q D V24
ENDIF
.
. --------------------------------------------------------------------------
. check if [DIR] is no filename
. --------------------------------------------------------------------------
ECHO >T:FD{$$}A "EXECUTE S:checkdir *"" NOLINE
D:FILTER >>T:FD{$$}A T:FD{$$}DIR
IF {QUIET} EQ QUIET
  ECHO >>T:FD{$$}A "*" QUIET"
ELSE
  ECHO >>T:FD{$$}A "*" SFX *"{WARN}*""
ENDIF
EXECUTE T:FD{$$}A
IF $SRC GE 5
  DELETE >NIL: T:FD{$$}#?
  WAIT
  ENDCLI >NIL:
ENDIF
.
. --------------------------------------------------------------------------
. check if [DIR] contains icons
. --------------------------------------------------------------------------
ECHO >T:FD{$$}A "EXECUTE S:checkicon *"" NOLINE
D:FILTER >>T:FD{$$}A T:FD{$$}DIR
IF {QUIET} EQ QUIET
  ECHO >>T:FD{$$}A "*" QUIET"
ELSE
  ECHO >>T:FD{$$}A "*" SFX *"{WARN}*""
ENDIF
EXECUTE T:FD{$$}A
IF $SRC GE 5
  DELETE >NIL: T:FD{$$}#?
  WAIT
  ENDCLI >NIL:
ENDIF
.
RUN >NIL: D:SOUND SFX:BARIS/AllSystemsAreGo Q D V24
ECHO "Directory OK, processing list - please wait"
.
. --------------------------------------------------------------------------
. create script for noiconpos, remove suffix .info and execute the script
. --------------------------------------------------------------------------
ECHO >T:FD{$$}D "" NOLINE
ECHO >T:FD{$$}A "D:LIST *"" NOLINE
D:FILTER >>T:FD{$$}A T:FD{$$}DIR
ECHO >>T:FD{$$}A "#?.info*" PAT ~(.info) SORT LFORMAT *"SYS:Tools/NOICONPOS >>T:FD{$$}D ***"%S%S***"*" TO T:FD{$$}B"
EXECUTE T:FD{$$}A
.
D:REPSTRING >NIL: T:FD{$$}B T:FD{$$}C .info" ""
EXECUTE T:FD{$$}C
.
. --------------------------------------------------------------------------
. get rid of noiconpos copyright notice and type noiconpos output
. --------------------------------------------------------------------------
ECHO >T:FD{$$}A "D:SOUND SFX:BARIS/liftoff Q D V24*NBREAK {$$} C"
RUN >NIL: EXECUTE T:FD{$$}A
ECHO >T:FD{$$}COM "0(F /noiconpos/; D; N)"
EDIT T:FD{$$}D WITH T:FD{$$}COM OPT P255W255 TO T:FD{$$}E
CLS
TYPE T:FD{$$}E
FAILAT 11
WAIT >NIL: 300
FAILAT 10
.
EXECUTE ENV:SYS/SFX.OUT NORUN
.
DELETE >NIL: T:FD{$$}#? ENV:FD{$$}

The two companion scripts i outsourced from this

Code: Select all

.KEY PATH/A,SETSRC,SFX/K,REQ/S,QUIET/S
.DEF SETSRC "ECHO >ENV:SRC NOLINE "
.DEF SFX "EXECUTE ENV:SYS/SFX.WARN"
.
. --------------------------------------------------------------------------
. $VER.CHECKDIR20221013
. checks if [PATH] is a directory, returns SRC 5 if false
. --------------------------------------------------------------------------
.
<SETSRC> 20
.
LIST >NIL: "<PATH>" DIRS TO ENV:CHKDIR<$$>
IF "$CHKDIR<$$>" EQ ""
  <SETSRC> 5
  IF NOT <QUIET> EQ QUIET
    IF <REQ> EQ REQ
      <SFX>
      ECHO >T:CHKDIR<$$> ""*<PATH> is a file!\\Please select a drawer*" *" OK *" -C -P3"
      D:QUICKREQ T:CHKDIR<$$>
      EXECUTE ENV:SYS/SFX.TIC NORUN
    ELSE
      ECHO "*"<PATH>*" is a file!*N*NPlease select a drawer."
      <SFX>
    ENDIF
  ENDIF
ELSE
  <SETSRC>
ENDIF
.
DELETE >NIL: ENV:CHKDIR<$$> T:CHKDIR<$$>

Code: Select all

.KEY PATH/A,SETSRC,SFX/K,REQ/S,QUIET/S
.DEF SETSRC "ECHO >ENV:SRC NOLINE "
.DEF SFX "EXECUTE ENV:SYS/SFX.WARN"
.
. --------------------------------------------------------------------------
. $VER.CHECKICON20221013
. checks if [PATH] contains icons, returns SRC 5 if false
. --------------------------------------------------------------------------
.
<SETSRC> 20
.
D:LIST >NIL: "<PATH>#?.info" PAT ~(.info) LFORMAT %S TO ENV:CHKICO<$$>
IF "$CHKICO<$$>" EQ ""
  <SETSRC> 5
  IF NOT <QUIET> EQ QUIET
    IF <REQ> EQ REQ
      <SFX>
      ECHO >T:CHKICO<$$> "*"<PATH> contains no icons!*" *" OK *" -C -P3"
      D:QUICKREQ T:CHKICO<$$>
      EXECUTE ENV:SYS/SFX.TIC NORUN
    ELSE
      ECHO "*"<PATH>*" contains no icons!"
      <SFX>
    ENDIF
  ENDIF
ELSE
  <SETSRC>
ENDIF
.
DELETE >NIL: T:CHKICO<$$>#? ENV:CHKICO<$$>

The SETSRC 20 at start is a remnant of my former idea, it has little use but however if that script would terminate it would inform the invoking script the same way as the returned 5 would since i compare it with "greater-equal to" it would leave the option to perform a different action as if it returns 5. If you use such a return code it's wise to place the highest return code at top of the script and then lower it gradually. But as i said it has made little use to me except to return a falsification.

The SFX (invoking scripts) doesn't need to reside in ENV:SYS in all my use of ENV: is a bit uncommon for 1.3 and somewhat a take over from OS3. It contains a sub-dir SYS where i place the default icons (only the tiny ones) and my own preferences such as the fonts (whenever i like or need to reset them) or preset ECHO routines to create colored windows - even randomly if one likes that, preferences for wIconify to enable or disable it at start, preferences for the "desktop imaginery" if it should re-use or randomize a backdrop (preset, if none it will use none). In ENV (respectively ENVARC) itself i only store variables which will be changed during a session i.e. the screen mode i determine at start of a session or the palette(s) for the backdrops (Palettes... s, because one is a list or a single palette to use specifically for this image, the other is the palette i can manipulate with the "Prefs/colors" scripts. The Use of ENVARC allows me to have certain variables which will be reset at start while ENV obviousely only contains then variables to use per session.
Like i said icons and the SFX scripts doesn't have to reside in ENV:SYS but it neither is any problem if. It allows me to use a certain palette only for the recent session i.e. or one could alter the default icons for a single session and such.





Return to “Software”