Created
November 16, 2025 18:36
-
-
Save SteffenBlake/757c71daaff6d2f834c5e70851298f7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| addon.name = 'chocohelper'; | |
| addon.author = 'soralin, some logic ported from Ivaars chococard windower addon'; | |
| addon.version = '1.0'; | |
| addon.desc = 'Decodes the stats of the first chococard found in your inventory'; | |
| require('common'); | |
| local chocobo_card_ids = table.flip({2313,2339,2342,2402}); | |
| local function decode_chocobo(extra) | |
| return { | |
| STR = extra:byte(1), | |
| END = extra:byte(2), | |
| DSC = extra:byte(3), | |
| RCP = extra:byte(4), | |
| } | |
| end | |
| --Gets max amount of items in the player's inventory | |
| local function GetInventoryMax() | |
| local max = AshitaCore:GetMemoryManager():GetInventory():GetContainerCountMax(0); | |
| if (max > 80) then | |
| return 80; | |
| end | |
| return max; | |
| end | |
| local function FindChocoCards() | |
| local inventory = AshitaCore:GetMemoryManager():GetInventory(); | |
| local max = GetInventoryMax(); | |
| for index = 1, max, 1 do | |
| local containerItem = inventory:GetContainerItem(0, index); | |
| if (containerItem == nil or containerItem.Count <= 0 or containerItem.Id <= 0) then | |
| goto continue; | |
| end | |
| if (chocobo_card_ids[containerItem.Id] == nil) then | |
| goto continue; | |
| end | |
| local chocobo = decode_chocobo(containerItem.Extra); | |
| print(string.format( | |
| "STR:%d END:%d DSC:%d RCP:%d", | |
| chocobo.STR, | |
| chocobo.END, | |
| chocobo.DSC, | |
| chocobo.RCP | |
| )); | |
| break; | |
| ::continue:: | |
| end | |
| end | |
| ashita.events.register('command', 'command_cb', function(e) | |
| local args = e.command:args(); | |
| if (args[1] ~= '/chocohelper') then | |
| return; | |
| end | |
| e.blocked = true; | |
| FindChocoCards(); | |
| return true; | |
| end); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment