View Single Post
07/15/22, 08:05 PM   #4
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 656
First use SetEventCallback not SetNextEventCallback. Second, your comment for GetMmPrice is wrong. MM does not take from a specific focus unless you press the corresponding modifier such as Shift or Ctrl. However, those modifiers are useless when using the function to get the price. You can not get any of the focuses through the function when requesting the pricing information from MM.

Also keep this the way I put it or there is a very big chance your mod could just break if I make changes.

function GuildBancair:GetMmPrice(itemLink)
local mmStats = MasterMerchant:itemStats(itemLink, false)
return mmStats
end

Then read the link mentioned on the LibHisatorie site.

https://github.com/esoui/esoui/blob/...hared.lua#L268

You are passing param3, which is the quantity to everything. So eventType is the first, but that is the Bank, or sales, or alliance war. The param1 is seller, and the itemLink is param4.

Then lastly you have to set your saved variables file as a default not each and every time.

GuildBancair.savedVariables['guilds'][guildId]['lastEvent'] = "0" has to be the default and set only once. The reason is that you will set it to be 0 and then LibHistoire will import every single bank event you have since you started using LibHistoire. It will just keep going, and going, and going, and going, and going, and going, and going, for 5 minutes or ten minutes or however long it takes. Until the process completes. Then after that you have to make sure all your bank events are linked and click the Rescan button on the LibHistoire GUI.

You should probably rewrite GuildBancair.Initialize() and have it call the GuildBancair.SetupListener(guildId, guildName) last in a separate function. You don't really want it to start until you are done setting up everything else.

Then lastly don't convert the id64 eventID to a number. For NA it is approaching the limit for a 32 bit integer and it's already past what a 32 bit integer can use for EU. So just don't do that. Compare it as a string and save it in your saved variables as a string.

I don't know if I got everything but more like what I have in the attached file. It isn't perfect and isn't tested.

Most of the MM functions will become internal and unusable without breaking your mod. So what I provided you is what you should use. It returns a table. If you need it to be in text format then create your own function and use string.format().

Last edited by Sharlikran : 07/15/22 at 08:21 PM.
  Reply With Quote