There are two forms of the var command. One declares one or more variable names, the other assigns a value to a single variable, based on an expression.

[name] - The name of the variable. Variable names cannot have spaces or contain any of the following characters: :~`!@#$%^&*()-=+|\\/?<>,.Variable names cannot be one of the following: var, true, false, on, off, player, clan, history, syshistory, clanhistory, health, maxhealth, reach.Variable names are not case sensitive.

[value] op [value]...op [value] - An expression made up of one or more values and operators. Operators do not need to be surrounded by square brackets.[value] may be a numeric literal, another variable or a built in value type as listed below.

Built in [value] types:Note: All built in value type names must be succeeded by a : colon before the closing square bracket, even if they don't have parameters.Note: If the built in value type requires more than one parameter, then all of it's parameters must be enclosed in square brackets.[Abs:x] - The absolute value of x.[Sin:x] - The sine of x.[Cos:x] - The cosine of x.[Tan:x] - The tangent of x.[Single:x] - x converted to single precision.[Clock:] - The current clock.[Health:] - The players current health.[MaxHealth:] - The players current max health.[Reach:] - The players current reach.[Pos:x|y|z] - The players current X, Y or Z position.[Vel:x|y|z] - The players current X, Y or Z velocity.[View:x|y|z] - The players current X, Y or Z view direction.[Rel:x|y|z] - The scripts relative block X, Y or Z.[PRel:x|y|z] - The players block position X, Y or Z.[CRel:x|y|z] - The players cursor X, Y or Z.[Script:x|y|z] - The scripts X, Y or Z offset.[Skill:x] - The players current skill level.[Skillxp:x] - The players current skill xp.[Rand:x] - A random number between 0 - x inclusive.[History:key] - The value of the player history [key].[SysHistory:key] - The value of the system history [key].[ClanHistory:key] - The value of the clan history [key].[Inv:[Item][x,y,z]] - Inventory. If x,y,z is omitted, player inventory is used.[Distance:[x,y,z][x,y,z]] - Get the distance between the two points.[GamerCount:all|local|remote] - Get the number of gamers in the world.[GamerCount:[all|local|remote][x,y,z][x,y,z]] - Get the number of gamers in a cubic area.[GamerCount:[all|local|remote][x,y,z][radius]] - Get the number of gamers in a spherical area.[MobCount:MobType] - Get the number of mobs in the world.[MobCount:[MobType][x,y,z][x,y,z]] - Get the number of mobs in a cubic area.[MobCount:[MobType][x,y,z][radius]] - Get the number of mobs in a spherical area.

Differences between variables and history:* Variables can be used anywhere a numeric literal can be used. History cannot.* Variables can be calculated using math expressions and built in values: History cannot.* Variables only exist during the execution of the script: History is persistent.* Variables are local to the script instance: History is global to all scripts/instances.* Variables support fractional numbers: History supports whole (integer) numbers only.

Examples:

var [velx] [vely] [velz] [length] [distance] [dir]Declares 6 variable names. If these variables have not been passed from a calling script, they are assigned a value of zero.All variables used in a script must be at least declared and optionally assigned to before they are used.Variables can be declared anywhere in the script, as long as it is before they are used.

var [toxicity] = [10.5]Assigns the value of 10.5 to the variable [toxicity].

[item:qty] - The product item and qty of the craft. Qty is optional. If omitted, a qty of 1 is used.

[slot:item:qty:dur] - The craft grid slot, item id, qty and durability of a material used in the craft. Slot must be a number from 1 to 9. 1=bottom left, 2=bottom center, 3=bottom right, 4=middle left,6=middle right,7=top left, 9=top right. Slot can only be 1-3 for furnace items. Slot is optional. If Slot is omitted it will default to the previous slot + 1, starting with 1. Qty is optional, if omitted a qty of 1 is used. Durability is optional, if omitted, 0 is used.

[craft|furnace:time] - Whether the item is crafted in the workbench or furnace. Time = smelt time in furnace. This parameter is optional and can be omitted. Time is also optional and can be omitted. If time is omitted, the items current smelt time is used. If the item currently does not have a smelt time, then a smelt time of 4.5 seconds is used.

[skill=x] - This skill type used for crafting. This parameter is option and can be omitted.[level=x] - The required skill level to craft the item. This parameter is option and can be omitted.

Blueprint customizations via this command are not saved. Blueprints will be reset to default on a world reload.Note: Only items currently craftable can be customized. i.e. You cannot add a blueprint for an item which does not already have a blueprint.

Blueprint [Revolver] [SteelIngot] [Stick] [skill=smithing] [level=15]Allows workbench crafting of a Revolver by placing a steel ingot bottom left, and a stick bottom center. A Smithing level of 15 is required to craft the item.

[enable|disable] - Enable or disable the item (same as Item options screen). This parameter is optional and can be omitted.[name=x] - Rename the item. This parameter is optional and can be omitted.[desc=x] - Describe the item. This parameter is optional and can be omitted.[durability=x] - Set the items durability. This parameter is optional and can be omitted.[skill=x] - Set the skill type for using the item.[level=x] - Set the required skill level to use the item.[health=x] - Set the items health stat bonus. This parameter is optional and can be omitted.[strength=x] - Set the items strength stat bonus. This parameter is optional and can be omitted.[attack=x] - Set the items attack stat bonus. This parameter is optional and can be omitted.[defence=x] - Set the items defence stat bonus. This parameter is optional and can be omitted.[ranged=x] - Set the items ranged stat bonus. This parameter is optional and can be omitted.[looting=x] - Set the items looting stat bonus. This parameter is optional and can be omitted.[damage=x] - Set the items damage stat. This parameter is optional and can be omitted.[reach=x] - Set the items reach stat. This parameter is optional and can be omitted.[speed=x] - Set the items swing speed stat. This parameter is optional and can be omitted.[delay=x] - Set the items swing delay stat. This parameter is optional and can be omitted.

Item customizations via this command are not saved. Items will be reset to default on a world reload.