This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
addons:functions [2015/11/20 00:56] atom0s created |
addons:functions [2015/11/20 01:42] atom0s |
||
---|---|---|---|
Line 2: | Line 2: | ||
The following page covers the functions that are built into Ashita's Addons.dll plugin. | The following page covers the functions that are built into Ashita's Addons.dll plugin. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Global Functions ==== | ||
+ | |||
+ | //void// **AddIncomingPacket**(packet, id, size); | ||
+ | * **Parameters** | ||
+ | * packet - The packet data. (Table) | ||
+ | * id - The id of the packet being sent. | ||
+ | * size - The size of the packet data to send. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
+ | |||
+ | //void// **AddOutgoingPacket**(packet, id, size); | ||
+ | * **Parameters** | ||
+ | * packet - The packet data. (Table) | ||
+ | * id - The id of the packet being sent. | ||
+ | * size - The size of the packet data to send. | ||
+ | * **Returns** | ||
+ | * //Function does not return a value.// | ||
+ | |||
+ | //string// **ParseAutoTranslate**(str, addBrackets); | ||
+ | * **Parameters** | ||
+ | * str - The string to parse auto-translate strings from. | ||
+ | * addBrackets - Flag to determine if brackets should be readded to the parsed string. | ||
+ | * **Returns** | ||
+ | * The parsed string. | ||
+ | |||
+ | //object// **GetEntity**(index); | ||
+ | * **Parameters** | ||
+ | * index - The index of the entity to obtain. | ||
+ | * **Returns** | ||
+ | * The entity at the given index. | ||
+ | |||
+ | //object// **GetPlayerEntity**(); | ||
+ | * **Parameters** | ||
+ | * //Function has no arguments.// | ||
+ | * **Returns** | ||
+ | * The current players entity. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Bitpack Functions ==== | ||
+ | |||
+ | //number// bitpack:unpackBitsBE(packet, bitOffset, bitLength); | ||
+ | * **Parameters** | ||
+ | * packet - The data to unpack values from. | ||
+ | * bitOffset - The bit offset to start unpacking at. | ||
+ | * bitLength - The number of bits to unpack. | ||
+ | * **Returns** | ||
+ | * The unpacked value. | ||
+ | |||
+ | //number// bitpack:unpackBitsBE(packet, byteOffset, bitOffset, bitLength); | ||
+ | * **Parameters** | ||
+ | * packet - The data to unpack values from. | ||
+ | * byteOffset - The byte offset within the data to unpack. | ||
+ | * bitOffset - The bit offset to start unpacking at. | ||
+ | * bitLength - The number of bits to unpack. | ||
+ | * **Returns** | ||
+ | * The unpacked value. | ||
+ | |||
+ | //number// bitpack:unpackBitsLE(packet, bitOffset, bitLength); | ||
+ | * **Parameters** | ||
+ | * packet - The data to unpack values from. | ||
+ | * bitOffset - The bit offset to start unpacking at. | ||
+ | * bitLength - The number of bits to unpack. | ||
+ | * **Returns** | ||
+ | * The unpacked value. | ||
+ | |||
+ | //number// bitpack:unpackBitsLE(packet, byteOffset, bitOffset, bitLength); | ||
+ | * **Parameters** | ||
+ | * packet - The data to unpack values from. | ||
+ | * byteOffset - The byte offset within the data to unpack. | ||
+ | * bitOffset - The bit offset to start unpacking at. | ||
+ | * bitLength - The number of bits to unpack. | ||
+ | * **Returns** | ||
+ | * The unpacked value. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Configuration Functions ==== | ||
+ | |||
+ | //boolean// **config:load_config**(className); | ||
+ | * **Parameters** | ||
+ | * className - The name of the class to load. (Usually the same as the file name.) | ||
+ | * **Returns** | ||
+ | * True on success, false otherwise. | ||
+ | |||
+ | //boolean// **config:load_config**(className, file); | ||
+ | * **Parameters** | ||
+ | * className - The name of the class to load. | ||
+ | * file - The file to load the configuration from. | ||
+ | * **Returns** | ||
+ | * True on success, false otherwise. | ||
+ | |||
+ | //void// **config:remove_config**(className); | ||
+ | * **Parameters** | ||
+ | * className - The name of the class to unload. | ||
+ | * **Returns** | ||
+ | * //Function has no return.// | ||
+ | |||
+ | //boolean// **config:save_config**(className); | ||
+ | * **Parameters** | ||
+ | * className - The name of the class to save. | ||
+ | * **Returns** | ||
+ | * True on success, false otherwise. | ||
+ | |||
+ | //string// **config:get_string**(className, name); | ||
+ | * **Parameters** | ||
+ | * className - The name of the class. | ||
+ | * name - The name of the value to read. | ||
+ | * **Returns** | ||
+ | * The string value. | ||
+ | |||
+ | //boolean// **config:get_bool**(className, name, defaultValue); | ||
+ | * **Parameters** | ||
+ | * className - The name of the class. | ||
+ | * name - The name of the value to read. | ||
+ | * defaultValue - The default value to use if reading fails. | ||
+ | * **Returns** | ||
+ | * The value that was read. | ||
+ | |||
+ | //number// **config:get_int**(className, name, defaultValue); | ||
+ | * **Parameters** | ||
+ | * className - The name of the class. | ||
+ | * name - The name of the value to read. | ||
+ | * defaultValue - The default value to use if reading fails. | ||
+ | * **Returns** | ||
+ | * The value that was read. | ||
+ | |||
+ | //number// **config:get_float**(className, name, defaultValue); | ||
+ | * **Parameters** | ||
+ | * className - The name of the class. | ||
+ | * name - The name of the value to read. | ||
+ | * defaultValue - The default value to use if reading fails. | ||
+ | * **Returns** | ||
+ | * The value that was read. | ||
+ | |||
+ | //number// **config:get_double**(className, name, defaultValue); | ||
+ | * **Parameters** | ||
+ | * className - The name of the class. | ||
+ | * name - The name of the value to read. | ||
+ | * defaultValue - The default value to use if reading fails. | ||
+ | * **Returns** | ||
+ | * The value that was read. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== File Functions ==== | ||
+ | |||
+ | //number// **file:create_dir**(path); | ||
+ | * **Parameters** | ||
+ | * path - The full path to create the directory of. (Will automatically create any missing sub-directories.) | ||
+ | * **Returns** | ||
+ | * 0 on success, otherwise the error code. | ||
+ | |||
+ | //boolean// **file:dir_exists**(path); | ||
+ | * **Parameters** | ||
+ | * path - The full path to check. | ||
+ | * **Returns** | ||
+ | * True if exists, false otherwise. | ||
+ | |||
+ | //boolean// **file:file_exists**(path); | ||
+ | * **Parameters** | ||
+ | * path - The full path to the file to check. | ||
+ | * **Returns** | ||
+ | * True if exists, false otherwise. | ||
+ | |||
+ | //table// **file:get_dir**(path); | ||
+ | * **Parameters** | ||
+ | * path - The full path to get the contents of. | ||
+ | * **Returns** | ||
+ | * A table containing the files within the given path. | ||
+ | |||
+ | //table// **file:get_dirs**(path); | ||
+ | * **Parameters** | ||
+ | * path - The full path to get the directories of. | ||
+ | * **Returns** | ||
+ | * A table containing the folders within the given path. | ||
+ | |||
+ | //string// **file:get_install_dir**(languageId, installId); | ||
+ | * **Parameters** | ||
+ | * languageId - The language id to use while looking up the install path. | ||
+ | * installId - The install id to lookup. | ||
+ | * **Returns** | ||
+ | * The installation path if it exists, empty string otherwise. | ||
+ | |||
+ | |||
+ | Valid languageId's are the following: | ||
+ | * 0 = English (Default) | ||
+ | * 1 = Japanese | ||
+ | * 2 = English | ||
+ | * 3 = European | ||
+ | * 4 = European | ||
+ | |||
+ | Valid installId's are the following: | ||
+ | * Final Fantasy XI = 0 | ||
+ | * Tetra Master = 1 | ||
+ | * Final Fantasy XI Test Client = 2 | ||
+ | * PlayOnline = 3 | ||
---- | ---- | ||
Line 186: | Line 386: | ||
* **Returns** | * **Returns** | ||
* //Function does not return a value.// | * //Function does not return a value.// | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Misc. Functions ==== | ||
+ | |||
+ | //void// **misc:open_url**(url); | ||
+ | * **Parameters** | ||
+ | * url - The website url to open. | ||
+ | * **Returns** | ||
+ | * //Function returns no value.// | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Sound Functions ==== | ||
+ | |||
+ | //void// **sound:playsound**(file); | ||
+ | * **Parameters** | ||
+ | * file - sound The file to play. | ||
+ | * **Returns** | ||
+ | * //Function returns no value.// |