• 0

    posted a message on Slash Command wont start a function

    In reply to Ketho17:

     cheers, this solved the problem for me.

    Thank you.

    Posted in: Lua Code Discussion
  • 0

    posted a message on Slash Command wont start a function

    Hi fellow scripters,


    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"
    	if C_QuestLog.IsQuestFlaggedCompleted(54186) == true
    		DungeonTable["Gnomeregan"] = "Yes"
    	if C_QuestLog.IsQuestFlaggedCompleted(46292) == true
    		DungeonTable["DeadMines"] = "Yes"
    	if C_QuestLog.IsQuestFlaggedCompleted(45539) == true
    		DungeonTable["WailingCaverns"] = "Yes"
    	if C_QuestLog.IsQuestFlaggedCompleted(33137) == true
    		DungeonTable["CelestialTournament"] = "Yes"
    	if C_QuestLog.IsQuestFlaggedCompleted(58458) == true
    		DungeonTable["BlackRockDepths"] = "Yes"
    	print("Dungeon : State")
    	for i, v in ipairs(DungeonTable) do print(i, ":", v) 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:
    ## Interface: 13371337
    ## Title: PetBattleDungeonAdvanced
    ## Author: Nightfalk-Die Aldor- EU
    ## Email: blackboxcoder1337@gmail.com
    ## DefaultState: enabled
    ## Version: 1.0.0
    ## Notes: Call with /PBDA.


    Any hints or clues would be very kind.


    Thank you all.

    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.