abCore
abCore Helper Variables
ab
References the ab.core.learn bot, which handles management of AB skill sets and initialization.
abRemember
References the ab.config.remember bot, which holds on to inst specific data for abCore (i.e. abAwakeState
, abBotSnapState
, abBaseColor
, etc).
abSearch
References the ab.shell.search bot, which handles various aspects of looking up records and files.
abStore
References the ab.shell.store bot, which has several interfaces for initiating uploads via AB.
abCore Functions
shout("abPublishAB", options); || whisper(abStore, "abPublishAB", options);
Publishes a file and associates it with the egg record addressed to the specified app bundle (ab). Returns a boolean based on success or failure.
let options: {
/**
* The ab ID of the egg you would like associated with the app bundle.
*/
ab: "string";
/**
* The key used to encrypt/decrypt the file data.
* If omitted, then the file will be unencrypted.
*/
key?: "string";
/**
* If set to true, will make the egg publicly readable
*/
publicFacing?: boolean;
/**
* The bot(s) to publish in the file.
* If omitted, then all non AB bots in the shared space will be used.
*/
target?: [array];
};
Examples
let myAB = shout("abPublishAB",{
ab: "myABID"
});
let myAB = whisper(abStore,"abPublishAB",{
ab: "myABID",
key: "myPassword"
});
let myBot = getBot("myBotTag");
let myAB = await whisper(abStore,"abPublishAB",{
ab: "myABID",
target: myBot
});
os.toast(myAB);
shout("hatch", {abID: abID, recordKey: studio, key: key, autoHatch: boolean, returnType: data/null, eggParameters: arg});
Allows the user to look up and/or hatch an egg.
let options: {
/**
* The ab that you want loaded.
*/
abID : "string";
/**
* This is the studio that the egg record and file is held in.
* If not included, will use the authBot id (the player studio).
*/
recordKey?: "string";
/**
* Desired key for optional encryption.
*/
key?: "string";
/**
* If set to true, will automatically hatch the ab into the current experience.
*/
autoHatch?: boolean;
/**
* If set to data, will return the ab as data instead of as an egg or bots.
*/
returnType?: "data";
/**
* This is an argument that will be passed through to the ab bots inside of onEggHatch.
*/
eggParameters?: "string or object";
};
Examples
let getEgg = shout("onLookupabEggs",{
abID: "myABID"
});
let hatchEgg = whisper(abRecordSearch, "onLookupabEggs",{
abID: "myABID",
key: "myPassword",
autoHatch: true
});
let abData = whisper(abRecordSearch, "onLookupabEggs",{
abID: "myABID",
returnType: "data"
});
console.log(abData)
shout("focus", {bot: bot, position: {x: number, y: number}, duration: number, zoom: number, rotation: object, easing: {type: string, mode: string}});
A helper function to more easily interface with os.focusOn()
. Please see documentation for os.focusOn()
for optional options.
let options: {
/**
* The the bot that the camera should move to.
*/
bot?: bot;
/**
* The position that the camera should move to.
* Only used if no bot is provided.
*/
position?: object;
};
shout("showConsole");
A shout to open the abCore chat log.
shout('hideConsole');
A shout to close the abCore chat log.
abCore Listener Tags
onABInitialized
A superShout sent out when AB has finished booting.
let that = {
inst: "inst AB booted in"
};
onEggHatch
A whisper that is sent to any bots that are hatched (manually or automatically) from an ab.
let that = {
ab: "egg name",
version: "egg version number",
inst: "inst it was hatched in",
eggParameters: "any arguments passed in via hatch()"
};
onPreHatch
A shout that is sent after an ab has been added, but before the ab origin tag has been assigned. Allows for manual determiniation of full boot up if returned true.
onAbAdded
A superShout that occurs anytime an ab is added to the inst.
let that = {
ab: "ab name",
version: "ab version number",
inst: "inst it was hatched in"
};
onAbPublished
A superShout sent out when an ab is published.
let that = {
success: boolean,
ab: "string",
fileAddress: "string"
};
abCore Settings Tags
abIgnore
Tag that when set to 'true' will not be included in a general publish or download of an inst.
abBotSnapState
By default, AB sets an os.addDropSnap (face) on any bot that is being dragged.
This can be turned off/on either through the AB self select or by directly manipulating the variable on abRemember
.
Examples
abRemember.tags.abBotSnapState = false;
abRemember.tags.abBotSnapState = "face";
baseAB
A tag on the abRemember that rememembers the original pattern loaded (if hatched through the URL parameters).
abGridSnapState
By default, AB sets an os.addDropSnap (grid) on any bot that is being dragged.
This can be turned off/on either through the AB self select or by directly manipulating the variable on abRemember
.
Examples
abRemember.tags.abGridSnapState = false;
abRemember.tags.abGridSnapState = true;
AB URL Variables
pattern
When set as a variable in the URL and opening the inst for the first time, this will automatically load the specified ab from records using either the defined studio or the authBot id.
studio
When set in the URL, this will be used to load any patterns unless otherwise directed.
key
When set as a variable in the URL, allows for automatic opening of the matching encrypted ab.
abVersion
Can be used to target a specific version of an egg/ab when using pattern in the URL.
prompt
Can be used to replace the default ask prompt in AB.
ask
A global pattern containing specific public patterns. Will behave like the pattern
variable if no global pattern is found.
Nuggets
abNugget / nuggets
This is a skill inside of AB that allows loading and publishing of code snippets while in the sheet, tag, or system portal. It utilizes the codeButton form to offer several options to users while scripting in a tag. This skill is present but not active when loading AB in a development environment.
{}
To load a nugget, you can put the name of a nugget (no spaces) inside a set of brackets. Adding a period and v with a number to the end of the nugget name (.v#) allows the user to specify the version of the nugget that they would like to load.
Examples
{hello}//loads the latest version of hello
{hello.v1} //loads hello version 1
.nug {}
To publish a nugget, you use a similar format to loading with the addition of .nug and a space before it. Then, using the cursor, highlight the segment you wish to publish. With it still highlighted, presse the codeButton.
.nug {myNugget}
AB Chat Commands
.sleep
Put AB in a sleep state (default state when a pattern is loaded).
..
Put AB in an awake state (listening).
.system
Open the system portal.
.sheet
Open sheet portal for currently active grid or map portal.
.menuSheet
Open sheet portal for active menu portal.
.download
Use AB's download function.
.upload
Open and upload a file via a file picker.