Home -> VRSmarty plugins page -> randomizer.swf
This plugin is completely free for use in any context or connection.
randomizer.swf
A plugin for randomizing a VRSmarty command by setting a random value within specified limits, or making a random choice from a given set. The choice can also be made depending on what second, minute, hour, weekday, day or month it is.
The following plugin function is supported:

command(cmd,rnd,delim)
cmdVRSmarty commandexample: 'pano.pan=[-150 - -35],5000,elastic'
rndrandom functionoptional, 'second', 'minute', 'hour', 'weekday', 'day' or 'month' see below
delimdelimiteroptional, default=, (comma), see below



NOTES:

If you want to randomize a VRSmarty command, just do like this:
- Replace the value or the string in your command that you want to randomize with [...] (see below).
- Send it to the randomize.swf plugin.
- The plugin will replace the bracket [...] with a random value and execute the command.


The [...] bracket content can have two different formats:

1.A numeric range - specify a range of numeric values (with the lower value first)
example: [-800 - -20] (spaces are ignored)
The plugin will generate a random value within this range.
2.A set of choices
example1: [goPanoA,goPanoB,goPanoC] (spaces are taken as any other character)
example2: [17,43,5,22,9,31] (spaces are taken as any other character)
The plugin will make a random selection of one of the given choices.
There is no limit for the number of choices.


You can use several brackets [...] in the same command.


The rnd parameter can be used to control the random choice:
secondThe current second (0-59)
minuteThe current minute (0-59)
hourThe current hour of the day (0-23)
dayThe current day of the week (0-6)
dateThe current day of the month (0-30)
monthThe current month (0-11)
The random choice is then calculated by random_value % no_of_choices. So, if you have set the rnd parameter to 'hour' and have 6 different choices, the plugin will start with the first choice immediately after midnight, change every hour, and go back to the first one again after six hours ...and so on.


The default choice list delimiter is "," (comma). But if any of your choices contains a comma, you can set the delim parameter for using almost any other character or string that does not interfere with your choices or with VRSmarty parsing.


Version history: