Anysaver - A Meta-Screensaver

Introduction - License - History - Download - Installation - Configuration

Questions? Comments? Complaints? Raves? Mail me at:
marian@marian-aldenhoevel.de


Introduction

Top

Anysaver is a Windows Screensaver that does not do any saving or entertaining by itself but just blanks the screen. It then builds a commandline for one or more external programs according to its configuration and optionally random elements. It then executes that commandline hopefully running a program that does something interesting to the screen. After a configurable amount of time the program is stopped and another command selected and executed. This continues until the user presses a key or moves the mouse to cancel the screen saving mode.

My motivation to build AnySaver lies in the wonderful MAME program. MAME is the Multi Arcade Machine Emulator and emulates loads of old and not-so-old machines so faithfully, that the original software does not know the difference allowing us to play thousands of otherwise dead video games. For more information on MAME visit http://www.mame.com.

As you know many arcade machines run in what is called "attract mode" whenever nobody is actually playing. As a kid I never really cared much about playing but loved to watch the programs play themselves. Anysaver allows you to do that with any of the games MAME emulates.


License

Top

Anysaver comes under a very simple license: You may use it as you wish and distribute it to whomever you want in whatever way you feel like. I do not claim usefulness to any specific purpose nor give any warranty as to its safety. When redistributing always keep intact the information crediting me with the program.


History

Top

1.Jan.2006 Minor Tweaking
5.March.2004
v0.1.0.9
Cycle-Key support and tweaks for the XP Luna Theme
18.Jan.2004 v0.1.0.8: First public version

 


Download

Top

AnySaver is distributed as a single ZIP file, download it here.

AnySaver.zip (~390KB)


Installation

Top

AnySaver should run fine on any fairly modern flavour of 32-Bit-Windows that is Win95, 98, ME, NT, 2k and XP alike. I have only tested it on XP, though. Contact me if you have any information on how it fares on other versions.

Copy AnySaver.scr and AnySaver.dll to any folder on your harddisk. Right-click AnySaver.scr and select configure. See the section on configuration for details. Right click again and select install to select AnySaver as your screen saver. You can also select test to run AnySaver immediately.


Files

Top

<wherever>AnySaver.scr Main executable
<wherever>AnySaver.dll Hook library
<COMMON_APPDATA>Config.xml Configuration data

Configuration

Top

AnySaver was designed with flexibility in mind, so configuration is non-trivial. You should know the program(s) you want to run as slaves (If you mind that term replace it with whatever is more politically correct in your edge of the woods) well and understand their needs.

The examples in this documentation configure AnySaver to run the windows-version of MAME, if you have samples for other programs you can send them to me for inclusion.

First there is a set of

Global Options

Screenshot (5547 Byte)

Background color: When AnySaver kicks in it blanks the screen to the color selected here.
Ignore spurious mouse moves: Some slave programs seem to internally generate mouse events which would terminate the screen saver. With this setting you can configure how many mouse events will be ignored before terminating the saver.
Restart interval: This settings controls how long AnySaver will run the slave before restarting it. Specify 0 if you only want one slave-start per AnySaver-start.
Spacebar cycles: If this option is checked pressing the spacebar when the saver is running will not terminate the saver but immediately cycle to the next command.

Configure Slaves

To specify what program to run as slave AnySaver takes a commandline template and (optionally) replaces parts of that template with a varying selection. That selection can come from a list specified in place, from a list specified in a file or as filename picked from a directory. This is configured on the command tab of the configuration dialog:

Screenshot (12152 Byte)

Commandline template: This is the command to run. It includes the name of the program and any parameters to pass to it.
Initial directory: This is the directory to make current when the slave command is called. Some programs may require this to point to a specific folder. Leave blank to not change the current directory.
Replacements: This lists the replacements defined. If the text in the column replace is found in the command template it will be replaced by something defined within the replacement settings. You can view and change those settings by clicking the Edit button.
See further below for a description of the different replacements.
Delete: Deletes the currently selected replacement definition.
Add: Adds a new replacement definition.
Test: If you press this button AnySaver will create a sample command line with the current settings. This commandline is displayed next to the button. You can use that to test your configuration.
Run: If you press this button the commandline created by pressing Test is run. This is a further test of the commandline.

