Category: Utility Lua-Based Scripts
Type: number
Notes: Used as a previous color argument value to the text color functions.
Type: number
Notes: Used as a previous color argument value to the text color functions.
Type: number
Notes: Used as a previous color argument value to the text color functions.
Type: number
Notes: Used as a previous color argument value to the text color functions.
Type: number
Notes: Used as a previous color argument value to the text color functions.
Type: number
Notes: Used as a previous text decoration argument value to the text decoration functions.
Type: number
Notes: Used as a previous text decoration argument value to the text decoration functions.
Return(s):
Argument(s):
- text: string
- Optional - previousColor: number
Notes: Colors the text appropriately. If previousColor is specified, the code will emit a transition to the specified color at the end of the formatted text.
Return(s):
Argument(s):
- text: string
- Optional - previousColor: number
Notes: Colors the text appropriately. If previousColor is specified, the code will emit a transition to the specified color at the end of the formatted text. If not, previousColor is assumed to be black.
Return(s):
Argument(s):
- text: string
- Optional - previousColor: number
Notes: Colors the text appropriately. If previousColor is specified, the code will emit a transition to the specified color at the end of the formatted text. If not, previousColor is assumed to be black.
Return(s):
Argument(s):
- text: string
- Optional - previousColor: number
Notes: Colors the text appropriately. If previousColor is specified, the code will emit a transition to the specified color at the end of the formatted text. If not, previousColor is assumed to be black.
Return(s):
Argument(s):
- text: string
- Optional - previousColor: number
Notes: Colors the text appropriately. If previousColor is specified, the code will emit a transition to the specified color at the end of the formatted text. If not, previousColor is assumed to be black.
Return(s):
Argument(s):
- text: string
- Optional - previousQuality: number
Notes: Decorates the text appropriately. If previousQuality is specified, the code will emit a transition to the specified decoration at the end of the formatted text.
Return(s):
Argument(s):
- text: string
- Optional - previousQuality: number
Notes: Decorates the text appropriately. If previousQuality is specified, the code will emit a transition to the specified decoration at the end of the formatted text. If not, previousQuality is assumed to be normal.
Return(s):
Argument(s):
Notes: Emits a formatted file reference. Most of the most useful ones are provided by other functions already.
Return(s):
Argument(s):
Notes: Emits formatted text representing an item icon.
Return(s):
Argument(s):
Notes: Emits formatted text representing a mob reference. This will cause the client to display the string that it has for the specified mob and may also have some associated functionality.
Return(s):
Argument(s):
Notes: Emits formatted text representing a map reference. This will cause the client to display the string that it has for the specified map and may also have some associated functionality.
Return(s):
Argument(s):
Notes: Emits formatted text representing an item count reference.
Return(s):
Argument(s):
Notes: Emits formatted text representing a skill reference. This will cause the client to display the string that it has for the specified skill and may also have some associated functionality.
Return(s):
Argument(s):
Notes: Emits formatted text representing an item reference. This will cause the client to display the string that it has for the specified item and may also have some associated functionality. This is an alternate version of the itemRef function and it's not clear what the difference is, if any, between the two. Some scripts use one but most use the regular variant.
Return(s):
Argument(s):
Notes: Emits formatted text representing an item reference. This will cause the client to display the string that it has for the specified item and may also have some associated functionality.
Return(s):
Argument(s):
Notes: Emits formatted text representing a player reference. This will cause the client to display the name associated to the player and may also have some associated functionality.
Return(s):
Argument(s):
Notes: Emits formatted text representing an NPC reference. This will cause the client to display the string that it has for the specified NPC and may also have some associated functionality.
Return(s):
Argument(s):
Notes: Emits formatted text representing a quest complete icon. This will cause the client to display the quest completion icon.
Return(s):
Argument(s):
Notes: Emits formatted text representing a quest experience icon. This will cause the client to display the quest experience icon with the associated EXP number.
Return(s):
Argument(s):
Notes: Emits formatted text representing a quest mesos icon. This will cause the client to display the quest mesos icon with the associated mesos count.
Return(s):
Argument(s):
- itemId: number
- Optional - qty: number
Notes: Emits formatted text representing a quest reward item icon. This will cause the client to display the quest item icon and optionally, quantity verbiage.
Return(s):
Argument(s):
Notes: Emits formatted text representing a quest skill icon. This will cause the client to display the quest skill icon for the associated skill reward.
Return(s):
Argument(s):
- femaleText: string
- maleText: string
Notes: Emits formatted text based on the current player's gender. If there is an official escape sequence in the locale, this is preferred. Otherwise it only emits one or the other.
Return(s):
Argument(s):
- completionPercentage: number
Notes: Emits formatted text representing a progress bar. This will cause the client to display an actual progress bar that's filled to the completion percentage you specify (e.g. progessBar(10) will be a progress bar with 10% filled).
Return(s):
Argument(s):
- choice: table OR string
- Optional - choiceId: number
Notes: Converts either a table into a formatted choice list text or a single choice option into formatted text.
Return(s):
Argument(s):
- choice: string
- data: table
Notes: Synthesizes choice data into a format understood by selectChoice.
Usage:
makeChoiceData("Skin", getSkinStyles()),
Return(s):
Argument(s):
- choice: string
- handler: function
-
Return(s): value: any
-
Argument(s): Optional - choiceId: number
Notes: Synthesizes a choice handler into a format understood by selectChoice.
Usage:
makeChoiceHandler("No, it's okay.", function()
addText("I guess you already know a lot about Victoria Island. ");
addText("Have a good trip...");
sendNext();
end),
Conditional Return(s):
-
If the selected choice contains a handler: The return result of the handler
-
If the selected choice contains data:
- The item associated to the choice
- choiceId: number
-
Any other case: The choice itself
Argument(s):
- choices: table
- choiceId: number
Notes: This versatile function is probably how you will do most of your selection NPC interactions. It will either transform your list of choices into data that you can then go and use based on the selection or alternatively execute the associated handler function automatically.
Usage:
choice = askChoice();
data = selectChoice(choices, choice);
item, worth = data[1], data[2];