User Tools

Site Tools


plugins:using_ashitacore

This is an old revision of the document!


Using AshitaCore Object

What is the AshitaCore Object?

The IAshitaCore object is the main IAshitaCore implementation that is internal to Ashita. When a plugin is loaded, the plugins Initialize method is called within the PluginBase inheritance, and the IAshitaCore pointer is passed to the plugin. This pointer should be stored and used later to interact with Ashita. Plugins cannot interact with Ashita unless this object is used.


Using AshitaCore Object

You can use the IAshitaCore object directly like a normal pointer object. If you are using a high-end IDE such as Visual Studio, there should be IntelliSense that completes for you to help you with using the object.
Otherwise, you can open the Ashita.h file within the Plugin ADK folder located at:

\Ashita\Plugins\ADK\Ashita.h

For example, if you wanted to write a message to the games chat log, you can use:

bool ExamplePlugin::Initialize(IAshitaCore* ashitaCore, DWORD dwPluginId)
{
    // Store the variables we are passed..
    this->m_AshitaCore = ashitaCore;
    this->m_PluginId = dwPluginId;
 
    // Write 'Hello world!' to the chat log..
    this->m_AshitaCore->GetChatManager()->Write("Hello world!");
 
    return true;
}
plugins/using_ashitacore.1468649010.txt.gz · Last modified: 2016/07/15 23:03 by atom0s