Short: Timer controled random WBPattern change Author: RhoSigma, Roland Heyder (Germany) Uploader: Roland Heyder Type: util/wb Version: 5.300 (28.11.05) Requires: util/libs/ExtraLib.lha Architecture: m68k-amigaos >= 2.0.4 english: ¯¯¯¯¯¯¯¯ This small CLI-Program changes the file-entries within 'WBPattern.prefs' in the 'ENV:sys' directory every given period of time. This automaticly forces 'IPrefs' to refresh the WB to use the new pictures as background. Installation: ¯¯¯¯¯¯¯¯¯¯¯¯¯ - Copy the program 'RandomWBPatt' to C: (SYS:c) - Create the following files: 'SYS:Prefs/Presets/RndPattFiles-WB' 'SYS:Prefs/Presets/RndPattFiles-WIN' These files should contain a listing of all Image-Files (incl. Paths) which you decide to use as backgrounds for either Workbench and Windows exclusiv. So Images listed in 'RndPattFiles-WB' will never appear in Windows and vice versa Images within 'RndPattFiles-WIN' will never appear on Workbench screen. In the very first line of these files you must place the number of files listed within the file. Take a look to the supplied sample files, if you are not sure about these files format. Before the very first start of 'RandomWBPatt' you MUST use the WBPattern preferences editor to set and save your preferred settings, especially if you are running OS3.5 or better, you have some quality settings etc.. Also you should set the type setting to 'Picture' for Workbench/Windows single or both (according to your intended use of 'RandomWBPatt' for changing both, WB only or WIN only (see below)). If any ONLY option is used, the other part WB/WIN is completely unaffected, means it can also be 'Pattern' instead of 'Picture'. If the type is 'Pattern', and 'RandomWBPatt' have to change the type later to 'Picture' it will always use default settings for quality settings under OS3.5 or better, because it must be compatible to OS3.0 and OS3.1. That's why you should first use WBPattern to activate pictures and set the quality, so 'RandomWBPatt' can stay with these settings without the need to change anything. - Remember you can only use Images you have a DataType for. Usage: ¯¯¯¯¯¯ Use from CLI only !! RandomWBPatt ONCE/S WBONLY/S WINONLY/S TIMER/K PEN/K ONCE - Set just one time new backgrounds and then quit immediatly WBONLY - Change only Workbench-Background WINONLY - Change only Windows-Background TIMER - followed by a max. 4-digit number, which gives the period of time in minutes, after every time it is elapsed the new background is set PEN - followed by a max. 3-digit number in the range 0-255, which specifies the color used for outputs (see Notes) - If specified both, ONCE and TIMER, ONCE has higher priority !! - If specified both, WBONLY and WINONLY, WBONLY has higher priority !! - If specified no ONLY-Option, then both backgrounds are affected. - If no Option is given, the defaults used are TIMER=30 PEN=3 - If you don't use ONCE, use 'Run >NIL: RandomWBPatt Options', e.g. if you start the program within 'S:User-Startup'. - you may quit the program using the CLI-Command 'Break' by sending a CTRL-C to it, the program then quits within the next minute - you also can send a CTRL-F, which forces RandomWBPatt to break its time cycle and load a new background immediatly (well, within the next minute) - new added: CTRL-D same as CTRL-F but WBONLY (no matter what were given on commandline) CTRL-E same as CTRL-F but WINONLY (no matter what were given on commandline) Notes: ¯¯¯¯¯¯ The program creates another two files in 'SYS:Prefs/Presets': 'RndPattFiles-WB.done' 'RndPattFiles-WIN.done' These files list all Image-Files which were already shown. The random engine uses these files to avoid repeats until every image is shown at least one time. The PEN-Option is only useful if you are using a 800x600 WB-Screen and if you also have installed and started 'StopMenu' and use it with an always visible menubar (Prefs/Misc/DontHideBar). In this case you must also copy the three .info-Files to: 'STOPMENU:icons/program' In this case 'RandomWBPatt' will hack into the Window's RastPort of the StopMenu Bar and display the names of the currently shown pictures and also a countdown clock showing the remaining time until next change. Please take also a look to my other Software on Aminet: ------------------------------------------------------- - comm/www/MakeHTMLMap.lha - dev/basic/MBPrefs.lha - util/libs/ExtraLib.lha deutsch: ¯¯¯¯¯¯¯¯ Dieses kleine CLI-Programm schreibt jeweils nach einer angegeben Zeit- periode neue Bilddateinamen in die Datei 'WBPattern.prefs' im Verzeichnis 'ENV:sys', was dann das 'IPrefs' Programm automatisch dazu bringt, diese als neue Hintergründe anzuzeigen. Installation: ¯¯¯¯¯¯¯¯¯¯¯¯¯ - Kopiere die Programmdatei 'RandomWBPatt' nach C: (SYS:c) - Legen die folgenden Dateien an: 'SYS:Prefs/Presets/RndPattFiles-WB' 'SYS:Prefs/Presets/RndPattFiles-WIN' Diese Dateien sollten alle Bilddateien (incl. Pfad) auflisten, welche exklusiv als Hintergrund für die Workbench bzw. Windows verwendet werden sollen. D.h. Bilder gelistet in 'RndPattFiles-WB' werden nie in Windows erscheinen, und Bilder in 'RndPattFiles-WIN' nie auf der Workbench. In der ersten Zeile der Dateien muß jeweils die Anzahl der in der Datei gelisteten Bilder stehen. Sieh dir die mitgelieferten Beispieldateien an, falls du dir unsicher über das Format bist. Vor dem allerersten Start von 'RandomWBPatt' müssen mit dem WBPattern- Einsteller erst die bevorzugten Einstellungen gemacht werden, insbesondere unter OS3.5+ sind da einige Einstellungen für die Bildqualität etc.. Außerdem sollte schon hier der Typ für Workbench/Window auf 'Bild' ein- gestellt werden (nur einzeln oder beide, jenachdem, wie 'RandomWBPatt' eingesetzt werden soll (siehe unten)). Wenn nur einer von beiden Hinter- gründen (ONLY-Option) verändert werden soll, dann bleibt der andere jeweils vollkommen unberührt, soll heißen, für diesen kann auch der Typ 'Muster' eingestellt werden. Zu beachten ist, wenn 'RandomWBPatt' später doch auf einen als 'Muster' eingestellten Hintergrund ein Bild einsetzen soll, dann kann seinerseits 'RandomWBPatt' für die unter OS3.5+ verwendeten Qualitäts-Optionen nur die Voreinstellungswerte verwenden, um zum OS3.0/3.1 kompatibel zu bleiben. Aus diesem Grunde sollte dies eben, wie oben schon gesagt, von vornherein auf 'Bild' gesetzt werden und die Qualität eingestellt werden, denn dann braucht 'RandomWBPatt' an diesen Einstellungen nichts verändern, und sie bleiben somit unverändert von Bild zu Bild erhalten. - Denk daran, daß nur Bilder verwendet werden können, für die ein DataType vorhanden ist. Benutzung: ¯¯¯¯¯¯¯¯¯¯ Nur vom CLI aus !! RandomWBPatt ONCE/S WBONLY/S WINONLY/S TIMER/K PEN/K ONCE - Setze einmal neue Hintergründe und beende dann sofort WBONLY - Setze jeweils nur neuen Workbench-Hintergrund WINONLY - Setze jeweils nur neuen Windows-Hintergrung TIMER - gefolgt von einer max. 4-stelligen Zahl, die die Periode in Minuten angibt, nach der jeweils ein neuer Hintergrund gesetzt werden soll PEN - gefolgt von einer max. 3-stelligen Zahl zwischen 0-255, die die zu verwendende Schriftfarbe angibt (s.Bemerkung) - Sind ONCE und TIMER angegeben, dann hat ONCE Priorität !! - Sind WBONLY und WINONLY angegeben, dann hat WBONLY Priorität !! - Ist keine ONLY-Option angegeben, werden beide Hintergründe gesetzt. - Wird gar keine Option angegeben, gilt TIMER=30 PEN=3 - Wird kein ONCE verwendet, dann sollte das Programm mittels 'Run >NIL: RandomWBPatt Optionen' asyncron gestartet werden, z.B. wenn es von der 'S:User-Startup' aus gestartet werden soll. - Das Programm kann beendet werden, indem man mit dem CLI-Befehl 'Break' ein CTRL-C Signal an dieses sendet, das Programm beendet dann innerhalb einer Minute. - Man kann auch ein CTRL-F senden, was 'RandomWBPatt' dazu bringt, den aktuellen Warte-Zyklus zu beenden und sofort einen neuen Hintergrund zu laden (o.k. ja, kann auch bis zu einer Minute dauern) - neu: CTRL-D genau wie CTRL-F aber WBONLY (egal was in der Kommando- zeile angegeben wurde) CTRL-E genau wie CTRL-F aber WINONLY (egal was in der Kommando- zeile angegeben wurde) Bemerkungen: ¯¯¯¯¯¯¯¯¯¯¯¯ Das Programm legt selbst noch zwei Dateien in 'SYS:Prefs/Presets' an: 'RndPattFiles-WB.done' 'RndPattFiles-WIN.done' In diesen werden alle bereits einmal angezeigten Bilder vermerkt. Der Zufallsgenerator benutzt diese Dateien, um Wiederholungen zu vermeiden, bis alle Bilder mindestens einmal angezeigt worden sind. Der PEN-Parameter ist nur von Interesse, wenn Du erstens einen 800x600 Pixel großen WB-Bildschirm verwendest, und zweitens 'StopMenu' installiert ist und auch gestartet ist und auf immer sichtbaren Menubalken eingestellt ist (Prefs/Misc/DontHideBar). Kopiere in diesem Fall noch die drei .info-Dateien nach: 'STOPMENU:icons/program' In diesem Fall hackt sich 'RandomWBPatt' auf den Window-RastPort des Menubalkens ein und zeigt dort die Namen der gerade dargestellten Bilder an, sowie eine Countdown-Uhr, die die verbleibende Zeit bis zum nächsten Wechsel der Bilder anzeigt. Werfen Sie doch auch mal einen Blick auf meine andere Software im Aminet: ------------------------------------------------------------------------- - comm/www/MakeHTMLMap.lha - dev/basic/MBPrefs.lha - util/libs/ExtraLib.lha =========================================================================== History: ¯¯¯¯¯¯¯¯ v3.089 (30.03.02) - First public release v3.222 (10.08.02) - Random generator reworked: As more pictures from the given list were already shown, as longer it takes for the random generator to get a hit on an still unshown picture, finally ending up in an endless loop causing heavy disk activity. Now after a maximum of 100 random tries, the generator is switched to sequencial mode to find the few remaining unshown pictures. v4.231 (19.08.02) - Major change for this Version is the splitting of the old list file 'SYS:Prefs/Presets/RndPattFiles' to the files 'RndPattFiles-WB' and 'RndPattFiles-WIN' which hold the listings for the appropriate WBPattern-Settings 'Workbench' and 'Windows' - Minor changes: some more enhancements on random generator code and CTRL-C/F handling. v4.539 (23.06.03) - added CTRL-D/E handling for WBONLY/WINONLY forced reloads, CTRL-F is still operating by using the given commandline options - recompiled because of major changes in »extra.library«, see History of util/libs/ExtraLib.lha for more info v4.621 (13.09.03) - fixed some problems with OS3.5/3.9 quality settings, which were always reset to default values, now this is only the case, if 'RandomWBPatt' has to change the type of background, but then it must use defaults because of compatiblity reasons to OS3.0/3.1 - in general RandomWBPatt now keeps all settings made with the WBPattern preferences editor v5.000 (31.03.04) - in certain cases, especially when used for single pattern change (ONLY-Options and/or CTRL-D/CTRL-E), the 'wbpattern.prefs' file in ENV: was truncated because of odd filename length of the picture. -- fixed now -- v5.282 (08.10.04) - if ONLY-Option is used, then you now only must provide either the RndPattFiles-WB or -WIN file according to your ONLY-Option, older versions always did expect both files or the program was aborted by runtime error 53 (File not found) - if no RndPattFiles file is found, then the program simply does nothing, older versions did abort with runtime error 53 too v5.300 (28.11.05) - added some workarounds for OS-Functions, so I could loosen the OS requirements to OS 2.04, was easy to do, because only two OS3.0 functions were used :-) - also updated the Version/Architecture stuff of this readme to fit the requirements of the new Aminet .