Create a free account to remove all ad content.

Author Topic:  Script Command Documentation  (Read 31851 times)

0 Members and 1 Guest are viewing this topic.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #100 on: January 20, 2016, 03:33:37 PM »
HUDText: Add/remove custom text element to the HUD.

HUDText [name] [player] [text] [x,y] [r,g,b,a] [scale] [rot]
HUDText [name] [player] [delete]

[name] - The name of the text element.
[player] - Indicates the element is only for the player. Omit to have the element created for all players.
[text] - The text to display.
[x,y] - The position of the text on the screen.
[r,g,b,a] - The color of the text.
[scale] - The size of the text. 1 = default, < 1 = smaller, > 1 = bigger. If this parameter is omitted, 1 is used.
[rot] - The rotation of the text. If this parameter is omitted, 0 is used.

Examples:

HUDText [name] [Hello] [900,100] [255,0,0,255]
This will create a text element with the name of 'name'. The element will be positioned at screen location 900, 100, it will show the text 'Hello'. The color will be solid green.

HUDText [name] [delete]
This will delete the HUDText element created above.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #101 on: January 20, 2016, 03:34:06 PM »
HasStatBonus: Queries player item stat bonuses.

HasStatBonus [skill] [compare] [count]

[skill] - Valid values are Health, Attack, Strength, Defence, Ranged, Looting.

Examples:

HasStatBonus [Defence] [>=] [1000]
Returns true if the players defence stat bonus is greather than or equal to 1000, otherwise returns false.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #102 on: February 03, 2016, 01:41:14 AM »
IsBlockResistance: Queries a blocks resistance (hardness) at a location. A blocks resistance is based on its material and can be viewed when prospecting the block.

IsBlockResistance [x,y,z] [compare] [count]

Examples:

IsBlockResistance [150,200,300] [>=] [1000]
Returns true if the block at location 150,200,300 has a resistance of 1000 or greater.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #103 on: February 03, 2016, 04:37:09 AM »
IsBlockOpen: Queries if the block at a location is being accessed by a player.

IsBlockOpen [x,y,z] [true|false]

Examples:

IsBlockOpen [150,200,300]
IsBlockOpen [150,200,300] [true]
Returns true if the block at location 150,200,300 is being accessed by a player.

IsBlockOpen [150,200,300] [false]
Returns true if the block at location 150,200,300 is not being accessed by a player.

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
Re: Script Command Documentation
« Reply #104 on: February 11, 2016, 10:39:56 PM »
IsGamerCount: Queries the number of gamers in the session.

IsGamerCount [all|local|remote] [compare] [count]
IsGamerCount [zone] [all|local|remote] [compare] [count]
IsGamerCount [x,y,z] [radius] [all|local|remote] [compare] [count]
IsGamerCount [x,y,z] [x,y,z] [all|local|remote] [compare] [count]

[all] is the total number of players in the session (local + remote).
[local] is the number of players who are on the same xbox as the player who activated the script.
[remote] is the number of players who are not on the same xbox as the player who activated the script.

Examples:

IsGamerCount [>] [2]
Returns true if there are at least 3 gamers in the session.

IsGamerCount [local] [>] [1]
Returns true if there are more than 1 local players (split screen).

IsGamerCount [remote] [>] [0]
Returns true if there is at least 1 remote player (multiplayer).

IsGamerCount [township] [>] [0]
Returns true if there is at least 1 player inside the township zone.

IsGamerCount [township] [remote] [>] [0]
Returns true if there is at least 1 remote player inside the township zone.
« Last Edit: August 12, 2016, 04:58:02 AM by Craig »

Craig

  • Developer
  • Extreme Member
  • *
  • Posts: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
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: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
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 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].

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] = [rand:3]
Assigns a random value between 0 and 3 inclusive to the variable [r], i.e. either 0, 1, 2 or 3.

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: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
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: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
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: 6655
  • Dig Deep
    • View Profile
    • Twitter
  • Steam: tota1miner
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 »