So the example shown here runs a program called mame-078b.exe in the folder D:\programme\mame. It passes three fixed parameters to that program that control its operation. The last part of the template %ROMLIST_EXTERNAL% is replaced by a selection from a text file. Which file and more options can be configured by pressing the Edit button.

Replacement Definitions

Replacement definitions come in three flavours called replacement classes. Each uses a different method to generate the replacement text and each can be used multiple times in your command line template by specifying different placeholder strings. You can also use the same placeholder multiple times in a template and replace with the same string in each position.

You can choose the replacement class when adding a new replacement definition. Press the Add button and you will see this dialog:

Screenshot (5100 Byte)

You can select a replacement class by checking the radiobutton and pressing OK or by doubleclicking the radiobutton.

Selection from a folder: Replace the placeholder with the name of a file or subdirectory from a specified directory.
Selection from a text file: Replace the placeholder with a line from a specified text file.
Selection from a list of choices: Replace the placeholder with one of a list of choices configured in AnySaver itself.

Each of these replacement classes has a set of options that are configured in separate dialogs, one per class.

Selection From A List Of Choices

Screenshot (9353 Byte)

Replace this: This is the string that is replaced in the commandline template. If this field is left empty the replacement is never used.
With one of: This is the list of strings with which the placeholder can be replaced. The replacements are selected by line. You can press the right mouse button and copy that list to and from the clipboard if you want to edit it externally.
Random or sequential: Check the box to select a random line from the list of choices each time the commandline template is evaluated. Uncheck it to traverse the list of choices in sequential order. When selecting sequential you can also select the index of the line that is going to be selected next time that replacement is evaluated. The first line has the index 0. The sequence wraps around at the end.
Selection must exist as file: If you check this box the list of choices is filtered to only select those lines whose content matches a filename present on your system. The name to check is created by prepending and adding the contents of the two edits on the right.
This is for a special use case where you specify a list of possible choices but not all of them are valid at any given time.

Selection From A Text File

Screenshot (9075 Byte)

Replace this: This is the string that is replaced in the commandline template. If this field is left empty the replacement is never used.
With a line from a file This option specifies a text file whose contents are read as possible choices. When the commandline  is evaluated the placeholder will be replaced by a line from that file.
Open: You can press this button to open the file.
Random or sequential: Check the box to select a random line from the file each time the commandline template is evaluated. Uncheck it to traverse the file in sequential order. When selecting sequential you can also select the index of the line that is going to be selected next time that replacement is evaluated. The first line has the index 0. The sequence wraps around at the end.
Selection must exist as file: If you check this box the list of choices is filtered to only select those lines whose content matches a filename present on your system. The name to check is created by prepending and adding the contents of the two edits on the right.
This is for a special use case where you specify a list of possible choices but not all of them are valid at any given time.

Selection From A Folder

Screenshot (8243 Byte)

Replace this: This is the string that is replaced in the commandline template. If this field is left empty the replacement is never used.
With a name from the directory: This is the name of a folder. The placeholder will be replaced by a name from that directory, either a filename or a subdirectory name.
That matches the expression: If this edit is left empty, any names found in the directory can be selected. You can also enter a regular expression here that is used to filter the list.
May be a file: If this is checked the selection may specify a file name in the directory.
May be a directory: If this is checked the selection may specify a subdirectory off the specified directory.
Include the full path: If this is checked the file- or directory name is replaced including the full path name.
Include the extension: If this is checked the extension is included when replacing. If unchecked the extension is stripped.
Random or sequential: Check the box to select a random name from the directory each time the commandline template is evaluated. Uncheck it to traverse the possible choices in sequential order. When selecting sequential you can also select the index of the name that is going to be selected next time that replacement is evaluated. The first name has the index 0. The sequence wraps around at the end.