User Tools

Site Tools


addons:functions

This is an old revision of the document!


Functions

Addons have various global functions and 'namespaces' exposed to them that are built into the Addons plugin. These can be used to interact back with the Addons plugin as well as the Ashita core. Some of these functions are made to allow addons more access to the game client, the system the client is running on, and more.

Below are the various functions and namespaces you can make use of while coding your addon(s).


Namespaces

These are the global namespaces you can use within an addon:

Namespace Description
bits Functions to work with bits and bytes.
file Functions to work with files and folders.
gui Functions to work with the ImGui system.
memory Functions to work with the client memory. (Reading and writing.)
misc Misc. functions to work with various things.
regex Functions related to regular expressions.

AddIncomingPacket

Sends a packet to the client as if the server had sent it.

void AddIncomingPacket(id, packet);
  • Parameters
    • id - (number) The id of the packet being sent.
    • packet - (table) The packet data.
  • Returns
    • Function does not return a value.

AddOutgoingPacket

Sends a packet to the server as if the client had sent it.

void AddOutgoingPacket(id, packet);
  • Parameters
    • id - (number) The id of the packet being sent.
    • packet - (table) The packet data.
  • Returns
    • Function does not return a value.

ParseAutoTranslate

Parses a string for auto-translate tags and converts them.

string ParseAutoTranslate(msg, useBrackets);
  • Parameters
    • msg - (string) The chat message to parse the auto-translate tags within.
    • useBrackets - (bool) True if the resulting string should include the brackets, false otherwise.
  • Returns
    • string - The parsed string.

GetEntity

Obtains an entity object from the given index.

object GetEntity(index);
  • Parameters
    • index - (number) The index of the entity to obtain.
  • Returns
    • object - The entity object if valid, nil otherwise.

GetPlayerEntity

Obtains the player entity object.

object GetPlayerEntity();
  • Parameters
    • Function has no parameters.
  • Returns
    • object - The entity object if valid, nil otherwise.

addons/functions.1492832453.txt.gz · Last modified: 2017/04/21 20:40 by atom0s