Skip to content

Commit

Permalink
feat: default NPC channel
Browse files Browse the repository at this point in the history
Added settings to load in default NPC channel if missing.  channel ID 9100
  • Loading branch information
grimmier378 committed May 12, 2024
1 parent 7bddf90 commit 907ef5a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ local function reindex(table)
local newTable = {}
local newIdx = 0
for k, v in pairs(table) do
if k == 0 or k == 9000 then
if k == 0 or k == 9000 or k >= 9100 then
newTable[k] = v
else
newIdx = newIdx + 1
Expand Down Expand Up @@ -242,7 +242,10 @@ local function loadSettings()
ChatWin.Settings.Channels[9000] = {}
ChatWin.Settings.Channels[9000] = defaults['Channels'][9000]
end

if ChatWin.Settings.Channels[9100] == nil then
ChatWin.Settings.Channels[9100] = {}
ChatWin.Settings.Channels[9100] = defaults['Channels'][9100]
end
ChatWin.Settings.Channels[9000].enabled = enableSpam

if ChatWin.Settings.refreshLinkDB == nil then
Expand Down Expand Up @@ -440,7 +443,7 @@ local function CheckNPC(line)
-- print(check)
local check = string.format("npc =%s",name)
if mq.TLO.SpawnCount(check)() ~= nil then
printf("Count: %s Check: %s",mq.TLO.SpawnCount(check)(),check)
-- printf("Count: %s Check: %s",mq.TLO.SpawnCount(check)(),check)
if mq.TLO.SpawnCount(check)() ~= 0 then
return true, name
else return false, name end
Expand Down

0 comments on commit 907ef5a

Please sign in to comment.