@casual-simulation/aux-common 3.1.8 → 3.1.9-alpha.3340590989
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/math/Vector2.js +6 -1
- package/math/Vector2.js.map +1 -1
- package/math/Vector3.js +6 -1
- package/math/Vector3.js.map +1 -1
- package/package.json +4 -2
- package/runtime/AuxCompiler.d.ts +74 -1
- package/runtime/AuxCompiler.js +332 -25
- package/runtime/AuxCompiler.js.map +1 -1
- package/runtime/AuxGlobalContext.d.ts +14 -4
- package/runtime/AuxGlobalContext.js +9 -1
- package/runtime/AuxGlobalContext.js.map +1 -1
- package/runtime/AuxLibrary.d.ts +191 -10
- package/runtime/AuxLibrary.js +172 -37
- package/runtime/AuxLibrary.js.map +1 -1
- package/runtime/AuxLibraryDefinitions.def +469 -82
- package/runtime/AuxRuntime.d.ts +66 -7
- package/runtime/AuxRuntime.js +976 -118
- package/runtime/AuxRuntime.js.map +1 -1
- package/runtime/AuxRuntimeDynamicImports.d.ts +14 -0
- package/runtime/AuxRuntimeDynamicImports.js +24 -0
- package/runtime/AuxRuntimeDynamicImports.js.map +1 -0
- package/runtime/CompiledBot.d.ts +59 -1
- package/runtime/CompiledBot.js +2 -0
- package/runtime/CompiledBot.js.map +1 -1
- package/runtime/RuntimeBot.d.ts +17 -0
- package/runtime/RuntimeBot.js +85 -5
- package/runtime/RuntimeBot.js.map +1 -1
- package/runtime/Transpiler.d.ts +21 -0
- package/runtime/Transpiler.js +27 -0
- package/runtime/Transpiler.js.map +1 -1
- package/runtime/Utils.d.ts +11 -0
- package/runtime/Utils.js +30 -1
- package/runtime/Utils.js.map +1 -1
- package/runtime/test/RuntimeTestHelpers.d.ts +5 -0
- package/runtime/test/RuntimeTestHelpers.js +11 -0
- package/runtime/test/RuntimeTestHelpers.js.map +1 -1
- package/test/TestHelpers.js +2 -2
- package/test/TestHelpers.js.map +1 -1
|
@@ -3044,7 +3044,7 @@ export interface HtmlFunction {
|
|
|
3044
3044
|
/**
|
|
3045
3045
|
* Defines an interface that contains options for a debugger.
|
|
3046
3046
|
*/
|
|
3047
|
-
export interface
|
|
3047
|
+
export interface CommonDebuggerOptions {
|
|
3048
3048
|
/**
|
|
3049
3049
|
* Whether to use "real" UUIDs instead of predictable ones.
|
|
3050
3050
|
*/
|
|
@@ -3053,7 +3053,7 @@ export interface DebuggerOptions {
|
|
|
3053
3053
|
/**
|
|
3054
3054
|
* Whether to allow scripts to be asynchronous.
|
|
3055
3055
|
* If false, then all scripts will be forced to be synchronous.
|
|
3056
|
-
* Defaults to
|
|
3056
|
+
* Defaults to true.
|
|
3057
3057
|
*/
|
|
3058
3058
|
allowAsynchronousScripts: boolean;
|
|
3059
3059
|
|
|
@@ -3064,6 +3064,14 @@ export interface DebuggerOptions {
|
|
|
3064
3064
|
configBot: Bot | BotTags;
|
|
3065
3065
|
}
|
|
3066
3066
|
|
|
3067
|
+
export interface NormalDebuggerOptions extends CommonDebuggerOptions {
|
|
3068
|
+
pausable: false;
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
export interface PausableDebuggerOptions extends CommonDebuggerOptions {
|
|
3072
|
+
pausable: true;
|
|
3073
|
+
}
|
|
3074
|
+
|
|
3067
3075
|
/**
|
|
3068
3076
|
* Defines an interface that represents the result of a "create public record key" operation.
|
|
3069
3077
|
*/
|
|
@@ -7165,6 +7173,197 @@ export interface RaycastRay {
|
|
|
7165
7173
|
direction: Vector3;
|
|
7166
7174
|
}
|
|
7167
7175
|
|
|
7176
|
+
export type PossiblePauseTriggerStates =
|
|
7177
|
+
| ['before' | 'after']
|
|
7178
|
+
| ['before', 'after'];
|
|
7179
|
+
|
|
7180
|
+
/**
|
|
7181
|
+
* Defines an interface that contains options for a pause trigger.
|
|
7182
|
+
*/
|
|
7183
|
+
export interface PauseTriggerOptions {
|
|
7184
|
+
/**
|
|
7185
|
+
* The line number that the trigger starts at.
|
|
7186
|
+
* Numbers should be one-based.
|
|
7187
|
+
*/
|
|
7188
|
+
lineNumber: number;
|
|
7189
|
+
|
|
7190
|
+
/**
|
|
7191
|
+
* The column number that the trigger starts at.
|
|
7192
|
+
* Numbers should be one-based, and the @ symbol in listeners is ignored.
|
|
7193
|
+
*/
|
|
7194
|
+
columnNumber: number;
|
|
7195
|
+
|
|
7196
|
+
/**
|
|
7197
|
+
* The states that the trigger should use.
|
|
7198
|
+
* Defaults to ["before"] if not specified.
|
|
7199
|
+
*/
|
|
7200
|
+
states?: ('before' | 'after')[];
|
|
7201
|
+
|
|
7202
|
+
/**
|
|
7203
|
+
* Whether the trigger is enabled.
|
|
7204
|
+
* Defaults to true.
|
|
7205
|
+
*/
|
|
7206
|
+
enabled?: boolean;
|
|
7207
|
+
}
|
|
7208
|
+
|
|
7209
|
+
/**
|
|
7210
|
+
* Defines an interface that represents a pause trigger.
|
|
7211
|
+
*/
|
|
7212
|
+
export interface PauseTrigger extends PauseTriggerOptions {
|
|
7213
|
+
/**
|
|
7214
|
+
* The ID of the trigger.
|
|
7215
|
+
*/
|
|
7216
|
+
triggerId: string;
|
|
7217
|
+
|
|
7218
|
+
/**
|
|
7219
|
+
* The ID of the bot that the trigger is set on.
|
|
7220
|
+
*/
|
|
7221
|
+
botId: string;
|
|
7222
|
+
|
|
7223
|
+
/**
|
|
7224
|
+
* The tag that the trigger is set on.
|
|
7225
|
+
*/
|
|
7226
|
+
tag: string;
|
|
7227
|
+
}
|
|
7228
|
+
|
|
7229
|
+
/**
|
|
7230
|
+
* Defines an interface for a possible pause trigger location.
|
|
7231
|
+
*/
|
|
7232
|
+
export interface PossibleTriggerLocation {
|
|
7233
|
+
/**
|
|
7234
|
+
* The line number that the trigger would pause the debugger at.
|
|
7235
|
+
*/
|
|
7236
|
+
lineNumber: number;
|
|
7237
|
+
|
|
7238
|
+
/**
|
|
7239
|
+
* The column number that the trigger would pause the debugger at.
|
|
7240
|
+
*/
|
|
7241
|
+
columnNumber: number;
|
|
7242
|
+
|
|
7243
|
+
/**
|
|
7244
|
+
* The states that are reasonable for this pause trigger to stop at.
|
|
7245
|
+
*/
|
|
7246
|
+
possibleStates: PossiblePauseTriggerStates;
|
|
7247
|
+
}
|
|
7248
|
+
|
|
7249
|
+
/**
|
|
7250
|
+
* Defines an interface that contains information about the current debugger pause state.
|
|
7251
|
+
*/
|
|
7252
|
+
export interface DebuggerPause {
|
|
7253
|
+
/**
|
|
7254
|
+
* The ID of the pause.
|
|
7255
|
+
*/
|
|
7256
|
+
pauseId: string | number;
|
|
7257
|
+
|
|
7258
|
+
/**
|
|
7259
|
+
* The pause trigger that started this pause.
|
|
7260
|
+
*/
|
|
7261
|
+
trigger: PauseTrigger;
|
|
7262
|
+
|
|
7263
|
+
/**
|
|
7264
|
+
* The state of the pause.
|
|
7265
|
+
* Indicates whether the pause is before or after the node was executed.
|
|
7266
|
+
*/
|
|
7267
|
+
state: 'before' | 'after';
|
|
7268
|
+
|
|
7269
|
+
/**
|
|
7270
|
+
* The result of the node evaluation.
|
|
7271
|
+
* Only included for "after" pause states.
|
|
7272
|
+
*/
|
|
7273
|
+
result?: any;
|
|
7274
|
+
|
|
7275
|
+
/**
|
|
7276
|
+
* The call stack that the debugger currently has.
|
|
7277
|
+
*/
|
|
7278
|
+
callStack: DebuggerCallFrame[];
|
|
7279
|
+
}
|
|
7280
|
+
|
|
7281
|
+
/**
|
|
7282
|
+
* Defines an interface that contains information about a single call stack frame.
|
|
7283
|
+
*/
|
|
7284
|
+
export interface DebuggerCallFrame {
|
|
7285
|
+
/**
|
|
7286
|
+
* The location that was last evaluated in this frame.
|
|
7287
|
+
*/
|
|
7288
|
+
location: DebuggerFunctionLocation;
|
|
7289
|
+
|
|
7290
|
+
/**
|
|
7291
|
+
* Gets the list of variables that are avaiable from this frame.
|
|
7292
|
+
*/
|
|
7293
|
+
listVariables(): DebuggerVariable[];
|
|
7294
|
+
|
|
7295
|
+
/**
|
|
7296
|
+
* Sets the given variable name to the given value.
|
|
7297
|
+
* @param variableName The name of the variable to set.
|
|
7298
|
+
* @param value The value to set in the variable.
|
|
7299
|
+
*/
|
|
7300
|
+
setVariableValue(variableName: string, value: any): void;
|
|
7301
|
+
}
|
|
7302
|
+
|
|
7303
|
+
/**
|
|
7304
|
+
* Defines an interface that represents a location in a debugger.
|
|
7305
|
+
*/
|
|
7306
|
+
export interface DebuggerFunctionLocation {
|
|
7307
|
+
/**
|
|
7308
|
+
* The name of the function.
|
|
7309
|
+
*/
|
|
7310
|
+
name?: string;
|
|
7311
|
+
|
|
7312
|
+
/**
|
|
7313
|
+
* The ID of the bot that this function is defined in.
|
|
7314
|
+
*/
|
|
7315
|
+
botId?: string;
|
|
7316
|
+
|
|
7317
|
+
/**
|
|
7318
|
+
* The name of the tag that this function is defined in.
|
|
7319
|
+
*/
|
|
7320
|
+
tag?: string;
|
|
7321
|
+
|
|
7322
|
+
/**
|
|
7323
|
+
* The line number that this function is defined at.
|
|
7324
|
+
*/
|
|
7325
|
+
lineNumber?: number;
|
|
7326
|
+
|
|
7327
|
+
/**
|
|
7328
|
+
* The column number that this function is defined at.
|
|
7329
|
+
*/
|
|
7330
|
+
columnNumber?: number;
|
|
7331
|
+
}
|
|
7332
|
+
|
|
7333
|
+
/**
|
|
7334
|
+
* Defines an interface that represents a debugger variable.
|
|
7335
|
+
*/
|
|
7336
|
+
export interface DebuggerVariable {
|
|
7337
|
+
/**
|
|
7338
|
+
* The name of the variable.
|
|
7339
|
+
*/
|
|
7340
|
+
name: string;
|
|
7341
|
+
|
|
7342
|
+
/**
|
|
7343
|
+
* The value contained by the variable.
|
|
7344
|
+
*/
|
|
7345
|
+
value: any;
|
|
7346
|
+
|
|
7347
|
+
/**
|
|
7348
|
+
* The scope that the variable exists in.
|
|
7349
|
+
*
|
|
7350
|
+
* "block" indicates that the variable was defined in and exists only in the current block.
|
|
7351
|
+
* "frame" indicates that the variable was defined in and exists in the current stack frame.
|
|
7352
|
+
* "closure" indicates that the variable was inherited from a parent stack frame.
|
|
7353
|
+
*/
|
|
7354
|
+
scope: 'block' | 'frame' | 'closure';
|
|
7355
|
+
|
|
7356
|
+
/**
|
|
7357
|
+
* Whether the variable value can be overwriten.
|
|
7358
|
+
*/
|
|
7359
|
+
writable: boolean;
|
|
7360
|
+
|
|
7361
|
+
/**
|
|
7362
|
+
* Whether this variable has been initialized.
|
|
7363
|
+
*/
|
|
7364
|
+
initialized?: boolean;
|
|
7365
|
+
}
|
|
7366
|
+
|
|
7168
7367
|
|
|
7169
7368
|
declare global {
|
|
7170
7369
|
|
|
@@ -8061,7 +8260,7 @@ declare global {
|
|
|
8061
8260
|
const perf: Perf;
|
|
8062
8261
|
}
|
|
8063
8262
|
|
|
8064
|
-
interface
|
|
8263
|
+
interface DebuggerBase {
|
|
8065
8264
|
/**
|
|
8066
8265
|
* Gets the list of actions that have been performed by bots in this debugger.
|
|
8067
8266
|
*/
|
|
@@ -8085,30 +8284,72 @@ interface Debugger {
|
|
|
8085
8284
|
getErrors(): any[];
|
|
8086
8285
|
|
|
8087
8286
|
/**
|
|
8088
|
-
*
|
|
8089
|
-
* @param
|
|
8090
|
-
* @param mods The mods which specify the new bot's tag values. If given a mod with no tags, then an error will be thrown.
|
|
8091
|
-
* @returns The bot(s) that were created.
|
|
8092
|
-
*
|
|
8093
|
-
* @example
|
|
8094
|
-
* // Create a red bot without a parent.
|
|
8095
|
-
* let redBot = create(null, { "color": "red" });
|
|
8096
|
-
*
|
|
8097
|
-
* @example
|
|
8098
|
-
* // Create a red bot and a blue bot with `this` as the parent.
|
|
8099
|
-
* let [redBot, blueBot] = create(this, [
|
|
8100
|
-
* { "color": "red" },
|
|
8101
|
-
* { "color": "blue" }
|
|
8102
|
-
* ]);
|
|
8103
|
-
*
|
|
8287
|
+
* Registers the given handler to react to when this debugger pauses by hitting a trigger.
|
|
8288
|
+
* @param handler The handler that should be called when the debugger pauses.
|
|
8104
8289
|
*/
|
|
8105
|
-
|
|
8290
|
+
onPause(handler: (pause: DebuggerPause)): void;
|
|
8106
8291
|
|
|
8107
8292
|
/**
|
|
8108
|
-
*
|
|
8109
|
-
*
|
|
8293
|
+
* Registers or updates a pause trigger with this debugger.
|
|
8294
|
+
* Pause triggers can be used to tell the debugger when you want it to stop execution.
|
|
8295
|
+
* You specify the bot, tag, line and column numbers and the debugger will stop before/after it executes the code at that location.
|
|
8296
|
+
* @param botOrIdOrTrigger The bot, bot ID, or trigger that should be registered or updated.
|
|
8297
|
+
* @param tag The tag that the trigger should be registered in. Required if a bot or bot ID is specified.
|
|
8298
|
+
* @param options The options that go with this pause trigger. Required if a bot or bot ID is specified.
|
|
8110
8299
|
*/
|
|
8111
|
-
|
|
8300
|
+
setPauseTrigger(botOrIdOrTrigger: Bot | string | PauseTrigger, tag?: string, options?: PauseTriggerOptions): PauseTrigger;
|
|
8301
|
+
/**
|
|
8302
|
+
* Registers a new pause trigger with this debugger.
|
|
8303
|
+
* Pause triggers can be used to tell the debugger when you want it to stop execution.
|
|
8304
|
+
* You specify the bot, tag, line and column numbers and the debugger will stop before/after it executes the code at that location.
|
|
8305
|
+
* @param botOrId The bot, or bot ID that the trigger should be placed in.
|
|
8306
|
+
* @param tag The tag that the trigger should be placed in.
|
|
8307
|
+
* @param options The options that go with this pause trigger.
|
|
8308
|
+
*/
|
|
8309
|
+
setPauseTrigger(botOrId: Bot | string, tag: string, options: PauseTriggerOptions): PauseTrigger;
|
|
8310
|
+
|
|
8311
|
+
/**
|
|
8312
|
+
* Registers or updates the given pause trigger with this debugger.
|
|
8313
|
+
* @param trigger The trigger that should be registered or updated.
|
|
8314
|
+
*/
|
|
8315
|
+
setPauseTrigger(trigger: PauseTrigger): PauseTrigger;
|
|
8316
|
+
|
|
8317
|
+
/**
|
|
8318
|
+
* Removes the given pause trigger from the debugger.
|
|
8319
|
+
* @param triggerOrId The trigger or trigger ID that should be removed from the debugger.
|
|
8320
|
+
*/
|
|
8321
|
+
removePauseTrigger(triggerOrId: string | PauseTrigger): void;
|
|
8322
|
+
|
|
8323
|
+
/**
|
|
8324
|
+
* Disables the given pause trigger.
|
|
8325
|
+
* Disabled pause triggers will continue to be listed with listPauseTriggers(), but will not cause a pause to happen while they are disabled.
|
|
8326
|
+
* @param triggerOrId The trigger or trigger ID that should be disabled.
|
|
8327
|
+
*/
|
|
8328
|
+
disablePauseTrigger(triggerOrId: string | PauseTrigger): void;
|
|
8329
|
+
|
|
8330
|
+
/**
|
|
8331
|
+
* Enables the given pause trigger
|
|
8332
|
+
* @param triggerOrId The trigger or trigger ID that should be enabled.
|
|
8333
|
+
*/
|
|
8334
|
+
enablePauseTrigger(triggerOrId: strin | PauseTrigger): void;
|
|
8335
|
+
|
|
8336
|
+
/**
|
|
8337
|
+
* Gets the list of pause triggers that have been registered with this debugger.
|
|
8338
|
+
*/
|
|
8339
|
+
listPauseTriggers(): PauseTrigger[];
|
|
8340
|
+
|
|
8341
|
+
/**
|
|
8342
|
+
* Gets a list of common trigger locations for the specified listener on the specified bot.
|
|
8343
|
+
* @param botOrId The bot or bot ID.
|
|
8344
|
+
* @param tag The name of the tag that the trigger locations should be listed for.
|
|
8345
|
+
*/
|
|
8346
|
+
listCommonPauseTriggers(botOrId: Bot | string, tag: string): PossibleTriggerLocation[];
|
|
8347
|
+
|
|
8348
|
+
/**
|
|
8349
|
+
* Resumes the debugger execution from the given pause.
|
|
8350
|
+
* @param pause The pause state that execution should be resumed from.
|
|
8351
|
+
*/
|
|
8352
|
+
resume(pause: DebuggerPause): void;
|
|
8112
8353
|
|
|
8113
8354
|
/**
|
|
8114
8355
|
* Removes tags from the given list of bots.
|
|
@@ -8211,63 +8452,6 @@ interface Debugger {
|
|
|
8211
8452
|
*/
|
|
8212
8453
|
updateBotLinks(bot: Bot, idMap: Map<string, string | Bot> | { [id: string]: string | Bot }): void
|
|
8213
8454
|
|
|
8214
|
-
/**
|
|
8215
|
-
* Shouts the given events in order until a bot returns a result.
|
|
8216
|
-
* Returns the result that was produced or undefined if no result was produced.
|
|
8217
|
-
* @param eventNames The names of the events to shout.
|
|
8218
|
-
* @param arg The argument to shout.
|
|
8219
|
-
*/
|
|
8220
|
-
priorityShout(eventNames: string[], arg?: any): any;
|
|
8221
|
-
|
|
8222
|
-
/**
|
|
8223
|
-
* Asks every bot in the inst to run the given action.
|
|
8224
|
-
* In effect, this is like shouting to a bunch of people in a room.
|
|
8225
|
-
*
|
|
8226
|
-
* @param name The event name.
|
|
8227
|
-
* @param arg The optional argument to include in the shout.
|
|
8228
|
-
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
8229
|
-
*
|
|
8230
|
-
* @example
|
|
8231
|
-
* // Tell every bot to reset themselves.
|
|
8232
|
-
* shout("reset()");
|
|
8233
|
-
*
|
|
8234
|
-
* @example
|
|
8235
|
-
* // Ask every bot for its name.
|
|
8236
|
-
* const names = shout("getName()");
|
|
8237
|
-
*
|
|
8238
|
-
* @example
|
|
8239
|
-
* // Tell every bot say "Hi" to you.
|
|
8240
|
-
* shout("sayHi()", "My Name");
|
|
8241
|
-
*/
|
|
8242
|
-
shout(name: string, arg?: any): any[];
|
|
8243
|
-
|
|
8244
|
-
/**
|
|
8245
|
-
* Asks the given bots to run the given action.
|
|
8246
|
-
* In effect, this is like whispering to a specific set of people in a room.
|
|
8247
|
-
*
|
|
8248
|
-
* @param bot The bot(s) to send the event to.
|
|
8249
|
-
* @param eventName The name of the event to send.
|
|
8250
|
-
* @param arg The optional argument to include.
|
|
8251
|
-
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
8252
|
-
*
|
|
8253
|
-
* @example
|
|
8254
|
-
* // Tell all the red bots to reset themselves.
|
|
8255
|
-
* whisper(getBots("#color", "red"), "reset()");
|
|
8256
|
-
*
|
|
8257
|
-
* @example
|
|
8258
|
-
* // Ask all the tall bots for their names.
|
|
8259
|
-
* const names = whisper(getBots("scaleZ", height => height >= 2), "getName()");
|
|
8260
|
-
*
|
|
8261
|
-
* @example
|
|
8262
|
-
* // Tell every friendly bot to say "Hi" to you.
|
|
8263
|
-
* whisper(getBots("friendly", true), "sayHi()", "My Name");
|
|
8264
|
-
*/
|
|
8265
|
-
whisper(
|
|
8266
|
-
bot: (Bot | string)[] | Bot | string,
|
|
8267
|
-
eventName: string,
|
|
8268
|
-
arg?: any
|
|
8269
|
-
): any;
|
|
8270
|
-
|
|
8271
8455
|
/**
|
|
8272
8456
|
* Shouts the given event to every bot in every loaded simulation.
|
|
8273
8457
|
* @param eventName The name of the event to shout.
|
|
@@ -8837,6 +9021,198 @@ interface Debugger {
|
|
|
8837
9021
|
perf: Perf;
|
|
8838
9022
|
}
|
|
8839
9023
|
|
|
9024
|
+
/**
|
|
9025
|
+
* Defines an interface that represents a debugger.
|
|
9026
|
+
*/
|
|
9027
|
+
interface Debugger extends DebuggerBase {
|
|
9028
|
+
/**
|
|
9029
|
+
* Creates a new bot and returns it.
|
|
9030
|
+
* @param parent The bot that should be the parent of the new bot.
|
|
9031
|
+
* @param mods The mods which specify the new bot's tag values. If given a mod with no tags, then an error will be thrown.
|
|
9032
|
+
* @returns The bot(s) that were created.
|
|
9033
|
+
*
|
|
9034
|
+
* @example
|
|
9035
|
+
* // Create a red bot without a parent.
|
|
9036
|
+
* let redBot = create(null, { "color": "red" });
|
|
9037
|
+
*
|
|
9038
|
+
* @example
|
|
9039
|
+
* // Create a red bot and a blue bot with `this` as the parent.
|
|
9040
|
+
* let [redBot, blueBot] = create(this, [
|
|
9041
|
+
* { "color": "red" },
|
|
9042
|
+
* { "color": "blue" }
|
|
9043
|
+
* ]);
|
|
9044
|
+
*
|
|
9045
|
+
*/
|
|
9046
|
+
create(...mods: Mod[]): Bot | Bot[];
|
|
9047
|
+
|
|
9048
|
+
/**
|
|
9049
|
+
* Destroys the given bot, bot ID, or list of bots.
|
|
9050
|
+
* @param bot The bot, bot ID, or list of bots to destroy.
|
|
9051
|
+
*/
|
|
9052
|
+
destroy(bot: Bot | string | Bot[]): void;
|
|
9053
|
+
|
|
9054
|
+
/**
|
|
9055
|
+
* Shouts the given events in order until a bot returns a result.
|
|
9056
|
+
* Returns the result that was produced or undefined if no result was produced.
|
|
9057
|
+
* @param eventNames The names of the events to shout.
|
|
9058
|
+
* @param arg The argument to shout.
|
|
9059
|
+
*/
|
|
9060
|
+
priorityShout(eventNames: string[], arg?: any): any;
|
|
9061
|
+
|
|
9062
|
+
/**
|
|
9063
|
+
* Asks every bot in the inst to run the given action.
|
|
9064
|
+
* In effect, this is like shouting to a bunch of people in a room.
|
|
9065
|
+
*
|
|
9066
|
+
* @param name The event name.
|
|
9067
|
+
* @param arg The optional argument to include in the shout.
|
|
9068
|
+
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
9069
|
+
*
|
|
9070
|
+
* @example
|
|
9071
|
+
* // Tell every bot to reset themselves.
|
|
9072
|
+
* shout("reset()");
|
|
9073
|
+
*
|
|
9074
|
+
* @example
|
|
9075
|
+
* // Ask every bot for its name.
|
|
9076
|
+
* const names = shout("getName()");
|
|
9077
|
+
*
|
|
9078
|
+
* @example
|
|
9079
|
+
* // Tell every bot say "Hi" to you.
|
|
9080
|
+
* shout("sayHi()", "My Name");
|
|
9081
|
+
*/
|
|
9082
|
+
shout(name: string, arg?: any): any[];
|
|
9083
|
+
|
|
9084
|
+
/**
|
|
9085
|
+
* Asks the given bots to run the given action.
|
|
9086
|
+
* In effect, this is like whispering to a specific set of people in a room.
|
|
9087
|
+
*
|
|
9088
|
+
* @param bot The bot(s) to send the event to.
|
|
9089
|
+
* @param eventName The name of the event to send.
|
|
9090
|
+
* @param arg The optional argument to include.
|
|
9091
|
+
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
9092
|
+
*
|
|
9093
|
+
* @example
|
|
9094
|
+
* // Tell all the red bots to reset themselves.
|
|
9095
|
+
* whisper(getBots("#color", "red"), "reset()");
|
|
9096
|
+
*
|
|
9097
|
+
* @example
|
|
9098
|
+
* // Ask all the tall bots for their names.
|
|
9099
|
+
* const names = whisper(getBots("scaleZ", height => height >= 2), "getName()");
|
|
9100
|
+
*
|
|
9101
|
+
* @example
|
|
9102
|
+
* // Tell every friendly bot to say "Hi" to you.
|
|
9103
|
+
* whisper(getBots("friendly", true), "sayHi()", "My Name");
|
|
9104
|
+
*/
|
|
9105
|
+
whisper(
|
|
9106
|
+
bot: (Bot | string)[] | Bot | string,
|
|
9107
|
+
eventName: string,
|
|
9108
|
+
arg?: any
|
|
9109
|
+
): any;
|
|
9110
|
+
|
|
9111
|
+
/**
|
|
9112
|
+
* Changes the state that the given bot is in.
|
|
9113
|
+
* @param bot The bot to change.
|
|
9114
|
+
* @param stateName The state that the bot should move to.
|
|
9115
|
+
* @param groupName The group of states that the bot's state should change in. (Defaults to "state")
|
|
9116
|
+
*/
|
|
9117
|
+
changeState(bot: Bot, stateName: string, groupName?: string): void;
|
|
9118
|
+
}
|
|
9119
|
+
|
|
9120
|
+
/**
|
|
9121
|
+
* Defines an interface that represents a debugger.
|
|
9122
|
+
*/
|
|
9123
|
+
interface PausableDebugger extends DebuggerBase {
|
|
9124
|
+
/**
|
|
9125
|
+
* Creates a new bot and returns it.
|
|
9126
|
+
* @param parent The bot that should be the parent of the new bot.
|
|
9127
|
+
* @param mods The mods which specify the new bot's tag values. If given a mod with no tags, then an error will be thrown.
|
|
9128
|
+
* @returns The bot(s) that were created.
|
|
9129
|
+
*
|
|
9130
|
+
* @example
|
|
9131
|
+
* // Create a red bot without a parent.
|
|
9132
|
+
* let redBot = create(null, { "color": "red" });
|
|
9133
|
+
*
|
|
9134
|
+
* @example
|
|
9135
|
+
* // Create a red bot and a blue bot with `this` as the parent.
|
|
9136
|
+
* let [redBot, blueBot] = create(this, [
|
|
9137
|
+
* { "color": "red" },
|
|
9138
|
+
* { "color": "blue" }
|
|
9139
|
+
* ]);
|
|
9140
|
+
*
|
|
9141
|
+
*/
|
|
9142
|
+
create(...mods: Mod[]): Promise<Bot | Bot[]>;
|
|
9143
|
+
|
|
9144
|
+
/**
|
|
9145
|
+
* Destroys the given bot, bot ID, or list of bots.
|
|
9146
|
+
* @param bot The bot, bot ID, or list of bots to destroy.
|
|
9147
|
+
*/
|
|
9148
|
+
destroy(bot: Bot | string | Bot[]): Promise<void>;
|
|
9149
|
+
|
|
9150
|
+
/**
|
|
9151
|
+
* Shouts the given events in order until a bot returns a result.
|
|
9152
|
+
* Returns the result that was produced or undefined if no result was produced.
|
|
9153
|
+
* @param eventNames The names of the events to shout.
|
|
9154
|
+
* @param arg The argument to shout.
|
|
9155
|
+
*/
|
|
9156
|
+
priorityShout(eventNames: string[], arg?: any): Promise<any>;
|
|
9157
|
+
|
|
9158
|
+
/**
|
|
9159
|
+
* Asks every bot in the inst to run the given action.
|
|
9160
|
+
* In effect, this is like shouting to a bunch of people in a room.
|
|
9161
|
+
*
|
|
9162
|
+
* @param name The event name.
|
|
9163
|
+
* @param arg The optional argument to include in the shout.
|
|
9164
|
+
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
9165
|
+
*
|
|
9166
|
+
* @example
|
|
9167
|
+
* // Tell every bot to reset themselves.
|
|
9168
|
+
* shout("reset()");
|
|
9169
|
+
*
|
|
9170
|
+
* @example
|
|
9171
|
+
* // Ask every bot for its name.
|
|
9172
|
+
* const names = shout("getName()");
|
|
9173
|
+
*
|
|
9174
|
+
* @example
|
|
9175
|
+
* // Tell every bot say "Hi" to you.
|
|
9176
|
+
* shout("sayHi()", "My Name");
|
|
9177
|
+
*/
|
|
9178
|
+
shout(name: string, arg?: any): Promise<any[]>;
|
|
9179
|
+
|
|
9180
|
+
/**
|
|
9181
|
+
* Asks the given bots to run the given action.
|
|
9182
|
+
* In effect, this is like whispering to a specific set of people in a room.
|
|
9183
|
+
*
|
|
9184
|
+
* @param bot The bot(s) to send the event to.
|
|
9185
|
+
* @param eventName The name of the event to send.
|
|
9186
|
+
* @param arg The optional argument to include.
|
|
9187
|
+
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
9188
|
+
*
|
|
9189
|
+
* @example
|
|
9190
|
+
* // Tell all the red bots to reset themselves.
|
|
9191
|
+
* whisper(getBots("#color", "red"), "reset()");
|
|
9192
|
+
*
|
|
9193
|
+
* @example
|
|
9194
|
+
* // Ask all the tall bots for their names.
|
|
9195
|
+
* const names = whisper(getBots("scaleZ", height => height >= 2), "getName()");
|
|
9196
|
+
*
|
|
9197
|
+
* @example
|
|
9198
|
+
* // Tell every friendly bot to say "Hi" to you.
|
|
9199
|
+
* whisper(getBots("friendly", true), "sayHi()", "My Name");
|
|
9200
|
+
*/
|
|
9201
|
+
whisper(
|
|
9202
|
+
bot: (Bot | string)[] | Bot | string,
|
|
9203
|
+
eventName: string,
|
|
9204
|
+
arg?: any
|
|
9205
|
+
): Promise<any>;
|
|
9206
|
+
|
|
9207
|
+
/**
|
|
9208
|
+
* Changes the state that the given bot is in.
|
|
9209
|
+
* @param bot The bot to change.
|
|
9210
|
+
* @param stateName The state that the bot should move to.
|
|
9211
|
+
* @param groupName The group of states that the bot's state should change in. (Defaults to "state")
|
|
9212
|
+
*/
|
|
9213
|
+
changeState(bot: Bot, stateName: string, groupName?: string): Promise<void>;
|
|
9214
|
+
}
|
|
9215
|
+
|
|
8840
9216
|
/**
|
|
8841
9217
|
* Defines an interface that represents the set of additional options that can be provided when recording a file.
|
|
8842
9218
|
*/
|
|
@@ -10216,12 +10592,23 @@ interface Os {
|
|
|
10216
10592
|
* Creates a new debugger that can be used to test and simulate bots.
|
|
10217
10593
|
* @param options The options that should be used for the debugger.
|
|
10218
10594
|
*/
|
|
10219
|
-
createDebugger(options?:
|
|
10595
|
+
// createDebugger(options?: PausableDebuggerOptions | NormalDebuggerOptions): Debugger;
|
|
10596
|
+
|
|
10597
|
+
/**
|
|
10598
|
+
* Creates a new pausable debugger that can be used to test and simulate bots.
|
|
10599
|
+
* @param options The options that should be used for the debugger.
|
|
10600
|
+
*/
|
|
10601
|
+
createDebugger(options: PausableDebuggerOptions): Promise<PausableDebugger>;
|
|
10220
10602
|
|
|
10603
|
+
/**
|
|
10604
|
+
* Creates a new debugger that can be used to test and simulate bots.
|
|
10605
|
+
* @param options The options that should be used for the debugger.
|
|
10606
|
+
*/
|
|
10607
|
+
createDebugger(options: NormalDebuggerOptions): Promise<Debugger>;
|
|
10221
10608
|
/**
|
|
10222
10609
|
* Gets the debugger that this script is currently running in.
|
|
10223
10610
|
*/
|
|
10224
|
-
getExecutingDebugger(): Debugger;
|
|
10611
|
+
getExecutingDebugger(): Debugger | PausableDebugger;
|
|
10225
10612
|
|
|
10226
10613
|
/**
|
|
10227
10614
|
* The global variables that are stored in the OS.
|