View Single Post
04/13/14, 06:25 PM   #2
Etupa
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 8
So far it works... dunno how, looking for Keybind/macro now, it's hard to make it works ^^,

Highly inspired from Borrower and Lender add on


Code:
MuteNPC = {}

local function Initialize( self, addOnName )
  if addOnName ~= "MuteNPC" then return end
end

ZO_CreateStringId("SI_BINDING_NAME_MUTENPC", "Mute Npc")
ZO_CreateStringId("SI_BINDING_NAME_UNMUTENPC", "Unmute Npc")

function mute()	
	local control = ZO_OptionsWindow.controlTable[2][9]
	SetSetting(control.system, control.settingId, 1)	
end


function unmu()	
	local control = ZO_OptionsWindow.controlTable[2][9]
	SetSetting(control.system, control.settingId, 100)	
end

SLASH_COMMANDS["/mu"] = mute
SLASH_COMMANDS["/un"] = unmu

EVENT_MANAGER:RegisterForEvent("MuteNPC", EVENT_ADD_ON_LOADED, Initialize )

Last edited by Etupa : 04/13/14 at 08:02 PM.
  Reply With Quote