scripting
For the developer API, click here
Scripting is used to create custom placeholders (i.e. the stuff in the "script" folder). Remember that updating custom placeholders will take a lot longer than the ones coded in, so if you think other people might find it useful, send me a PM or use the TICKETS tab to request it.
Scripts can be found as a ".yml" file inside the "scripts" folder for IH
script: - "if {itemid} = 10" - "return AAH LAVA!" - "else" - "return Hi"
Additional Placeholders
In custom placeholders, you can now have modifiers e.g. putting {example:A:B:C} on a Hologram
These modifiers will replace the following placeholders:
- {arg1}
- {arg2}
- etc.
For example:
- {arg1} will return A for the custom placeholder {example:A:B:C}
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) =~ (equals string, case insensitive) = (equals, case sensitive) > (greater than, or longer than) < (less than, or shorter than) && (and statement) || (or statement)
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