Details reset script

Hi Guys! I am trying to create a script that clears Details’ history upon clicking of the macro.

So far I have the below, that wasn’t working:

/run if IsControlKeyDown () then _detalhes.tabela_historico:resetar() end ’

I initially tried to run some custom code in the ‘Auto Run Code’ section of the addon to clear details upon entering AND leaving an instance which is below, this also didn’t work:

– when the player changes zone, this code will run#
function OnPlayerLeavingWorld()
local instanceType, _, difficulty, _, _, _, _, instanceMapID = GetInstanceInfo()
if instanceType == “party” or instanceType == “raid” or instanceType == “pvp” then
DetailsFramework.tablea_historico:resetar_overall()
end
end

Any help would be greatly appreciated.

I guess you could do something like this:

/stopmacro [nomod:ctrl]
/details reset

In functions.lua, _detalhes is a local variable, but it is copied from _G._detalhes, which I think is just short for the global variable _detalhes. You can debug by using macros like:

/run print(_detalhes)
/run print(_detalhes.tablea_historico)
/run print(_detalhes.tablea_historico.resetar_overall)

See what you get from each print… If even the first one is nil, then you need to out what the addon is actually called.

I don’t have Details installed, but I did look at the Lua code.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.