RLInterpreter

A simple interpreter for the Registry Language (RL). This language is designed to be passed and run to operate on the registry values here. It is interpreted so players can write text that gets executed and controls operations in Minecraft... nifty idea huh? For example, writing some simple scripts to control conversation control in MOCConv or other things.

Examples:
GT, LT, EQ, GTE, LTE, NOT, ISSET

  • I.e. Is the value of the key > 5? : GT(5,$curr)
  • I.e. Is the value set? : ISSET
  • I.e. Is the value at "A" less than the current value : GT($A,$cur)
  • I.e. Increment the value : INC($cur) or INC
  • I.e. Add 5 to the current value: +5

These types of logic are also possible...
IF ( GT($a,5), 1, 0)
IF ( ISSET($a:b), INC($a:b), SET($a:b,1) )

Operations

Variables : $v or $$p:w:n:v
Variable value with 'v' being the variable name, 'n' the namespace, 'w' the world and 'p' the player name. Default values, using "_" are used if not specified. ex. $a refers to the variable 'a' of the current player, world and namespace; $$cwingrav:Leocius:MOCConvo:a refers to the player 'cwingrav' in world 'Leocius' of namespace 'MOCConvo' and variable 'a'. Additionally, $$_:_:_:a refers to the same, if the default values or cwingrav, Leocius, MOCConvo.
Comparison operators : GT or GTE or LT or LTE or EQ or NOT
Compare two values for >, >=, <, <=, == or !. ex. if $a=1 and $b=2 and $c=3, then GT($a,$b) is 0, LT($b,$c) is 1 and NOT(GT($a,$b) is 1.
++$v
Increment the variable 'v'
INC($cur) or INC($A)
Increment a value using the current tuple.
ISSET
Determines if the given value has been set. 1 if true, 0 if false. So, if $a is 1 and $b has not been set, ISSET($a) is 1 and ISSET($b) is 0.
SET($var,$value)
Sets the given variable to the value. ex. SET($t,ADD($t,$tt))
ADD($value1,$value2) or SUB($value1,$value2)
Adds or subtracts. ex. ADD($t,$tt)
MAX($value1,$value2) or MIN($value1,$value2)
Returns the max or the minimum value. ex. MAX(5,ADD($t,$tt))


Future


Comments

Posts Quoted:
Reply
Clear All Quotes