This is a plugin I have been working diligently on. So far everything is working fabulously. I have been scripting an Adventure Dungeon with all new puzzles available due to the lack of wiring necessary and bypassing the limits of pistons by removing blocks altogether (or vice versa). Scriptable blocks only interfere with normal operation when they have set to do so.
Readme:
Code:
Video depicting possible creations due to scriptable blocks coming soon!
Readme:
Code:
portals.flat:
Flat-file storing button locations and scripts. Size varies on command script length.
Stone Buttons and Stone pressure plates are currently the only scriptable blocks. Destroying a block holding a scripting block (ultimately destroying the scripted blocks) will not destroy the portal, allowing players to place a button or plate that takes on the script of the previous block.
Alternatively, "rblk <world> <x> <y> <z> 0" can destroy the block without destroying the portal.
IMPORTANT: the use of $ on both ends of a variable prevents a shorter variable from overwriting
ex: $MyPlayer might get overwritten if a pre-existing variable $My existed
Forgetting the 2nd $ is a costly mistake!
%t - replaced in the initial script with the target players name
%w - replaced in the initial script with the target players world name
$var$ - replaced in scripts with the variable if it exists. exists as a string if not (fails < or > checks)
by technicality, this supports arrays...
*Note* %t and %w are replaced before $var$ is ("$%t$" will look for the variable $PlayerName$)
*Note* All commands are cross-world compatible
Commands:
Players:
/btn - scripts the next placed scriptable block as a teliporter to the destination suggested when typing the command
/btn <script> - script the next placed scriptable block with <script>
Server:
/add <script> - add script to the end of the target-blocks script (create if it does not exist)
/set <var> <val> ("set %t.score 0") will allow you to set $PlayerName.score$ as a variable to use in scripted commands.
/inc <var> <val> ("inc %t.score 1") will increase $PlayerName.score$ by 1 (will not work with non-integral variables).
/dec <var> <val> ("dec %t.score 1") will decrease $PlayerName.score$ by 1 (follows rules of !inc)
/sendplyr <string PlayerName> <string world_name> <double x> <double y> <double z> - teleports a player to a new location
*Note* teleporting using pressure-plates may kick the player from protected servers
/rblk <world> <x> <y> <z> <blockid|blockname> - replace a single block
/rcube <world> <x> <y> <z> <x2> <y2> <z2> <blockid|blockname> - replace all blocks from location 1 to location 2 in a 3 dimensional space
Scripts:
!break will stop the entire script from running.
!if <var1> eq <var2> true-command|false-command ("!if $%t.score$ < 5 kill %t|dec %t.score 5") will allow for a true-false command.
false-command not necessary ex: ("!if %t == PlayerName op %t;")
In said case, if the players score < 5, the player will be killed.
Adversely, it will decrease the players score by 5
*Note* If the variable was not set by another block, the value will null-out, doing nothing.
"!if $PlayerName.score$ < 5 kill PlayerName|dec PlayerName.score 5" rather than "!if 0 < 5 kill PlayerName|dec PlayerName.score 5"
"$PlayerName.score$" < "5" cannot parse because values are strings rather than integers
*Note* ";" cannot be used in an if-then-else statement to break commands
";" - signify end-line for a command, allowing infinite commands to run back-to-back
Updates:
set, inc, and dec have been changed to slash commands to allow their use in !if statements.
subsequently added to allow numerically limited multi-presses
ToDo:
/tmr <seconds> <scipt> - run a delay before activating a single script line
variables.flat - Flat-file storing variables and values
handle multiple if-true and if-false commands
ex: "!if $%t.score$ >= 100 inc %t.score 10;msg %t Perfect Bonus, 10 points!|inc %t.score 1;msg %t Not perfect, but you did well!"
replace unknown $var$s as "null"
increase number of scriptable blocks (doors, levers, etc)
convert commands pulled from alternative plugins to here
Video depicting possible creations due to scriptable blocks coming soon!