Tag Types
CasualOS has many tags.
Tag Typesβ
Tags are pieces of data that are contained in bots. They are used to describe all sorts of properties about a bot, including how the bot looks, where it is visible, and what it does.
Each tag is made up of two parts: a name and a value.
The name is just that: a name. It describes what the value represents and makes the value easily accessible via scripting.
Tag values can be pretty much anything, and CasualOS is able to automatically understand some values based on how they are formatted.
For example, CasualOS knows that the string "true" represents the special boolean value true
.
When we're talking about the different formats that CasualOS automatically understands, we call them tag types.
Tag types are the kinds of data that CasualOS automatically understands and supports in built-in tags. Below, you can find a list of the various tag types and how CasualOS understands them.
In some sense, tag types are like how spreadsheet software can automatically detect different data formats and present them in a nice manner. However, unlike spreadsheet software, CasualOS always preserves the original tag values and simply inteprets the ones it understands. The interpreted values are used by built-in tags, but both are available to scripts.
Boolean Tagsβ
Boolean tags are tags whose value contains a boolean value. That is, either true
or false
.
Number Tagsβ
Number tags are tags whose value contains a number value. CasualOS currently supports the following number formats:
- Integer numbers
123
,-123
- Decimal numbers
1.23
,-1.23
.23
,-.23
- Scientific notation
1.23E2
,1.23E-2
,-1.23E2
,-1.23E-2
- Special numbers
Infinity
,-Infinity
- Tagged numbers
π’123
,π’-123
π’1.23
,π’-1.23
π’.23
,π’-.23
π’1.23E2
,π’1.23E-2
π’Infinity
,π’-Infinity
String Tagsβ
String tags are tags whose value contains a string value.
In CasualOS, tag values that aren't recognized as a number or boolean are treated as strings.
Basically, if the tag value is typed in by the user and doesn't look like a boolean or number and isn't started with a tag prefix (i.e. π’
for numbers, @
for scripts, π§¬
for mods, etc.), then the tag value is treated like a string.
In addition to this automatic behavior, CasualOS supports using the π
emoji to mark a tag value as a string.
This is useful in cases where you want the value to start with another prefix but don't want the tag to be interpreted as that tag type.
For example, if you want the text to be the word "true" but want the interpreted tag value to be a string instead of a number, you can set the tag value to πtrue
.
Mod Tagsβ
Mod tags are tags whose value is prefixed with π§¬
and contains a JSON value.
CasualOS interprets mod tags into JavaScript objects.
Mod tags are essentially a convienent way of storing JSON and having CasualOS automatically run the JSON.parse()
function on it.
Examplesβ
π§¬{
"firstName": "Bob",
"lastName": "Johnson",
"phoneNumber": "+15555555555"
}
Date Tagsβ
Date tags are tags whose value is prefixed with the π
emoji and contains date and time information.
Handling date and time information in JavaScript is complicated, so CasualOS tries to make this as easy as possible by integrating storage of date values.
When CasualOS runs across a date tag, it parses the date and converts it into a DateTime()
object for scripts to use.
CasualOS currently supports the following date formats:
- Formats that assume the UTC-0 time zone
π 2022
: Midnight January 1st on the given year (2022)π 2022-05
: Midnight on the 1st of the given month (May) and year (2022)π 2022-10-03
: Midnight on the given day (3rd), month (October), and year (2022)π 2022-10-03T07:30:00
: Given year (2022), month (October), day (3rd), hour (7), minute (30), and second (0)
- Formats that use the specified time zone
π 2022-10-03T07:30:00Z
: Given year (2022), month (October), day (3rd), hour (7), minute (30), and second (0) in the UTC-0 time zoneπ 2022-10-03T07:30:00-05:00
: Given year (2022), month (October), day (3rd), hour (7), minute (30), and second (0) in the UTC-5 time zone.π 2022-10-03T07:30:00 America/New_York
: Given year (2022), month (October), day (3rd), hour (7), minute (30), second (0), in the specified IANA time zone(America/New_York)π 2022-10-03T07:30:00-05:00 America/Chicago
: Given year (2022), month (October), day (3rd), hour (7), minute (30), second (0) in the UTC-5 timezone that is converted to the specified IANA time zone(America/Chicago)π 2022-10-03T07:30:00 local
: Given year (2022), month (October), day (3rd), hour (7), minute (30), and second (0) in the local time zone.π 2022-10-03T07:30:00-05:00 local
: Given year (2022), month (October), day (3rd), hour (7), minute (30), and second (0) in the UTC-5 timezone that is converted to the local time zone.
See the documentation on DateTime()
for information and examples on scripting.
Vector Tagsβ
Vector tags are tags whose value is prefixed with the β‘οΈ
emoji and represents a 2D or 3D point or direction.
In math, a vector simply a list of numbers, but in CasualOS a vector specifically refers either to a pair of numbers (representing a 2D vector) or a trio of numbers (representing a 3D vector).
When CasualOS runs across a vector tag, it parses the numbers and converts it into a Vector2
or Vector3
object depending on if it contains 2 or 3 numbers.
Vector tags are useful for easily setting the X, Y, and Z components of supported tags like #[dimension]Position
.
CasualOS currently supports the following vector formats:
- 2D vectors
β‘οΈ1,2
,β‘οΈ-1,-2
,β‘οΈ1.23,4.56
- 3D vectors
β‘οΈ1,2,3
,β‘οΈ-1,-2,-3
,β‘οΈ1.23,4.56,7.89
See the documentation on Vectors for more information and examples for scripting.
Rotation Tagsβ
Rotation tags are tags whose value is prefixed with the π
emoji and represents a 3D rotation or orientation.
In math, a rotation represents a change in orientation. This rotation can then be applied to vectors and bots to modify their orientation.
For an interactive explanation of rotations and quaternions, see this video.
When CasualOS runs across a rotation tag, it parses the numbers and converts it into a Rotation
object.
Rotation tags are useful for easily setting the X, Y, and Z components of supported tags like #[dimension]Rotation
.
CasualOS currently supports the following rotation format:
- Quaternion
π0,0,0,1
: Identity rotation (no rotation)π0.7071068,0,0,0.7071068
: 90 Degree rotation around the X axisπ0,0,0.7071068,0.7071068
: 90 Degree rotation around the Z axis
See the documentation on Rotations for more information and examples for scripting.
Script Tagsβ
Script tags are tags whose value is prefixed with the @
symbol and they represent JavaScript code that can be executed by CasualOS in response to user actions. (Like clicking a bot)
Script tags (also known as listeners) must be valid JavaScript code and can perform fairly arbitrary actions. This includes searching, creating and destroying bots, changing bot tags, showing messages to the user, making web requests, saving permanent records, and more.
Script tags that have one of the names listed here can be executed directly by CasualOS.
Additionally, it is possible to trigger scripts from other scripts using the shout(name, arg?)
and whisper(bot, name, arg?)
actions.
For a tutorial on scripting and the basics of CasualOS, check out the Pillars of Casual Simulation. Finally, you can check out the comprehensive list of actions that are supported in CasualOS.
/**
* The privacy-related features that a user can have access to.
*/
let privacyFeatures: {
/**
* Whether the user is allowed to publish data.
*/
publishData: boolean;
/**
* Whether the user is allowed to publish or access public data.
*/
allowPublicData: boolean;
/**
* Whether the user is allowed to access AI features.
*/
allowAI: boolean;
/**
* Whether the user is allowed to access public insts.
*/
allowPublicInsts: boolean;
}
Hidden Tagsβ
Hidden tags are tags that are hidden in the sheet by default.
You can make your own hidden tags by adding a _
(underscore) to the start of the tag.