• 0

    posted a message on Issue with check class/addon
    I get what your saying now, I just completely misunderstood.
    Posted in: Need Help?
  • 0

    posted a message on Issue with check class/addon
    I don't think you were paying attention when I explained how to do class-conditional loading in your other thread.


    I was paying attention Phanx - i just misunderstood, no need to get snippy at someone thats new at this (i only started reading about lua 2 weeks ago).

    local L = UnitClass("PLAYER")
    if L == "PALADIN" then


    ... will never evaluate to true, as the first return value from UnitClass is the localized class name, which is (obviously) different in every game locale. You need to check the second return value, which is the uppercase "token" name of the class:


    I figured this but a friend of mine convinced me otherwise, obviously i was just being gullible.

    local p = DEFAULT_CHAT_FRAME:AddMessage("Class Soundpack Loaded!")

    Also, this doesn't work anything like what you expect


    This i wasnt sure of, I read something about it in a book but it could have been outdated, or possibly i misunderstood. Thank you for clearing that up.

    GetAddonInfo("Pallypack") if


    Your IsAddOnLoaded and LoadAddOn calls will fail, at least for users with case-sensitive filesystems, because you're checking for "Pallypack" and then trying to load "PallyPack".



    I didnt know they were case-sesitive, and im pretty sure the capital P in PallyPack was a typeo.

    Creating random functions in the global scope is bad, especially when they have generic names like "Checkaddon" or "RegisterSounds".

    Your entire "Checkaddon" function is never even called.


    I have read and been told by many people the names of each function dont really matter, if i was informed wrong then ill definately change it.

    In fact, there are so many basic errors with your code that I can only suggest you spend more time studying basic Lua syntax. "if X then Y and Z else Q end" is completely incorrect syntax.


    I'm sorry there were syntax errors - like i said before im a complete beginner with no programming experience at all. I am reading more and more about lua however i'm the type of person that learns more from trial and error. I am however thankful for your help, but as i said im a complete beginner with no prior experience at all and limited resources (2 books and wowwiki, but most explanations on things are broad or for that matter they say things like "if you dont understand this right now dont worry" which kinda defeats the purpose of an educational book) I know how to make tables and apply those tables to said functions but I definitely have problems with events and control structures.
    Posted in: Need Help?
  • 0

    posted a message on Issue with check class/addon
    dont post on my thread with your gold farming crap plx
    Posted in: Need Help?
  • 0

    posted a message on Issue with check class/addon
    I've been working on an addon that is a multi part addon (one for paladin,priest,warlock...etc) its supposed to check the player class, check to see if the class's addon is installed, check to see if its loaded; if its not then load it. ive got everything but the CheckAddon() function to work XD. where am i going wrong with this as far as coding? I keep getting a syntax error saying ( expected near if on line 7

     local RegisterSounds
      local msg
      local L = UnitClass("PLAYER")
      local p = DEFAULT_CHAT_FRAME:AddMessage("Class Soundpack Loaded!")
      local f = DEFAULT_CHAT_FRAME:AddMessage("%s Not loaded, please install/enable class soundpack!")
    function Checkaddon 
        if L == 'PALADIN' then               -- Should check to see if your a paladin
        GetAddonInfo("Pallypack") if         -- should find out if said addon is loaded
        GetAddonInfo("PallyPack") ~= true then f           -- if its not found print message f
        if IsAddOnLoaded("Pallypack") = true then p       -- if found and loaded print message p
        if IsAddonLoaded("Pallypack") ~= true then  --if not loaded then load it and print p
        LoadAddOn("Pallypack") and p
            end
        else RegisterSounds()
        end
    end
    end
    end    
      function RegisterSounds()
         local classSounds = {
            'Hero',
            'Hero2',
            'low health1',
            'low health2',
            'low health3',
            'low mana1',
            'low mana2',
            'low mana3'
          }
          local LibSharedMedia = LibStub("LibSharedMedia-3.0")
          for  i, spellName in ipairs(classSounds) do
             LibStub("LibSharedMedia-3.0"):Register("sound", "ThePack:".. spellName, "Interface\\AddOns\\ThePack\\".. spellName .. ".mp3");
             -- use LibSharedMedia 3.0 for these sounds
          end
       end   
    local function SlashHandler(msg)
    if msg == 'help' then
    DEFAULT_CHAT_FRAME:AddMessage("insert text here.", 1.0, 1.0, 0.0)
      end
    end
    SlashCmdList["ThePack"] = function(msg) SlashHandler(msg) end
    SLASH_ThePack1 = "/tp"
    SLASH_ThePack2 = "/thepack"
    
    local frame = CreateFrame("Frame")
    frame:RegisterEvent("PLAYER_LOGIN")
    frame:SetScript("OnEvent", function()
       RegisterSounds()
    end)
    Posted in: Need Help?
  • 0

    posted a message on Sith Shaman Add On Request.
    I can easily incorperate that into my Shammypack addon, however its designed to work with MSBT's trigger sounds currently, so if you dont have the trigger set up, it wont work.
    Posted in: Addon Ideas
  • 0

    posted a message on Beginner addon issues
    i'm aware it looks horrible - as i said im a beginner, also the sounds variable is a typeo its supposed to be classSounds
    Posted in: Need Help?
  • 0

    posted a message on Beginner addon issues
    I've been working on an addon that checks a players class, returns 2 different messages depending on if it is a specified class IE if your a paladin and the specified class is paladin it says "thanks for downloading bleh bleh bleh" if your a mage it returns "This isnt the proper addon plx go download the correct one to get character specified options". Then it loads sounds from a table to be used with the libsharedmedia 3.0 (later I want to change this so it actually doesnt rely on a seprate addon that uses shared media like msbt - instead i want to add functions per character basis IE when forbearance goes off cooldown it plays a sound specific to that ability but thats later) Right now im having issues with the message being displayed per character. Like i said im new to this and i have high ambitions for this, I play to take some programming classes because im going to be getting my computer science degree. Anywho this is the code i have so far, not sure whats wrong and any input would be greatly appreciated!


    local CheckClass
    local classType = UnitClass("player");
    local RegisterSounds
    
          function CheckClass() -- Should check class and print a message if your not that class
          if classType ~= 'Paladin' then
             DEFAULT_CHAT_FRAME:AddMessage("Insert text here", 1.0, 1.0, 0.0)
          else -- Should print a message if you are that class
             DEFAULT_CHAT_FRAME:AddMessage("Insert Text here", 1.0, 1.0, 0.0)
       end
    end
    function RegisterSounds()  -- should make a table and load sounds on that table
          if classType == 'Paladin' then
       local classSounds = {'Art of War','Aura Mastery','Avengers Shield','Avenging Wrath','Beacon of Light','Blessing','Divine Intervention','Divine Plea',
                   'Divine Shield','Divine Storm','Exorcism','Forbearance','Hammer of Justice','Hammer of the Righteous','Hammer of Wrath Available',
                   'HammerofWrath','Hand of Freedom','Hand of Protection','Hand of Sacrifice','Hand of Salvation','Holy Shield','Holy Wrath','Infusion of Light',
                   'Lay on Hands','Lights Grace','Repentance','Righteous Fury','Sacred Shield','Seal'}
          for  i=1,#(classSounds) do
            LibStub("LibSharedMedia-3.0"):Register("sound", "Pally:"..classSounds[i], "Interface\\AddOns\\Pallypack\\"..classSounds[i]..".mp3"); -- use LibSharedMedia 3.0 for these sounds
            end
        end
          DEFAULT_CHAT_FRAME:AddMessage("insert text here.", 1.0, 1.0, 0.0); -- print a message after everything is done
    end
    
    Posted in: Need Help?
  • 0

    posted a message on 3 day approval?
    I've just been curious as to if theres an approval time limit or anything. I created a project and the description wasnt valid so i went back and changed it, resubmitted it for approval and its been saying "waiting for approval" for 3 days now.
    Posted in: Need Help?
  • To post a comment, please or register a new account.