I am a starter with lua and would like to extend an existing addon as a starting point.
SLASH_PBDA = '/pbda'
function SlashCmdList.PBDA(msg, editbox)
DungeonTable = {}
DungeonTable["Stratholme"] = "No"
DungeonTable["BlackRockDepths"] = "No"
DungeonTable["Gnomeregan"] = "No"
DungeonTable["DeadMines"] = "No"
DungeonTable["WailingCaverns"] = "No"
DungeonTable["CelestialTournament"] = "No"
if C_QuestLog.IsQuestFlaggedCompleted(56492) == true
DungeonTable["Stratholme"] = "Yes"
end
if C_QuestLog.IsQuestFlaggedCompleted(54186) == true
DungeonTable["Gnomeregan"] = "Yes"
end
if C_QuestLog.IsQuestFlaggedCompleted(46292) == true
DungeonTable["DeadMines"] = "Yes"
end
if C_QuestLog.IsQuestFlaggedCompleted(45539) == true
DungeonTable["WailingCaverns"] = "Yes"
end
if C_QuestLog.IsQuestFlaggedCompleted(33137) == true
DungeonTable["CelestialTournament"] = "Yes"
end
if C_QuestLog.IsQuestFlaggedCompleted(58458) == true
DungeonTable["BlackRockDepths"] = "Yes"
end
print("Dungeon : State")
for i, v in ipairs(DungeonTable) do print(i, ":", v) end
end
<br />for my understanding, if I write /PDBA to the chat it should run the function. But it looks like my game does not know the slash command. This code snippet is located in one .lua file.<br />this is my .toc file:
Hi fellow scripters,
I am a starter with lua and would like to extend an existing addon as a starting point.
Any hints or clues would be very kind.
Thank you all.
You need to add the index after the variable name, e.g.
In reply to Ketho17:
cheers, this solved the problem for me.
Thank you.