Author Topic:  Script Command Documentation  (Read 24055 times)

0 Members and 1 Guest are viewing this topic.

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6501
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: Script Command Documentation
« Reply #105 on: July 06, 2016, 10:25:09 PM »
SetSphere: Creates a sphere of blocks.

SetSphere [x,y,z] [radius] [block]
SetSphere [x,y,z] [radius] [block] [percent] [seed]

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6501
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: Script Command Documentation
« Reply #106 on: July 11, 2016, 11:58:45 PM »
Var: Create a variable and assign it a value.

var [name] [name]...[name]
var [name] = [value] op [value]...op [value]

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.

[op] Operators:
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus

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.
[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].

var [poison] = [5] * [toxicity] + [20]
Assigns it the value of 5 * toxicity + 20 = 5 * 10.5 + 20 = 72.5 to the variable [poison].

var [str] = [history:str]
Assigns the value from the players 'str' history to the variable [str].

var [str] = [syshistory:str]
Assigns the value from the system 'str' history to the variable [str].

var [str] = [clanhistory:str]
Assigns the value from the 'str' clan history to the variable [str].

var [r] = [1000] + [rand:1000]
Assigns a random value between 1000 - 2000 to the variable [r].

var [h] = [health:]
Assigns the players current health value to the variable [h].

var [h] = [maxhealth:]
Assigns the players current max health value to the variable [h].

var [x] = [pos:x]
Assigns the players current X position to the variable [x].

var [level] = [skill:Cooking]
Assigns the players current cooking skill level to the variable [level].

var [xp] = [skillxp:Mining]
Assigns the players current mining skill xp to the variable [xp].

var [count] = [inv:grass]
Assigns the number of grass blocks in the players inventory to the variable [count].

var [count] = [inv:[goldpieces][x,y,z]]
Assigns the number of gold pieces in the chests inventory at location x,y,z to the variable [count].

var [d] = [distance:[x1,y1,z1][x2,y2,z2]]
Assigns the distance between positions [x1,y1,z1] and [x2,y2,z2] to the variable [d].

var [count] = [gamercount:remote]
Assigns the number of remote gamers in the session to the variable [count].

var [count] = [mobcount:[none][prel:0,0,0][20]]
Assigns the number of mobs within a 20 block radius of the player to the variable [count].

var [count] = [mobcount:[spider][100,110,120][200,210,220]]
Assigns the number of spiders within the [100,110,120][200,210,220] region to the variable [count].

var [HealthAsPerc] = [health:] / [maxhealth:] * [100]
Assigns the players current health as a percentage of max health to the variable [HealthAsPerc].
« Last Edit: August 02, 2016, 05:00:56 AM by Craig »

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6501
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: Script Command Documentation
« Reply #107 on: July 12, 2016, 06:21:51 PM »
IsVar: Queries the value of a variable

IsVar [name] [compare] [value]

[value] - A numeric literal or another variable.

Examples:

IsVar [mana] [>] [5.2]
Returns true if the value of the variable called 'mana' is greater than 5.2.

IsVar [focus] [=] [100]
Returns true if the value of the variable called 'focus' is equal to 100.

IsVar [profit] [<] [loss]
Returns true if the value of the variable called 'profit' is less than the value of the variable called 'loss'.

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6501
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: Script Command Documentation
« Reply #108 on: July 15, 2016, 03:14:36 AM »
Blueprint: Customize an items crafting blueprint.

Blueprint [item:qty] [craft|furnace:time] [slot:item:qty:dur]..[slot:item:qty:dur] [skill=x] [level=x]

[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.

Examples:

Blueprint [Revolver]
Disables the crafting of a Revolver.

Blueprint [Revolver] [SteelIngot] [Stick]
Allows workbench crafting of a Revolver by placing a steel ingot bottom left, and a stick bottom center. Crafting skill level 1 is required.

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.

Blueprint [Blue:2] [4:Wood:3] [BlueBox:5] [9:Feather]
Allows workbench crafting of 2 Blue blocks by placing 3 Wood blocks middle left, 5 BlueBox blocks middle center, and a Feather top right.

Blueprint [ColorGreen] [furnace] [Basalt] [Leaves]
Allows furnace smelting of 1 Green block from Basalt and Leaves. Smelt time defaults to 4.5 seconds.

var [time] = [2.5]
Blueprint [ColorGreen] [furnace:time] [Basalt] [Leaves]
Allows furnace smelting of 1 Green block from Basalt and Leaves. Smelt time is 2.5 seconds.
« Last Edit: August 12, 2016, 04:30:35 AM by Craig »

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6501
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: Script Command Documentation
« Reply #109 on: July 15, 2016, 06:18:59 AM »
Item: Customize an items properties

[Item] [enable|disable] [name=x] [desc=x] [durability=x] [skill=x] [level=x] [health=x] [strength=x] [attack=x] [defence=x] [ranged=x] [looting=x] [damage=x] [reach=x] [speed=x] [delay=x]

[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.

Examples:

Item [Bullet] [disable]
Disable the Bullet item.

Item [Revolver] [name=Musket] [desc=A Muskateers best friend.] [durability=1000]
Renames the Revolver to Musket, changes it's description, and sets it's durability to 1000.

Item [Revolver] [name=Musket] [desc=A Muskateers best friend.] [skill=cooking] [level=12] [health=200]
Renames the Revolver to Musket and changes it's description. The musket requires a cooking level of 12 to use. The musket has a health bonus stat of 200 points.
« Last Edit: August 12, 2016, 04:39:43 AM by Craig »

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6501
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: Script Command Documentation
« Reply #110 on: July 20, 2016, 11:49:06 PM »
Input: Prompt the player to enter a number.

Input [var]

[var] name of the variable to store the number entered.

Examples:

Input [count]
Prompts the player to enter a number. Once the number is entered, the variable named 'count' contains the number.

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6501
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: Script Command Documentation
« Reply #111 on: August 12, 2016, 05:01:35 AM »
IsLight: Queries the quantity of light at a location.

IsLight [x,y,z] [sun|moon|block] [compare] [count]

Examples:

IsLight [150,200,300] [>] [5]
IsLight [150,200,300] [sun|moon|block] [>] [5]
Returns true if location 150,200,300 has either a sun, moon or a light level greater than 5.

IsLight [100,200,300] [sun] [<] [10]
Returns true if location 100,200,300 has a sunlight level of less than 10.

IsLight [100,200,300] [moon|block] [=] [12]
Returns true if location 100,200,300 has either moon light or block light that equals 12.

Craig

  • Developer
  • Extreme Member
  • ******
  • Posts: 6501
  • Dig Deep
  • Awards Developer 4 years on site+1000 posts 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Members who have unlocked the robotic avatar 1 year on site+100 posts Day 1 w/25+ posts (4/12/13)
    • View Profile
    • Twitter
    • Awards
Re: Script Command Documentation
« Reply #112 on: August 20, 2016, 09:36:45 PM »
IsInZone: Queries if the player is in a zone.

This command is only supported from Version 2.5.

IsInZone [Spawn|NoEdit|NoPvP|NoFly|NoMobs|NoEscape] [true|false]

Specify one or more types of zone types.

Examples:

IsInZone [NoEdit|NoPvP]
IsInZone [NoEdit|NoPvP] [true]
Returns true if the player is in a no edit and no pvp zone.

IsInZone [Spawn] [false]
Returns true if the player is not in a spawn zone.