backIndex

Xelagot action script

DeeJay

To use the DJ abilities of your bot, you must first prepare a list of midi's and urls. There is a special program for that: DJ.exe in your DeeJay folder. You must also define the speakers and save this definition: this can be done through the user interface (menu "World | DeeJay", tab "Speakers"), or using string lists. See Xelagot Topics: Playing midis for a full explanation of DJ.exe and for how to make and save speakers.

There is a set of statements to load the midi list, to load the speakers and to play midis. The midi list file should be in the DeeJay folder, the speaker file should be in the folder CustomSpeakers, which is a sub-folder of the DeeJay folder.

Xelagot 3.607 and higher can use a script to delete duplicate speakers caused by a crash or disconnection. The bot must be playing midis for the script to work properly. All speakers (including the good ones) will be removed, the bot will rebuild speakers at the next midi. Do not use this script while doing a world backup or querying just one cell, as it uses the same cell iterator. You can download this script here.

LoadMidiList $f [%rc]
Loads a midi list made with DJ.exe. Optionally %rc will contain 0 if loading is successful, otherwise -1.

xelagot 3.607 or newer
The filename convention is explained in the section Filenames. However, in this case the filename $f defaults to the _DeeJay folder instead of the script's folder.

xelagot 3.606 or older
Filename $f defaults to the DeeJay folder. A full drive + path may also be specified, see Program paths.
CountMidis %n
assigns to %n the number of midis in the list.
LoadSpeakers $f [%rc]
Loads a speaker definition file, made with the bot's 'World | DeeJay' facility or using string lists (see below). The program will change the file extension of $f to the standard '.xsp' extension, or add it if necessary. Optionally %rc will contain 0 if loading is successful, otherwise -1.

xelagot 3.607 or newer
The filename convention is explained in the section Filenames. However, in this case, the default folder is not the script's folder, but the CustomSpeakers folder in the _DeeJay folder.

xelagot 3.606 or older
Filename $f defaults to the CustomSpeakers folder, a sub-folder of the DeeJay folder. A full drive + path may also be specified, see Program paths.
CountSpeakers %n
assigns to %n the number of speakers in the list. All speakers will be counted, even those without a model.
CountValidSpeakers %n
assigns to %n the number of valid speakers in the list. Valid speakers are ones which have a model name assigned to them. These are the ones the bot will use to play.
SaveSpeakers $f [%rc]
Saves a speaker definition file, made with the bot's 'World | DeeJay' facility. This statement can come in handy if you wish to be sure the current speaker definition is saved before you load a new one using action script commands. The program will change the file extension of $f to the standard '.xsp' extension, or add it if necessary. Optionally %rc will contain 0 if saving is successful, otherwise -1.

xelagot 3.607 or newer
The filename convention is explained in the section Filenames. However, in this case, the default folder is not the script's folder, but the CustomSpeakers folder in the _DeeJay folder. If the destination path and folder does not exist, it will be created to accommodate the file.

xelagot 3.606 or older
Filename $f defaults to the CustomSpeakers folder, a sub-folder of the DeeJay folder. A full drive + path may also be specified, see Program paths.
PlayContinuous
This is the default setting for playing midis
PlayOnce
Forces the bot to play only one midi when commanded to 'PlayNext', disables all other play commands and statements.
PlayMidi [%m]
starts a midi session if the bot is not playing, does not alter the playing order. Optional %m adds a midi number to the request queue.
PlayDown [%m]
starts a midi session if the bot is not playing, sets the playing order to 'down the list' i.e. forwards. Optional %m adds a midi number to the request queue.
PlayUp [%m]
starts a midi session if the bot is not playing, sets the playing order to 'up the list' i.e. backwards. Optional %m adds a midi number to the request queue.
PlayRandom [%m]
starts a midi session if the bot is not playing, sets the playing order to random. Optional %m adds a midi number to the request queue.
PlayNext [%m]
starts a midi session if the bot is not playing, forces the bot to play the next midi inmediately. Optionally, you may specify which midi number must be played. This play statement also works when the bot has received the PlayOnce command.
PlayPause
plays the silent midi, stops the music.
PlayStop
stops the midi session and removes the speakers.

The format of the speaker definition file is illustrated by the following example for 2 speakers. If you make your own speaker definition file using string lists, omit the lines in blue. The lines in green may also be omitted. The lines in boldface are mandatory.

MidiTimeout=0
CurrentMidi=-1
PlayState=0
PlayMode=0
Continuous=-1
Requests=
SpeakerCount=2
Speaker1Model=sign1.rwx
Speaker1Location=97.000n 500.000w 0.00a 0.0°
Speaker1Number=0
Speaker1Create=sign bcolor=white color=red
Speaker1Activate=
Speaker1Bump=
Speaker1Adone=
Speaker2Model=sign1.rwx
Speaker2Location=97.000n 490.000w 0.00a 0.0°
Speaker2Number=0
Speaker2Create=sign bcolor=white color=red
Speaker2Activate=
Speaker2Bump=
Speaker2Adone=


backIndex