This AI is still in early stages of development.
Diag.run()
- Aubergine
Owned by Aubergine
Run a diagnostic.
Â
Syntax
var result = Diag.run(name, params); // run a diagnostic
Parameters
Parameter | Type | Mandatory | Notes | Diag Ver |
---|---|---|---|---|
name | String | Name of the diagnostic routine. Must not contain any spaces! Will always be converted to lowercase. | 1.0 | |
params | Variant | Any additional parameters to pass in to the routine. Note that if using the in-game chat interface they will all be stings. | 1.0 |
Return values
Value | Type | Notes | Diag Ver |
---|---|---|---|
<string> | String | The results of the diagnostic in a single string. | 1.0 |
<array> | Array of String | The results of the diagnostic in an array of strings (or values that will reliably typecast to strings). | 1.0 |
<error> | String | If something goes wrong, the error message will be returned as a string. | 1.0 |
Example
Echo parameters back to calling script
// define a diagnostic routine function var myDiagFn = function bar(name, param1, param2, etc) { // name always converted to lowercase // return arguments object converted in to an array return Array.prototype.splice.call(arguments); } Â Diag.add("foo", myDiagFn); // register myDiagFn under the name "foo" Diag("Foo", true, "bleh"); // ["foo", true, "bleh"]
Notes
See Diag.add() for notes about diagnostic routine functions.
Contents
Jump to:
Diag API
Topics:
- Diag() — Run a diagnostic routine...
- Diag.add() — Register diagnostic routines with the Diag API...
- Diag.run() — Run a diagnostic.
- Diag API Diagnostics — The Diag API provides a few diagnostic routines of it's own...
- Lazy Loading Diagnostics — By lazy loading diagnostic routines, your script will start faster and use less RAM if diagnostics are not required.
Â