ab-1
ab-1 Helper Variables
abRemember
References the instMemory bot, which holds on to inst specific data for ab-1 (i.e. ab-1 sleep state, bot snap state, and grid snap state).
abRecordSearch
References the search bot, which handles various aspects of looking up records.
abStore
References the publish bot, which has several interfaces for initiating uploads via ab-1.
ab-1 Functions
shout("abPublishAB", options); || whisper(abStore, "abPublishAB", options);
Publishes a file and associates it with the egg addressed to the specified abID. Returns a boolean based on success or failure.
let options: {
/**
* The abID 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";
/**
* The bot(s) to publish in the file.
* If omitted, then all non ab-1 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("abAddToFactory", options);
Adds a template bot, while consuming the target bot, to the abFactory menu.
let options: {
/**
* The bot to be added as a factory template.
*/
bot : bot;
/**
* The dimension that the target bot should be removed from.
*/
dimension: "string";
/**
* The id that the bot will be listed in the ab factory under.
*/
factoryID: "string";
};
Examples
let myFactoryTemplate = shout("abAddToFactory",{
bot: myBot,
dimension: "home",
factoryID: "myTemplate"
});
shout("abCreateFromFactory", options);
Adds a bot from a template in the abFactory.
let options: {
/**
* Mods to determine a dimension for the bot to manifest.
*/
position : {
/**
* The dimension that the target bot should be added to.
*/
dimension: "string";
/**
* The x position in the above specified dimension.
*/
x: number;
/**
* The y position in the above specified dimension.
*/
y: number;
}
};
Examples
let myFactoryTemplate = shout("abCreateFromFactory",{
factoryID: "myTemplate",
position: {
dimension: "home",
x: 0,
y: 0
}
});
shout("onLookupabEggs", {abID: abID, key: key, autoHatch: boolean, returnType: data/null});
Allows the user to search for and/or hatch an ab.
let options: {
/**
* The ab that you want loaded.
*/
abID : "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";
};
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)
ab-1 Specific Tags
onEggHatch
A whisper that is sent to any bots that are hatched (whether manually or automatically) from an ab.
let that = {
ab: "ab name",
version: "ab version number"
};
onPreHatch
A shout that is sent after an ab has been added, but before the ab-1 ab tag has been assigned. Allows for manual determiniation of full boot up if returned true.
onAbAdded
A shout that occurs anytime an ab is added to the inst.
let that = {
ab: "ab name",
version: "ab version number"
};
onABPublished
A shout sent out when an ab is published.
let that = {
ab: "string",
fileAddress: "string"
};
abIgnore
Tag that when set to 'true' will not be included in a general publish or download of an inst.
ab-1 Environment Tags
abBotSnapState
By default, ab-1 sets an os.addDropSnap (face) on any bot that is being dragged.
This can be turned off/on either through the ab-1 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 determines if the ab/autoLoad/auxCode has been loaded yet. Can be set by user using the "onConfirmHatch" shout and passing through the ab name.
abGridSnapState
By default, ab-1 sets an os.addDropSnap (grid) on any bot that is being dragged.
This can be turned off/on either through the ab-1 self select or by directly manipulating the variable on abRemember.
Examples
abRemember.tags.abGridSnapState = false;
abRemember.tags.abGridSnapState = true;
ab-1 URL Variables
ab
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.
key
When set as a variable in the URL, allows ab/autoLoad/auxCode to open an encrypted ab.
abVersion
Can be used to target a specific version of an ab when using ab/autoLoad/auxCode in the URL.
prompt
Can be used to replace the default ask prompt in ab-1.
Nuggets
abNugget
/ nuggets
This is a skill inside of ab-1 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-1 in a development environment.
{name}
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}