User Tools

Site Tools


addons:using_ashitacore

This is an old revision of the document!


Using The AshitaCore Object

What is the AshitaCore Object?

The AshitaCore object (IAshitaCore) is the main object created inside of the Ashita hook. This object is exposed to plugins, including Addons, which in turn is then exposed to Lua via custom exposure methods and the combined efforts of Luabind. This is the main object used to interact with the Ashita hook.

Inside of addons, this object is named and accessible via: AshitaCore


Using AshitaCore

Making use of AshitaCore is very simple and similar to other languages. AshitaCore is created from a class object inside of C++. This means that calls are considered __thiscall. What this means is that the calling convention used (__thiscall) makes use of an object while making the call to the desired function. For example, take this C++ code:

class Derp
{
public:
    void HelloWorld();
};

auto x = new Derp();
x->HelloWorld();
delete x;

This example code shows creating a class called Derp, making an instance of it named 'x', and then invoking the 'HelloWorld' function. Because 'x' is an instance of Derp, we use the → operator to invoke the function. In Lua, → is represented by : instead.

You can learn more about the differences between . and : in Lua here:

In Lua, metatables are used to mimic a style of object-oriented coding.

Lets take for example, inside of the IAshitaCore interface, we have a function:

virtual HMODULE GetHandle(void) const = 0;

In C++, this would be invoked like this:

auto handle = coreObject->GetHandle();

In Lua, we would call it like this:

local handle = AshitaCore:GetHandle();

By using the : operator in Lua, we are automatically informing the interpreter that on the left side of the : (in this case, AshitaCore) our object to invoke the GetGameHwnd with is AshitaCore. This can also be called like this:

local handle = IAshitaCore.GetHandle(AshitaCore);

However, in this case, it is not as elegant as the first.


What's Exposed From AshitaCore?

IAshitaCore

  • GetChatManager
  • GetConfigurationManager
  • GetDataManager
  • GetFontManager
  • GetGuiManager
  • GetInputManager
  • GetPacketManager
  • GetPluginManager
  • GetPointerManager
  • GetResourceManager
  • GetHandle
  • GetAshitaInstallPath
  • GetMouseUnhooked
  • SetMouseUnhooked
  • GetD3DFillMode
  • GetD3DAmbientEnabled
  • GetD3DAmbientColor
  • SetD3DFillMode
  • SetD3DAmbientEnabled
  • SetD3DAmbientColor
  • GetAllowGamepadInBackground
  • SetAllowGamepadInBackground

IChatManager

  • QueueCommand
  • AddChatMessage
  • RunScript
  • GetInputText
  • SetInputText
  • IsInputOpen
  • Write

IConfigurationManager

  • Load
  • Save
  • Remove
  • set_value
  • get_string
  • get_bool
  • get_uint8
  • get_uint16
  • get_uint32
  • get_uint64
  • get_int8
  • get_int16
  • get_int32
  • get_int64
  • get_float
  • get_double

IKeyboard

  • BindKey
  • UnbindKey
  • UnbindAll
  • IsKeyBound
  • ListBinds
  • V2D
  • D2V
  • S2D
  • D2S
  • GetParentWindow
  • GetBlocked
  • SetBlocked

IMouse

  • GetParentWindow
  • GetBlocked
  • SetBlocked

IInputManager

  • GetKeyboard
  • GetMouse

ILogManager

  • Log

IPacketManager

  • No functions are directly exposed, instead, they are global functions.

IPluginManager

  • GetPluginCount

IPointerManager

  • GetPointer

Data Manager Exposure

IDataManager

IDataManager

  • GetEntity
  • GetInventory
  • GetParty
  • GetPlayer
  • GetTarget

IEntity

Ashita::FFXI::position_t

  • X
  • Y
  • Z
  • Unknown0000
  • Roll
  • Yaw
  • Pitch

Ashita::FFXI::move_t

  • X
  • Y
  • Z
  • Unknown0000

