Description
Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts
TheScriptDiscoveryService
API provides facilities to work with Interface scripts.Properties
Name | Type | Summary |
---|---|---|
debugScriptUrl | string |
The path and name of a script to debug using the "API Debugger" developer tool (currentAPI.js). If set, the API Debugger dialog displays the objects and values exposed by the script using Script.registerValue and similar. Default Value: "" |
defaultScriptsPath | string |
The path where the default scripts are located in the Interface installation. Read-only. |
scriptsModel | ScriptsModel |
Information on the scripts that are in the default scripts directory of the Interface installation. Read-only. |
scriptsModelFilter | ScriptsModelFilter |
Sorted and filtered information on the scripts that are in the default scripts directory of the Interface installation. Read-only. |
Methods
Name | Return Value | Summary |
---|---|---|
getLocal
|
Array.<ScriptDiscoveryService.LocalScript> |
Deprecated: This function is deprecated and will be removed. |
getPublic
|
Array.<ScriptDiscoveryService.PublicScript> |
Gets a list of all script files that are in the default scripts directory of the Interface installation. |
getRunning
|
Array.<ScriptDiscoveryService.RunningScript> |
Gets a list of all Interface scripts that are currently running. |
loadOneScript
|
None |
Starts running an Interface script, if it isn't already running. The script is automatically loaded next time Interface starts. This is a synonym for calling loadScript with just the script URL. Supported Script Types: Interface Scripts • Avatar Scripts See also, Script.load. |
loadScript
|
object |
Starts running an Interface script, if it isn't already running. Supported Script Types: Interface Scripts • Avatar Scripts See also, Script.load. |
onClearDebugWindow
|
None |
Deprecated: This function is deprecated and will be removed. |
onErrorLoadingScript
|
None |
Deprecated: This function is deprecated and will be removed. |
onErrorMessage
|
None |
Deprecated: This function is deprecated and will be removed. |
onInfoMessage
|
None |
Deprecated: This function is deprecated and will be removed. |
onPrintedMessage
|
None |
Deprecated: This function is deprecated and will be removed. |
onScriptFinished
|
None |
Deprecated: This function is deprecated and will be removed. |
onWarningMessage
|
None |
Deprecated: This function is deprecated and will be removed. |
reloadAllScripts
|
None |
Restarts all Interface, avatar, and client entity scripts after clearing the scripts cache. |
stopAllScripts
|
None |
Stops or restarts all Interface scripts. The scripts cache is not cleared. If restarting, avatar and client entity scripts are also restarted. |
stopScript
|
boolean |
Stops or restarts an Interface script. |
Signals
Name | Summary |
---|---|
clearDebugWindow
|
Triggered when the Debug Window is cleared. |
errorLoadingScript
|
Deprecated: This signal is deprecated and will be removed. |
errorMessage
|
Triggered when any script generates an error or console.error is called. |
infoMessage
|
Triggered when any script generates an information message or console.info is called. |
printedMessage
|
Triggered when any script prints a message to the program log via print, Script.print, console.log, or console.debug. |
scriptCountChanged
|
Triggered when the number of Interface scripts running changes. |
scriptLoadError
|
Triggered when a script could not be loaded. |
scriptsReloading
|
Triggered when Interface, avatar, and client entity scripts are restarting as a result of reloadAllScripts or stopAllScripts. |
warningMessage
|
Triggered when any script generates a warning or console.warn is called. |
Type Definitions
LocalScript Type: object |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Information on a local script. Deprecated: This type is deprecated and will be removed. Properties
|
PublicScript Type: object |
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Information on a public script, i.e., a script that's included in the Interface installation. Properties
|
RunningScript Type: object |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Information on a running script. Properties
|
Method Details
(static) getLocal( ) → {Array.<ScriptDiscoveryService.LocalScript>}
Returns: Local scripts. |
---|
Deprecated: This function is deprecated and will be removed. |
(static) getPublic( ) → {Array.<ScriptDiscoveryService.PublicScript>}
Returns: All scripts in the "scripts" directory of the Interface installation. |
---|
Gets a list of all script files that are in the default scripts directory of the Interface installation. |
(static) getRunning( ) → {Array.<ScriptDiscoveryService.RunningScript>}
Returns: All Interface scripts that are currently running. |
---|
Gets a list of all Interface scripts that are currently running. Example
|
(static) loadOneScript( url ) | ||||||
---|---|---|---|---|---|---|
Starts running an Interface script, if it isn't already running. The script is automatically loaded next time Interface starts. This is a synonym for calling loadScript with just the script URL. Supported Script Types: Interface Scripts • Avatar Scripts See also, Script.load. Parameters
|
(static) loadScript( urlopt, isUserLoadedopt, loadScriptFromEditoropt, activateMainWindowopt, reloadopt, quitWhenFinishedopt ) → {object}
Returns: An empty object, {} .
|
|||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Starts running an Interface script, if it isn't already running. Supported Script Types: Interface Scripts • Avatar Scripts See also, Script.load. Parameters
|
(static) onClearDebugWindow( ) |
---|
Deprecated: This function is deprecated and will be removed. |
(static) onErrorLoadingScript( url ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) onErrorMessage( message, scriptName ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) onInfoMessage( message, scriptName ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) onPrintedMessage( message, scriptName ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) onScriptFinished( scriptName, manager ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) onWarningMessage( message, scriptName ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) reloadAllScripts( ) |
---|
Restarts all Interface, avatar, and client entity scripts after clearing the scripts cache. |
(static) stopAllScripts( restartopt ) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Stops or restarts all Interface scripts. The scripts cache is not cleared. If restarting, avatar and client entity scripts are also restarted. Parameters
|
(static) stopScript( url, restartopt ) → {boolean}
Returns: true if the script was successfully stopped or restarted, false if it
wasn't (e.g., the script couldn't be found).
|
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Stops or restarts an Interface script. Parameters
|
Signal Details
clearDebugWindow(
)
Returns: Signal |
---|
Triggered when the Debug Window is cleared. |
errorLoadingScript(
url
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Deprecated: This signal is deprecated and will be removed. Parameters
|
errorMessage(
message,
scriptName
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when any script generates an error or console.error is called. Parameters
|
infoMessage(
message,
scriptName
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when any script generates an information message or console.info is called. Parameters
|
printedMessage(
message,
scriptName
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when any script prints a message to the program log via print, Script.print, console.log, or console.debug. Parameters
|
scriptCountChanged(
)
Returns: Signal |
---|
Triggered when the number of Interface scripts running changes. Example
|
scriptLoadError(
url,
error
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when a script could not be loaded. Parameters
|
scriptsReloading(
)
Returns: Signal |
---|
Triggered when Interface, avatar, and client entity scripts are restarting as a result of reloadAllScripts or stopAllScripts. |
warningMessage(
message,
scriptName
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when any script generates a warning or console.warn is called. Parameters
|