Scripting
Scripting can be done throughout the plugin, in game, with signs, or scheduling future tasks.
Logical keywords
These control the flow of logic in your script
if
- Accepts + - / * - Brackets can be used: if (1+2)*3 = 9 - Placeholders are evaluated Relations: != (does not equal) >= (greater than or equal to) <= (less than or equal to) =~ (will ignore case) = > < !
else
- Will trigger when an if statement returns false
e.g.
if {player} = bob hi notch else you aren't bob :(
endif
- Indicates what is inside a if/else statement
if true \it's true you know endif \I am no longer in the if statement
for
Can loop through a list, or just for a set amount of time
e.g. "for 10; do me test"
LISTS
- for i:1,2,3,4,5,6; do me {i}
- Some placeholders are lists e.g. {online}
- You can leave the "i" part blank if you don't want to set a temporary variable
endloop
- Indicates what is inside the for loop (and what is outside - after the endloop)
e.g.
for 10 \spam you are spamming endloop \I am no longer in the for loop and thus not spamming
Functional keywords
These things do stuff :p</p>
var
var myfirstvar 5+6
{myfirstvar}
Will print 11 to your chat ^
gvar
Basically the same as var, but it doesn't disappear when you are done.
do
Has the user execute a command
do spawn
^ will have you teleport to spawn
\
Will have you send a chat message
\This is a chat message
setuser
Will change the user to another online player.
setuser Notch {player}
Will print out Notch's name rather than yours
return
Will return a value - e.g. "return true"
Comments