Ashita 1.0.2.6 Released!
Hey everyone, more updates again! This time a lot of love for LuaCast.
Code:
----------------------------------------------------------------------------------------------------
Ashita Version: 1.0.2.6
----------------------------------------------------------------------------------------------------
Change: INTERFACEVERSION 1.41
Fixed : [Both] Resource dat parsing adjustments to fix invalid ability/spell data.
Fixed : [Both] GetEquipItemID is now spelled properly.
Fixed : [Both] ItemData by name is now const char*.
Update: [Both] Resource ItemData is now GetItemByName/GetItemByID
Update: [Extn] LuaCast: Added missing GetItemByName/GetItemByID functions.
Update: [Extn] LuaCast: Added IInventory bindings to fully support inventory data in Lua.
Added : [Extn] LuaCast: inventory.lua helper file for various inventory data.
Added : [Extn] LuaCast: Added various extension files to extend math, string, table.
Update: [Extn] LuaCast: Added memory handling functions.
Update: [Extn] LuaCast: Updated main.lua for example usage.
Fixed : [Extn] LuaCast: Fixed Player crafting information reporting wrong data.
Change: [Extn] LuaCast: CraftSkills is now properly CraftLevels as it is in the SDK.
Update: [Extn] Lotomatic: Added pass/loot commands to pass or roll on all current treasure pool items.
Fixed : [Extn] AshitaAPI: Various structure definitions using wrong data types.
With this update we have a few bug fixes mostly to extensions.
Lotomatic
- Added /lotomatic pass command to pass all current items in treasure pool.
- Added /lotomatic loot command to loot all current items in the treasure pool.
- WARNING: These commands do not check if you have rolled an item already. Use with caution!
LuaCast
- Added missing GetItemByName/GetItemByID functions.
- Fixed crafting information returning wrong data.
- Fixed CraftSkills to be CraftLevels to match the SDK properly.
- Added IInventory bindings to allow users to fully read inventory info from Lua.
- Inventory reading includes:
- Inventory (All inventory bags included.)
- Storage
- Current Equipment
- Treasure Pool Data
- Added memory handling functions.
- Added several helper Lua files to extend some built in objects. (Math, String, Table)
With these new changes to LuaCast you can now do A LOT of customization.
Here are some new examples of whats changed:
Reading Current Equipment Information
PHP Code:
local inventory = AshitaCore:GetDataModule():GetInventory().Inventory;
local equipment = inventory.Equipment;
for k,v in pairs( equipment ) do
local item = GetItemFromEquipmentSlot( v.Slot + 1 );
local itemName = function() if (item == nil) then return ''; else return item.Name; end end
print( string.format( '[Equiment Info]: Slot: %d - ItemIndex: %d - ItemName: %s', v.Slot, v.ItemIndex, itemName() ) );
end
Using the new memory stuff to mimic AllMaps extension:
PHP Code:
local allMaps = { 0xE9, 0xFF, 0xFF, 0xFF, 0xFF, 0x50, 0xE8, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xBF, 0x96, 0xFF, 0xFF, 0xFF, 0xFF, 0x83, 0xC4, 0x04 };
local addr = FindPattern( allMaps, #allMaps, "x????xx????xxx????xxx" );
if (addr ~= nil and addr ~= 0) then
addr = addr + 6;
local data = { 0xB8, 0x01, 0x00, 0x00, 0x00 };
WriteArray( data, #data, addr );
end
Obtaining information about a spell:
PHP Code:
local res = AshitaCore:GetResources();
print( 'Zone 4: ' .. tostring( res:GetString( 'areas', 4 ) ) );
print( 'Zone 4: ' .. tostring( res:GetString( 'areas', res:GetString( 'areas', 4 ) ) ) );
local spell = AshitaCore:GetResources():GetSpellByID( 1 );
print( string.format( 'Spell ID: %d', spell.ID ) );
print( string.format( 'Spell MagicType: %d', spell.MagicType ) );
print( string.format( 'Spell Element: %d', spell.Element ) );
print( string.format( 'Spell ValidTargets: %d', spell.ValidTargets ) );
print( string.format( 'Spell Skill: %d', spell.Skill ) );
print( string.format( 'Spell MP: %d', spell.MP ) );
print( string.format( 'Spell Cast: %d', spell.Cast ) );
print( string.format( 'Spell Recast: %d', spell.Recast ) );
print( string.format( 'Spell ResourceID: %d', spell.ResourceID ) );
print( string.format( 'Spell IconIndex: %d', spell.IconIndex ) );
print( string.format( 'Spell Name: %s', spell.Name ) );
print( string.format( 'Spell Description: %s', spell.Description ) );
print( string.format( 'Required Count: %d', #spell.RequiredLevel ) );
for k,v in pairs( spell.RequiredLevel ) do
print( string.format( 'Job: %d -- Level: %d', k, v ) );
end
With the new additional support files I also wrote a command parser to handle incoming commands easier and cleaner. You can use the new command parser like this. (This is from the new main.lua that is included with LuaCast)
PHP Code:
----------------------------------------------------------------------
-- func : onHandleCommand
-- desc : Event callback for onHandleCommand event.
----------------------------------------------------------------------
function onHandleCommand( cmd, nType )
-- Parse the command into arguments..
local args = cmd:GetArgs();
-- Validate this is a LuaCast command..
if (args[1] ~= "/luacast") then
return false;
end
-- Handle LuaCast wave command..
if (args[2] == 'wave') then
AshitaCore:GetDataModule():SendCommand( '/wave', CommandType.Typed );
return true;
end
return false;
end
events.Add( "onHandleCommand", "luaCast_onHandleCommand", onHandleCommand );
With these updates to LuaCast users can now pull any data they wish from FFXI's memory and use it to their advantage to create whatever they desire.
Here is a list of all the new memory functions:
- GetFFXiBase()
- UnprotectMem()
- FindPattern()
- ReadUChar()
- ReadChar()
- ReadUShort()
- ReadShort()
- ReadULong()
- ReadLong()
- ReadULonglong()
- ReadLonglong()
- ReadFloat()
- ReadDouble()
- ReadArray()
- ReadString()
- WriteUChar()
- WriteChar()
- WriteUShort()
- WriteShort()
- WriteULong()
- WriteLong()
- WriteULonglong()
- WriteLonglong()
- WriteFloat()
- WriteDouble()
- WriteArray()
Feel free to check out the project:
http://www.ffevo.net/forum/80-ashita/
You can also always find us on IRC at:
Server: irc.ffevo.net
Port: 6667
Channel: #fface