Ashita::FFXI::movement_t

  • LocalPosition
  • Unknown0000
  • LastPosition
  • Unknown0001
  • Move

Ashita::FFXI::look_t

  • Hair
  • Head
  • Body
  • Hands
  • Legs
  • Feet
  • Main
  • Sub
  • Ranged

Ashita::FFXI::render_t

  • Flags0
  • Flags1
  • Flags2
  • Flags3
  • Flags4

Ashita::FFXI::animation_t

  • Animations

Ashita::FFXI::ffxi_entity_t

  • CYyObjectVtable
  • Movement
  • TargetIndex
  • ServerId
  • Name
  • Speed
  • AnimationSpeed
  • WarpPointer
  • Distance
  • Heading
  • PetOwnerId
  • HealthPercent
  • ManaPercent
  • EntityType
  • Race
  • ModelFade
  • Look
  • ActionTimer1
  • ActionTimer2
  • Render
  • NpcSpeechLoop
  • NpcSpeechFrame
  • Speed2
  • NpcWalkPosition1
  • NpcWalkPosition2
  • NpcWalkMode
  • CostumeId
  • Status
  • StatusServer
  • StatusNpcChat
  • ClaimServerId
  • Animations
  • AnimationTick
  • AnimationStep
  • AnimationPlay
  • EmoteTargetIndex
  • EmoteId
  • EmoteIdString
  • EmoteTargetWarpPointer
  • SpawnFlags
  • LinkshellColor
  • NameColor
  • CampaignNameFlag
  • FishingTimer
  • FishingCastTimer
  • FishingUnknown0000
  • FishingUnknown0001
  • FishingUnknown0002
  • TargetedIndex
  • PetTargetIndex
  • BallistaScoreFlag
  • PankrationEnabled
  • PankrationFlagFlip
  • ModelSize
  • MonstrosityFlag
  • MonstrosityNameId
  • MonstrosityName

IEntity

  • GetLocalX
  • GetLocalY
  • GetLocalZ
  • GetLocalRoll
  • GetLocalYaw
  • GetLocalPitch
  • GetLastX
  • GetLastY
  • GetLastZ
  • GetLastRoll
  • GetLastYaw
  • GetLastPitch
  • GetMoveX
  • GetMoveY
  • GetMoveZ
  • GetTargetIndex
  • GetServerId
  • GetName
  • GetSpeed
  • GetAnimationSpeed
  • GetWarpPointer
  • GetDistance
  • GetHeading
  • GetPetOwnerId
  • GetHealthPercent
  • GetManaPercent
  • GetEntityType
  • GetRace
  • GetModelFade
  • GetLookHair
  • GetLookHead
  • GetLookBody
  • GetLookHands
  • GetLookLegs
  • GetLookFeet
  • GetLookMain
  • GetLookSub
  • GetLookRanged
  • GetActionTimer1
  • GetActionTimer2
  • GetRenderFlags0
  • GetRenderFlags1
  • GetRenderFlags2
  • GetRenderFlags3
  • GetRenderFlags4
  • GetNpcSpeechLoop
  • GetNpcSpeechFrame
  • GetSpeed2
  • GetNpcWalkPosition1
  • GetNpcWalkPosition2
  • GetNpcWalkMode
  • GetCostumeId
  • GetStatus
  • GetStatusServer
  • GetStatusNpcChat
  • GetClaimServerId
  • GetAnimations
  • GetAnimationTick
  • GetAnimationStep
  • GetAnimationPlay
  • GetEmoteTargetIndex
  • GetEmoteId
  • GetEmoteIdString
  • GetEmoteTargetWarpPointer
  • GetSpawnFlags
  • GetLinkshellColor
  • GetNameColor
  • GetCampaignNameFlag
  • GetFishingTimer
  • GetFishingCastTimer
  • GetFishingUnknown0000
  • GetFishingUnknown0001
  • GetFishingUnknown0002
  • GetTargetedIndex
  • GetPetTargetIndex
  • GetBallistaScoreFlag
  • GetPankrationEnabled
  • GetPankrationFlagFlip
  • GetModelSize
  • GetMonstrosityFlag
  • GetMonstrosityNameId
  • GetMonstrosityName
  • SetLocalX
  • SetLocalY
  • SetLocalZ
  • SetLocalRoll
  • SetLocalYaw
  • SetLocalPitch
  • SetLastX
  • SetLastY
  • SetLastZ
  • SetLastRoll
  • SetLastYaw
  • SetLastPitch
  • SetMoveX
  • SetMoveY
  • SetMoveZ
  • SetTargetIndex
  • SetServerId
  • SetName
  • SetSpeed
  • SetAnimationSpeed
  • SetWarpPointer
  • SetDistance
  • SetHeading
  • SetPetOwnerId
  • SetHealthPercent
  • SetManaPercent
  • SetEntityType
  • SetRace
  • SetModelFade
  • SetLookHair
  • SetLookHead
  • SetLookBody
  • SetLookHands
  • SetLookLegs
  • SetLookFeet
  • SetLookMain
  • SetLookSub
  • SetLookRanged
  • SetActionTimer1
  • SetActionTimer2
  • SetRenderFlags0
  • SetRenderFlags1
  • SetRenderFlags2
  • SetRenderFlags3
  • SetRenderFlags4
  • SetNpcSpeechLoop
  • SetNpcSpeechFrame
  • SetSpeed2
  • SetNpcWalkPosition1
  • SetNpcWalkPosition2
  • SetNpcWalkMode
  • SetCostumeId
  • SetStatus
  • SetStatusServer
  • SetStatusNpcChat
  • SetClaimServerId
  • SetAnimations
  • SetAnimationTick
  • SetAnimationStep
  • SetAnimationPlay
  • SetEmoteTargetIndex
  • SetEmoteId
  • SetEmoteIdString
  • SetEmoteTargetWarpPointer
  • SetSpawnFlags
  • SetLinkshellColor
  • SetNameColor
  • SetCampaignNameFlag
  • SetFishingTimer
  • SetFishingCastTimer
  • SetFishingUnknown0000
  • SetFishingUnknown0001
  • SetFishingUnknown0002
  • SetTargetedIndex
  • SetPetTargetIndex
  • SetBallistaScoreFlag
  • SetPankrationEnabled
  • SetPankrationFlagFlip
  • SetModelSize
  • SetMonstrosityFlag
  • SetMonstrosityNameId
  • SetMonstrosityName

IInventory

Ashita::FFXI::item_t

  • Id
  • Index
  • Count
  • Flags
  • Price
  • Extra

Ashita::FFXI::items_t

  • Item

Ashita::FFXI::treasureitem_t

  • Flags
  • ItemId
  • Count
  • Status
  • Lot
  • WinningLot
  • WinningEntityServerId
  • WinningEntityTargetIndex
  • WinningLotterName
  • TimeToLive
  • DropTime

Ashita::FFXI::equipment_t

  • Slot
  • ItemIndex

Ashita::FFXI::ffxi_inventory_t

  • Storage
  • TreasurePool
  • StorageMaxCapacity1
  • StorageMaxCapacity2
  • Equipment
  • CraftWait

IInventory

  • GetItem
  • GetContainerMax
  • GetTreasureItem
  • GetEquippedItem
  • GetCraftWait

IParty

IParty

  • GetAllianceLeaderServerId
  • GetAllianceParty0LeaderServerId
  • GetAllianceParty1LeaderServerId
  • GetAllianceParty2LeaderServerId
  • GetAllianceParty0Visible
  • GetAllianceParty1Visible
  • GetAllianceParty2Visible
  • GetAllianceParty0MemberCount
  • GetAllianceParty1MemberCount
  • GetAllianceParty2MemberCount
  • GetAllianceInvited
  • GetMemberIndex
  • GetMemberNumber
  • GetMemberName
  • GetMemberServerId
  • GetMemberTargetIndex
  • GetMemberCurrentHP
  • GetMemberCurrentMP
  • GetMemberCurrentTP
  • GetMemberCurrentHPP
  • GetMemberCurrentMPP
  • GetMemberZone
  • GetMemberFlagMask
  • GetMemberMainJob
  • GetMemberMainJobLevel
  • GetMemberSubJob
  • GetMemberSubJobLvl
  • GetMemberServerId2
  • GetMemberCurrentHPP2
  • GetMemberCurrentMPP2
  • GetMemberActive

IPlayer

Ashita::FFXI::combatskill_t

  • Raw
  • GetSkill
  • IsCapped

Ashita::FFXI::craftskill_t

  • Raw
  • GetSkill
  • GetRank
  • IsCapped

IPlayer

  • GetHealthMax
  • GetManaMax
  • GetMainJob
  • GetMainJobLevel
  • GetSubJob
  • GetSubJobLevel
  • GetExpCurrent
  • GetExpNeeded
  • GetStat
  • GetStatsModifiers
  • GetAttack
  • GetDefense
  • GetResist
  • GetTitle
  • GetRank
  • GetRankPoints
  • GetNation
  • GetResidence
  • GetHomepoint
  • GetCombatSkill
  • GetCraftSkill
  • GetAbilityRecast
  • GetAbilityRecastTimerId
  • GetLimitPoints
  • GetMeritPoints
  • GetLimitMode
  • GetMeritPointsMax
  • GetStatusIcons
  • GetStatusTimers
  • GetBuffs
  • HasAbility
  • HasKeyItem
  • HasPetCommand
  • HasSpell
  • HasTrait
  • HasWeaponSkill
  • GetPetTP
  • GetPetMP

ITarget

ITarget

  • GetTargetName
  • GetTargetHealthPercent
  • GetTargetIndex
  • GetTargetServerId
  • GetTargetEntityPointer
  • GetTargetWarpPointer
  • GetTargetVisible
  • GetTargetMask
  • GetTargetCalculatedId
  • GetSubTargetIndex
  • GetSubTargetServerId
  • GetSubTargetEntityPointer
  • GetSubTargetWarpPointer
  • GetSubTargetVisible
  • GetSubTargetMask
  • GetSubTargetActive
  • GetTargetDeactivate
  • GetIsLockedOn
  • GetTargetSelectionMask
  • GetIsMenuOpen

Resource Manager Exposure

IAbility

  • Id
  • Type
  • Element
  • ListIconId
  • ManaCost
  • TimerId
  • ValidTargets
  • TP
  • Unknown0000
  • MonsterLevel
  • Range
  • Name
  • Description

ISpell

  • Index
  • Type
  • Element
  • ValidTargets
  • Skill
  • ManaCost
  • CastTime
  • RecastDelay
  • LevelRequired
  • Id
  • ListIcon1
  • ListIcon2
  • Requirements
  • Range
  • Name
  • Description

IMonstrosityAbility

  • MoveId
  • Level
  • Unknown0000

IItem

  • ItemId
  • Flags
  • StackSize
  • ItemType
  • ResourceId
  • ValidTargets
  • Level
  • Slots
  • Races
  • Jobs
  • SuperiorLevel
  • ShieldSize
  • MaxCharges
  • CastTime
  • CastDelay
  • RecastDelay
  • BaseItemId
  • ItemLevel
  • Damage
  • Delay
  • DPS
  • Skill
  • JugSize
  • InstinctCost
  • MonstrosityId
  • MonstrosityName
  • MonstrosityAbilities
  • PuppetSlotId
  • PuppetElements
  • Name
  • Description
  • LogNameSingular
  • LogNamePlural

IResourceManager

  • GetAbilityById
  • GetAbilityByName
  • GetAbilityByTimerId
  • GetSpellById
  • GetSpellByName
  • GetItemById
  • GetItemByName
  • GetString
  • GetString
  • GetString
  • GetString
addons/using_ashitacore.1492852586.txt.gz · Last modified: 2017/04/22 02:16 by atom0s