TRIGEDIT-VARIABLES-TEXTS

building

Also known as: TEXT-VAR · %ARG% · CDR · CAR · ARG.CDR · %ARG.CDR% · %CMD.CDR% · CMD.CDR · ARG.CAR · CMD.CAR · CAR · %ARG.CAR% · %CMD.CAR% · %TEXT% · PUSH · CMD · %CMD% · %CDR% · %CAR% · %TRIM% · TRIGEDIT-TEXT-VAR · %STRLEN% · CDR · STRLEN · STRING-LENGTH · STRINGLENGTH · CONTAINS · %CONTAINS% · CHAR

T Text Variable Fields These fields pertain to any variable that contains a string of text. These are often the variables, such as %speech%, which are provided to a trigger, but can also be variables that have been created by the trigger, such as %room.north% When using field - The variable returns strlen - Returns the number of characters in the string. trim - Returns the string without any leading or trailing whitespace. This is used to trim extra spaces from the beginning or end of a string. car - Returns the first word of the string. For %text%="this is the string"; %text.car% will yield "this". TSTAT 53 cdr - Returns all but the first word of the string, trimmed. For %text%= "this is the string"; %text.cdr% will yield "is the string". contains() - Used to check if a string contains the subfield text. mudcommand - Returns the mud command the string is shorthand for. Used to make sure the command you react to is the one you want: For %text%="o" %text.mudcommand% will yield "open". HELP MUDCOMMAND charat - set new variable %text/var.charat(index)% i.e. set phrase testing, set var1 %phrase.charat(2)% now %var1% == e Example: TSTAT 30