Skip to content

BBScript: BBScript 1

monopoisoner edited this page Jun 11, 2024 · 3 revisions

BBScript 1 (Deprecated)

BBScript 1 consists of a set of special BBCode tags which can interact with each other. Unlike other BBCode tags which serve as simple HTML substitues, BBScript 1 functions similarly to limited JavaScript scripts.

Usage

To use BBScript 1, make sure you follow the standard syntax. The site will attempt to determine which version the script is based on the syntax.

[script class=className on=click]
setText "hello world!"
[/script]

Syntax

BBScript 1 uses an operator first syntax, more often called Polish Notation. The operator or function name comes first before the arguments.

For example, setting a variable would be:

set numVar 2

BBScript 1 requires that each command is set on a new line. If multiple functions are required to occur in one script class, each function must be in its own line.

inc clickCount
setText "Clicked ${clickCount} times!"

Comments can be added by pre-pending the line with //.

// Hide the current code if it was displayed
hide csgcode

// Get the values and store them in variables
set name (getVal csgname)
set age (getVal csgage)
set description (getVal csgdescription)

Functions

BBScript 1 has functions that can be broadly categorized between the following: