• 0

    posted a message on Is there any way of getting a player's guild name?
    Thanks ... I am looking at WhoLib which may work for my purpose since I really want to build a database of members of our coalition including their guilds so I do not need instant response.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Is there any way of getting a player's guild name?
    I would like to keep track of the guild's of players who logon to our coalition chat channel.
        pGuildName=GetGuildInfo(toon)
    where toon is the string name of someone seen in chat does not seem to work unless toon is in a party or raid with "player". What I want is to get the same info that I see when I shift-click on the toon name in the chat window.

    Any suggestions?
    Posted in: Lua Code Discussion
  • 0

    posted a message on making movable button reappear where left when reloading WoW
    local options = {
        name = "MountShout",
        handler = MountShout,
        type = 'group',
        args = {
            gui = {
            guiHidden = true, -- don't show this in the GUI
            name = "Show the GUI",
            type = "execute",
            func = function()
                LibStub("AceConfigDialog-3.0"):Open("MountShout")
            end,
        }, -- arg gui end
    -- TEST: test buttons
            test = {
            cmdHidden = true, -- do not show this as a cmd line command
            guiHidden = true, -- don't show this in the GUI
            type = "group",
            name = "Test",
            desc = "actions",
            order = 40,
            args = {
                test1 = {
                    name = "Test 1",
                    type = "execute",
                    desc = test1desc,
                    order = 10,
                    func = function()
                        setupTest1()
                    end,
                }, -- arg test1 end
                test2 = {
                    name = "Test 2",
                    type = "execute",
                    desc = test2desc,
                    order = 10,
                    func = function()
                        setupTest2()
                    end,
                }, -- arg test2 end
                test3 = {
                    name = "Test 3",
                    type = "execute",
                    desc = test3desc,
                    order = 10,
                    func = function()
                        setupTest3()
                    end,
                }, -- arg test3 end
                test4 = {
                    name = "Test 4",
                    type = "execute",
                    desc = test4desc,
                    order = 10,
                    func = function()
                        setupTest4()
                    end,
                }, -- arg test4 end
                allChanTest= {
                    name = "AllChannels",
                    desc = "list of channels",
                    type = 'select',
                    order = 50,
                    values = 
                        function()
                        return allIDx
                        end,
                        get = function(info)
                            return allNames[MountShout.db.global.shoutChanName][2]
    --                        return chanSelect
                        end,
                        set = function(info, key)
                            MountShout.db.global.shoutChanName = allIDx[key]
                        end,
                }, -- arg allChanTest end 
                
            }, -- ens test args
            }, -- end test group
            
    -- Shouts: mount/woot shouts
            shouts = {
            type = "group",
            name = "Shouts",
            cmdHidden = true, -- do not show this as a cmd line command
            desc = "actions",
            order = 30,
            width = "half",
            args = {
                allMounts= {
                    name = "Mount",
                    desc = "list of mounts",
                    type = 'select',
                    order = 10,
                    values = 
                        function()
                            steed_table = {}
                            for i=1,nMounts do
                                steed_table[i]=mountTable[i][2]
                            end
                            return steed_table
                        end,
                        get = function(info)
                            return shoutSelect
                        end,
                        set = function(info, key)
                            shoutSelect = key
                        end,
                }, -- arg allMounts end 
                
                shoutIDs= {
                    name = "Shout Channel",
                    desc = "list of output channels for shout",
                    type = 'select',
                    order = 40,
                    values = 
                        function()
                            return allIDx
                        end,
                        get = function(info)
                            return allNames[MountShout.db.global.shoutChanName][2]
                        end,
                        set = function(info, key)
                            MountShout.db.global.shoutChanName = allIDx[key]
                        end,
                }, -- arg shoutIDs end 
                
                shoutMsg = {
                name = 'Shout Message',
                desc = 'custom message when mount is summoned, type it then hit "Okay"',
                type = 'input',
                order = 20,
                width = "full",
                get = "GetShout",
                set = "SetShout",
                }, -- end shoutMsg input
                
                defaultShoutMsg = {
                name = 'Default Message',
                desc = 'message if no custom message stored, type it then hit "Okay"',
                type = 'input',
                order = 30,
                width = "full",
                get = "GetDefaultShout",
                set = "SetDefaultShout",
                }, -- end defaultShoutMsg input
                
                wootIDs= {
                    name = "Woot Channel",
                    desc = "list of output channels for woot",
                    type = 'select',
                    order = 60,
                    values = 
                        function()
                            return allIDx
                        end,
                        get = function(info)
                            return allNames[MountShout.db.global.wootChanName][2]
                        end,
                        set = function(info, key)
                            MountShout.db.global.wootChanName = allIDx[key]
                            end,
                }, -- arg wootIDs end 
                
                wootMsg = {
                name = 'Woot Message',
                desc = 'message when new mount or critter is acquired, type it then hit "Okay"',
                type = 'input',
                order = 50,
                width = "full",
                    get = "GetWoot",
                    set = "SetWoot",
                }, -- end wootMsg input
                
    
            }, -- end shouts args
            }, -- end shouts group
    -- MOUNT: a way to test the mount commands (random, default, land)
            mount = {
            type = "group",
            cmdHidden = false, -- do not show this as a cmd line command
            name = "Mount",
            desc = "actions",
            order = 40,
            width = "half",
            args = {
                random = {
                    name = "Random",
                    type = "execute",
                    desc = 'pick random mount, flying if that is possible',
                    order = 10,
                    func = function()
                        pickRandomMount(getWhere())
                    end,
                }, -- arg random end
                default = {
                    name = "Default",
                    type = "execute",
                    desc = 'pick default mount, flying if that is possible',
                    order = 20,
                    func = function()
                        pickDefaultMount(getWhere())
                    end,
                }, -- arg default end
                landDefault = {
                    name = "Default Land",
                    type = "execute",
                    desc = 'pick default land mount',
                    order = 30,
                    func = function()
                        pickDefaultMount(getWhere("land"))
                    end,
                }, -- arg landDefault end
                landRndm = {
                    name = "Any Land",
                    type = "execute",
                    desc = 'pick any land mount',
                    order = 40,
                    func = function()
                        pickRandomMount(getWhere("land"))
                    end,
                }, -- arg landRndm end
                landRndm = {
                    name = "Special",
                    type = "execute",
                    desc = 'pick a desinated "special" mount',
                    order = 40,
                    func = function()
                        pickSpecialMount(getWhere())
                    end,
                }, -- arg special end
            lockBtns = {
                name = "Lock Buttons",
                type = "toggle",
                order = 50,
                desc = "Disable drag on mount buttons",
                get = function(info) return lockBtnBool end,
                set = function(info, v)
                    lockBtnBool = v
                    MountShout:HideOrLock()
                end,
                }, -- arg lockBtns end
             hideBtns = {
                 name = "Hide Buttons",
                 type = "toggle",
                 order = 60,
                 desc = "Hide mount buttons",
                 get = function(info) return MountShout.db.global.hideBtnBool end,
                 set = function(info, v)
                    MountShout.db.global.hideBtnBool = v
                    MountShout:HideOrLock()
                 end,
             }, -- arg hideBtnsend
                }, -- end mount args
            }, -- end mount group
    -- FILTERS: which types of mounts can be selected by random
            filters = {
            type = "group",
            cmdHidden = true, -- do not show this as a cmd line command
            name = "Filters",
            desc = "select which types of mounts will be selected",
            order = 20,
            args = {
            slowLand = {
                name = "Land Mounts",
                type = "toggle",
                order = 2,
                desc = "Toggle Normal Land Mount selection On/Off.",
                get = function(info) return MountShout.db.global.type2showBool end,
                set = function(info, v)
                    MountShout.db.global.type2showBool = v
                end,
                }, -- arg slowLand end
             fastLand = {
                 name = "Fast Land Mounts",
                 type = "toggle",
                 order = 4,
                 desc = "Toggle Fast Land Mount selection On/Off.",
                 get = function(info) return MountShout.db.global.type4showBool end,
                 set = function(info, v)
                     MountShout.db.global.type4showBool = v
                 end,
             }, -- arg fastLand end
             slowFly = {
                 name = "Flying Mounts",
                 type = "toggle",
                 order = 3,
                 desc = "Toggle Normal Flying Mount selection On/Off.",
                 get = function(info) return MountShout.db.global.type8showBool end,
                 set = function(info, v)
                     MountShout.db.global.type8showBool = v
                 end,
             }, -- arg slowFly end
             fastFly = {
                 name = "Fast Flying Mounts",
                 type = "toggle",
                 order = 5,
                 desc = "Toggle Fast Flying Mount selection On/Off.",
                 get = function(info) return MountShout.db.global.type16showBool end,
                 set = function(info, v)
                     MountShout.db.global.type16showBool = v
                 end,
             }, -- arg fastFly end
            }, -- end filters args
            }, -- end filters group
    -- STEEDS: select default mounts
            steeds ={
            type = "group",
            cmdHidden = true, -- do not show this as a cmd line command
            name = "Default Steeds",
            desc = "select Mounts for default etc.",
            order = 10,
            width = "half",
            args = {
                fly= {
                name = "Flying Mounts",
                desc = "list of normal flying mounts",
                type = 'select',
                order = 30,
                values = 
                    function()
                        steed_table = {}
                        for i=1,#flyMounts,1 do
                        steed_table[i]=flyMounts[i][3]
    --!!!                    print("FM: "..steed_table[i])
                        end
                        return steed_table
                    end,
                    get = function(info)
                        return flyMountNames[MountShout.db.global.flyDefaultName]
                    end,
                    set = function(info, key)
                        MountShout.db.global.flyDefaultName=flyMounts[key][3]
                    end,
                }, -- arg fly end --------------------------
                ride= {
                name = "Land Mounts",
                desc = "list of normal land mounts",
                type = 'select',
                order = 10,
                values = 
                    function()
                        steed_table = {}
                        for i=1,#landMounts,1 do
                        steed_table[i]=landMounts[i][3]
                        end
                        return steed_table
                    end,
                    get = function(info)
                        return landMountNames[MountShout.db.global.landDefaultName]
                    end,
                    set = function(info, key)
                        MountShout.db.global.landDefaultName=landMounts[key][3]
                    end,
                }, -- arg ride end --------------------------
                flyFast= {
                name = "Fast Flying Mounts",
                desc = "list of fast flying mounts",
                type = 'select',
                order = 40,
                values = 
                    function()
                        steed_table = {}
                        for i=1,#flyFastMounts,1 do
                        steed_table[i]=flyFastMounts[i][3]
                        end
                        return steed_table
                    end,
                    get = function(info)
                        return flyFastMountNames[MountShout.db.global.flyFastDefaultName]
                    end,
                    set = function(info, key)
                        MountShout.db.global.flyFastDefaultName=flyFastMounts[key][3]
                    end,
                }, -- arg flyFast end --------------------------
                rideFast= {
                name = "Fast Land Mounts",
                desc = "list of fast Land mounts",
                type = 'select',
                order = 20,
                values = 
                    function()
                        steed_table = {}
                        for i=1,#landFastMounts,1 do
                        steed_table[i]=landFastMounts[i][3]
                        end
                        return steed_table
                    end,
                    get = function(info)
                        return landFastMountNames[MountShout.db.global.landFastDefaultName]
                    end,
                    set = function(info, key)
                        MountShout.db.global.landFastDefaultName=landFastMounts[key][3]
                    end,
                }, -- arg rideFast end --------------------------
                --!!!
                special= {
                name = "designated 'Special' mount",
                desc = "list of all mounts",
                type = 'select',
                order = 50,
                values = 
                    function()
                        steed_table = {}
                        for i=1,#mountTable do
                        steed_table[i]=mountTable[i][2]
    --!!!                    print("SM: "..steed_table[i])
                        end
                        return steed_table
                    end,
                    get = function(info)
                        return MountNames[MountShout.db.global.specialDefaultName]
                    end,
                    set = function(info, key)
                        MountShout.db.global.specialDefaultName=mountTable[key][2]
                        end,
                }, -- arg special end --------------------------
    
            } -- steeds group args end
            } -- steeds group end 
        }, -- group args end
    } -- options end
    
    --options.args.profile = LibStub("AceDBOptions-3.0"):GetOptionsTable(db)
    LibStub("AceConfig-3.0"):RegisterOptionsTable("MountShout", options, {"MountShout","ms"})
    
    LibStub("AceConfigDialog-3.0"):SetDefaultSize("MountShout", 600, 400)
    LibStub("AceConfigDialog-3.0"):AddToBlizOptions("MountShout")
    Posted in: Lua Code Discussion
  • 0

    posted a message on making movable button reappear where left when reloading WoW
    local function pickSpecialMount(where)
        result = true
        if where=="mounted" then
            Dismount()
        elseif where == "combat" then
            result = false
        elseif where== "notAllowed" then
        elseif MountShout.db.global.specialDefaultName ~= nil then
        local testCode = mountTable[MountNames[MountShout.db.global.specialDefaultName]][1] >= 8
        local testWhere = (where== "landAll" or where=="land" or where== "landFast")
            if testWhere and testCode then
                print(L.MMtextWrongPlace)
            else
                local slot=MountShout.db.global.mountNames[MountShout.db.global.specialDefaultName]
                callMount(slot)
            end
        else
            result = false
        end
        return result
    end -- function
    
    
    local function pickDefaultMount(where)
        result = true
        if where=="mounted" then
            Dismount()
        elseif where == "combat" then
            result = false
        elseif where== "notAllowed" then
            print(L.MMtextNotHere)
        elseif where== "swimming" then
            callMount(seaTurtle)
        elseif where== "landFast" or where == "landAll" or forceLand=="land" then
            if MountShout.db.global.landFastDefaultName ~= nil then
                local slot=MountShout.db.global.mountNames[MountShout.db.global.landFastDefaultName]
                callMount(slot)
            else 
                local slot=landFastMounts[1][1]
                callMount(slot)
            end
        elseif where== "land" then
            if MountShout.db.global.landDefaultName ~= nil then 
                local slot=MountShout.db.global.mountNames[MountShout.db.global.landDefaultName]
                callMount(slot)
            else 
                local slot=landMounts[1][1]
                callMount(slot)
            end
        elseif where== "flyFast" or where == "flyAll" then
            if MountShout.db.global.flyFastDefaultName ~= nil then 
                local slot=MountShout.db.global.mountNames[MountShout.db.global.flyFastDefaultName]
                callMount(slot)
            else 
                local slot=flyFastMounts[1][1]
                callMount(slot)
            end
        elseif where== "fly" then
            if MountShout.db.global.flyDefaultName ~= nil then 
                local slot=MountShout.db.global.mountNames[MountShout.db.global.flyDefaultName]
                callMount(slot)
            else 
                local slot=flyMounts[1][1]
                callMount(slot)
            end
        else
            result = false
        end
        return result
    end -- function
    --================================================================
    -- test button creation
    -- why do I need this frame?  Buttins do not work without it
    local frm = CreateFrame("FRAME", nil, UIParent)
    frm:SetWidth(1)
    frm:SetHeight(1)
    frm:SetPoint("TOPLEFT", UIParent, "TOPLEFT")
    frm:SetBackdrop({bgFile = [[Interface\Buttons\WHITE8X8]],})
    --frm:Show()
    --===================================================================
    -- mount buttons
    local buttonParms={ -- "label",clickHandler,"name"
        {"Random",function() pickRandomMount(getWhere()) end,"RandomButton"},
        {"Default",function() pickDefaultMount(getWhere()) end,"DefaultButton"},
        {"Land",function() pickDefaultMount(getWhere("land")) end,"LandButton"},
        {"Any Land",function() pickRandomMount(getWhere("land")) end,"AnyLandButton"},
        {"Special",function() pickSpecialMount(getWhere()) end,"SpecialButton"},
        }
    do local MSbut= CreateFrame("BUTTON",buttonParms[1][3], UIparent,"UIpanelButtonTemplate")
    --do local entry= CreateFrame("BUTTON","$parentEntry1", UIparent,"UIpanelButtonTemplate")
        MSbut:SetID(1)
        MSbut:SetPoint("CENTER",UIparent,"CENTER",0,-150); 
        MSbut:SetWidth(64); MSbut:SetHeight(20);
        MSbut:SetAlpha(1)
        MSbut:SetText(buttonParms[1][1])
        MSbut:RegisterForClicks("LeftButtonUp")
        MSbut:SetScript("OnClick",buttonParms[1][2])
        MSbut:SetMovable(true)
        MSbut:EnableMouse(true)
        MSbut:RegisterForDrag("LeftButton")
        MSbut:SetScript("OnDragStart", MSbut.StartMoving)
        MSbut:SetScript("OnDragStop", MSbut.StopMovingOrSizing)
        for i = 2 ,#buttonParms do
            local MSbut= CreateFrame("BUTTON",buttonParms[i][3], UIparent,"UIpanelButtonTemplate")
    --        local entry= CreateFrame("BUTTON","$parentEntry"..i, UIparent,"UIpanelButtonTemplate")
            MSbut:SetID(i)
            MSbut:SetPoint("TOP",buttonParms[i-1][3],"BOTTOM"); 
            MSbut:SetWidth(64); MSbut:SetHeight(20);
            MSbut:SetAlpha(1)
            MSbut:SetText(buttonParms[i][1])
            MSbut:RegisterForClicks("LeftButtonUp")
            MSbut:SetScript("OnClick",buttonParms[i][2])
        end
    end
    --]]
    
    --================================================================
    function MountShout:GetShout(info)
    local retVal = getShoutFromSlot(shoutSelect)
        return retVal
    end -- function
    
    function MountShout:SetShout(info, newValue)
    local_, creatureName, spellID = GetCompanionInfo("MOUNT", shoutSelect)
        if creatureName ~= nil then
            MountShout.db.global.shoutTable[creatureName] = newValue
            local shout = getShoutFromSlot(shoutSelect)
            print(creatureName.." shout set to '"..shout.."'")
        end
    end -- function
    
    function MountShout:GetDefaultShout(info)
    local retVal = MountShout.db.global.defaultMountShout
        return retVal
    end -- function
    
    function MountShout:SetDefaultShout(info, newValue)
        MountShout.db.global.defaultMountShout = newValue
        print("Default shout set to '"..newValue.."'")
    end -- function
    
    function MountShout:GetWoot(info)
    local retVal = MountShout.db.global.wootShout
        return retVal
    end -- function
    
    function MountShout:SetWoot(info, newValue)
        MountShout.db.global.wootShout = newValue
        print("Woot shout set to '"..newValue.."'")
    end -- function
    
    function MountShout:HideOrLock()
        if MountShout.db.global.hideBtnBool == true then
            RandomButton:Hide()
            DefaultButton:Hide()
            AnyLandButton:Hide()
            LandButton:Hide()
            SpecialButton:Hide()
        else
            RandomButton:Show()
            DefaultButton:Show()
            AnyLandButton:Show()
            LandButton:Show()
            SpecialButton:Show()
        end
        if lockBtnBool == true then
            RandomButton:SetMovable(false)
        else
            RandomButton:SetMovable(true)
        end
    end -- function
    
        local testCnt1 = 0
    local test1desc = "fake new mount/critter"
    local function setupTest1()
        testCnt1 = testCnt1 + 1
        if testCnt1 >1 then
            testCnt1=0
            MMmountCount = MMmountCount - 1
            MountShout.db.global.mountList[5]="testItem"
        else
            MMcritterCount = MMcritterCount - 1
            MountShout.db.global.critterList[5]="testItem"
        end
        newMountTest()
        newCritterTest()
    end -- function
    
        local test2desc = "GetChannelList"
    local function setupTest2()
    PopulateCustomChannelList()
    for k,v in pairs(CustomChannels) do print(k,v) end
    end -- function
    
        local test3desc = "print arrays"
    local function setupTest3() 
    print("channelID: len="..#channelID)
    for k,v in pairs(channelID) do print(k,v) end
    print("allIDx: len="..#allIDx)
    for k,v in pairs(allIDx) do print(k,v) end
    print("allNames: len="..#allNames)
    for k,v in pairs(allNames) do print(k,v) end
    end -- function
    
        local test4desc = "test 4"
    local function setupTest4()
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on making movable button reappear where left when reloading WoW
    I'm really sorry I have upset you. I did not think I should put up 1200 lines of code but here goes: ... well I tried. My code is more than 20,000 chars too long. so here it goes in chunks.
    -- MountShout by Mudge of Uther
    --
    -- mount codes --
    --1  = slow Mount(Not Summoned)
    --2  = riding mount
    --4  = epic riding mount
    --8  = flying mount
    --16 = epic flying mount
    --32 = special mount(for area specific mounts)
    ------------------- mount commands -----------------------------
    local MountShout = LibStub("AceAddon-3.0"):NewAddon("MountShout", "AceConsole-3.0")
    local L = LibStub('AceLocale-3.0'):GetLocale('MountShout')
    local CURRENT_VERSION = GetAddOnMetadata('MountShout', 'Version')
    
    local defaults = {
        global = {
            type2showBool = true, -- riding
            type4showBool = true, -- fast riding
            type8showBool = true, -- flyingMounts
            type16showBool = true, -- fast flying
            hideBtnBool = false, -- hide mount buttons
            landDefaultName= nil,
            flyDefaultName= nil,
            landFastDefaultName= nil,
            flyFastDefaultName= nil,
            specialDefaultName= nil,
            shoutTable = {},
            critterList={}, -- name of all old critters by slot#
            critterNames = {}, -- old critters slot# indexed by name
            mountList={}, -- name of all old mounts by slot#
            mountNames = {}, -- old mounts slot# indexed by name
            wootShout="This is the default Woot",
            defaultMountShout="$mount has been summoned",
            wootChanName = "SAY", -- channel for bragging about new mounts & critters
            shoutChanName = "SAY",  -- channel for mount shout
            saveDate = "not loaded",
        },
    }
    local lockBtnBool = true -- lock mount buttons
    
    local mountTable={} -- {code,name} by slot#
    local landMounts={} -- {slot,code,name}
    local flyMounts={}  -- {slot,code,name}
    local landFastMounts={} -- {slot,code,name}
    local flyFastMounts={}  -- {slot,code,name}
    local otherMounts={}  -- {slot,code,name}
    
    local MountNames={} -- list index by name
    local landMountNames={} -- list index by name
    local flyMountNames={}  -- list index by name
    local landFastMountNames={} -- list index by name
    local flyFastMountNames={}  -- list index by name
    local otherMountNames={}  -- list index by name
    
    local nFly=0
    local nLand=0
    local nFlyF=0
    local nLandF=0
    local nOther=0
    local nSlot = nil
    
    local shoutSelect = 1 -- slot#
    local shoutMsg = "This is a test message"
    
    local zone = GetRealZoneText()
    local subZone = GetSubZoneText()
    local seaTurtle = nil
    
    local channelID = {
        "SAY",
        "YELL",
        "GUILD",
        "PARTY",
        "RAID",
    }
    
    local allIDx = {        -- names indexed by sequential number}
    }
    
    local allNames = {    -- dict channel,list# indexed by name
    }
    
    local function MM_SendChatMessage(outString,channelString)
    local msg = outString
    local cName = channelString
    local index,name = GetChannelName(cName)
        if (index~=nil and name ~= nil) or cName == "General" then 
            if cName=="General" then
                index = 1
            end
            SendChatMessage(msg , "CHANNEL", nil, index); 
        else
            SendChatMessage(msg , cName);
        end
    end -- function
     
    local function buildChannelList(...)
       local tbl = {}
       for i = 1, select("#", ...), 2 do
         local id, name = select(i, ...)
         tbl[id] = name
       end
        return tbl
     end
     
    local ServerChannels = {} -- includes LFG, trade, etc
    local PopulateServerChannelList = function()
        wipe(ServerChannels)
        for i = 1, select('#', EnumerateServerChannels()) do
            ServerChannels[select(i, EnumerateServerChannels())] = true
        end
    end
    
    local CustomChannels = {}
    local PopulateCustomChannelList = function()
        wipe(CustomChannels)
        PopulateServerChannelList()
        for i = 1, select('#', GetChannelList()) do
            if i % 2 == 1 then
                local name = select(i + 1, GetChannelList())
                if (strsub(name,1,3) ~= "Crb" and not ServerChannels[name]) or name=="General"   then
                    CustomChannels[select(i, GetChannelList())] = name
                end
            end
        end
    end
    
    
    local function buildAllNames()
    -- dictionary index by name
    allIDx = nil
    allNames = nil
    allIDx = {}
    allNames = {}
    local j = 0
        for i = 1, #channelID do
            j = j + 1
            allIDx[j] = channelID[i]
            allNames[channelID[i]] = {0, j}
        end
        PopulateCustomChannelList()
        for k,v in pairs(CustomChannels) do
            j = j + 1
            allIDx[j] = CustomChannels[k]
            if CustomChannels[k] ~= nil then 
                allNames[CustomChannels[k]] = {k, j} 
            end
        end
        if allNames[MountShout.db.global.wootChanName] == nil then
            MountShout.db.global.wootChanName = "SAY"
            print("allNames was nill for "..MountShout.db.global.wootChanName) --!!!
        end
        if allNames[MountShout.db.global.shoutChanName] == nil then
            MountShout.db.global.shoutChanName = "SAY"
            print("allNames was nill for "..MountShout.db.global.shoutChanName) --!!!
        end
    end
    
    local newCritter = "na"
    local newMount = "na"
    local MMcritterCount=0
    local MMmountCount=0
    
    local function MMbuildCritterTable()
    nCritters = GetNumCompanions("CRITTER")
        local newTest = false
        for nSlot = 1, nCritters do
        local_, creatureName, spellID = GetCompanionInfo("CRITTER", nSlot)
        local oldItem = MountShout.db.global.critterList[nSlot]
            if oldItem ~= creatureName and newTest == false then
                newCritter = creatureName
                newTest = true
            end
            MountShout.db.global.critterList[nSlot]=creatureName
            MountShout.db.global.critterNames[creatureName]=nSlot
        end
        MMcritterCount = nCritters
        print(L.MMtextRebuiltCT_P..MMcritterCount..L.MMtextRebuiltCT_S)
    end -- function
    
    CreateFrame("GameTooltip","MStt",UIParent,"GameTooltipTemplate") -- tooltip for scan
    
    local function MMbuildMountTables()
    nMounts = GetNumCompanions("MOUNT")
    print(L.MMtextRebuiltP..nMounts..L.MMtextRebuiltS)
    -- build subTables for Fly, Land
        nFly=0
        nLand=0
        nFlyF=0
        nLandF=0
        nOther=0
        
        local newTest = false
        for nSlot=1 , nMounts do
        -- first get creature names as f(slot)
            local_, creatureName, spellID = GetCompanionInfo("MOUNT", nSlot)
            local oldItem = MountShout.db.global.mountList[nSlot]
            -- check for new entry
            if oldItem ~= creatureName and newTest == false then
                newMount = creatureName
                newTest = true
            end
            -- update by_slot and by_name lists
            if creatureName ~= nil then
                MountShout.db.global.mountList[nSlot]=creatureName
                MountShout.db.global.mountNames[creatureName]=nSlot
            end
    -- tooltip scan ================================================
    local typeCode = 1
    GameTooltip_SetDefaultAnchor(MStt, UIParent)
    MStt:SetHyperlink("spell:"..spellID)
    if creatureName then 
        for i = 1, MStt:NumLines() do 
        local flying, veryFast, fast, special
        local text = _G["MSttTextLeft"..i]:GetText() -- 
            for word in string.gmatch(text, "%S+") do 
                if strfind(word, "Outland") or strfind(word, "Northrend") then
                    flying = true 
                elseif (strfind(word, "very") or strfind(word, "extremely")) and strfind(word,"fast") then
                    veryFast = true 
                elseif strfind(word, "fast")then
                    fast = true
                elseif strfind(word, "Ahn'Qiraj")then
                    special = true
                end
            end
            if flying then typeCode = 8 else typeCode = 2 end
            if (fast or veryFast) and not flying then  typeCode = 4 end
            if (fast or veryFast) and flying then  typeCode = 16 end
            if special and not (fast or veryFast) then typeCode = 32 end
        end
    end
    MStt:Hide()
    -- end tooltip scan ===========================================
    
    --        if MMmountDict[spellID] then -- mount is found in table
              if creatureName == "Sea Turtle" then seaTurtle=nSlot end 
              -- fill table from dict held on MSmountlist.lua, check for name difference
               MountNames[creatureName]=nSlot
               mountTable[nSlot]={typeCode, creatureName} -- code, name
               if mountTable[nSlot][1] == 8 then -- nornal flyingMounts
                   nFly=nFly+1
                   flyMounts[nFly]={nSlot, mountTable[nSlot][1], mountTable[nSlot][2]}
                   flyMountNames[mountTable[nSlot][2]]=nFly
               elseif mountTable[nSlot][1] == 16 then -- fast flyingMounts
                   nFlyF=nFlyF+1
                   flyFastMounts[nFlyF]={nSlot, mountTable[nSlot][1], mountTable[nSlot][2]}
                   flyFastMountNames[mountTable[nSlot][2]]=nFlyF
               elseif mountTable[nSlot][1] == 2 then -- landMounts
                   nLand=nLand+1
                   landMounts[nLand]={nSlot, mountTable[nSlot][1], mountTable[nSlot][2]}
                   landMountNames[mountTable[nSlot][2]]=nLand
               elseif mountTable[nSlot][1] == 4 then -- fast landMounts
                   nLandF=nLandF+1
                   landFastMounts[nLandF]={nSlot, mountTable[nSlot][1], mountTable[nSlot][2]}
                   landFastMountNames[mountTable[nSlot][2]]=nLandF
               elseif mountTable[nSlot][1] == 32 then -- special Mounts; limited area etc.
                   nOther=nOther+1
                   otherMounts[nOther]={nSlot, mountTable[nSlot][1], mountTable[nSlot][2]}
                   otherMountNames[mountTable[nSlot][2]]=nOther
                end -- put in local table test
        end -- main nSlot for/do
        MMmountCount = nMounts
        print("nMounts "..nMounts..",nFly "..nFly..", nLand"..nLand..",nFlyF "..nFlyF..", nLandF"..nLandF..",nOther "..nOther)
    
    -- filter out mounts where n=0
        if nLand == 0 then MountShout.db.global.type2showBool = false end -- riding
        if nLandF == 0 then MountShout.db.global.type4showBool = false end -- fast riding
        if nFly == 0 then MountShout.db.global.type8showBool = false end -- flying
        if nFlyF == 0 then MountShout.db.global.type16showBool = false end -- fast flying
        end -- function
    
    local function setDefaultMount()
        if nLand > 0 then
            if MountShout.db.global.landDefaultName == nil and landMounts[1][3] ~= nil then 
                MountShout.db.global.landDefaultName=landMounts[1][3] 
                print(L.MMtextNil..MountShout.db.global.landDefaultName)
            end
        end
        if nLandF > 0 then
            if MountShout.db.global.landFastDefaultName == nil and landFastMounts[1][3] ~= nil then 
                MountShout.db.global.landFastDefaultName=landFastMounts[1][3] 
                print(L.MMtextNil..MountShout.db.global.landFastDefaultName)
            end
        end
        if nFly > 0 then
            if MountShout.db.global.flyDefaultName == nil and flyMounts[1][3] ~= nil then 
                MountShout.db.global.flyDefaultName=flyMounts[1][3] 
                print(L.MMtextNil..MountShout.db.global.flyDefaultName)
            end
        end
        if nFlyF > 0 then
            if MountShout.db.global.flyFastDefaultName == nil and flyFastMounts[1][3] ~= nil then 
                MountShout.db.global.flyFastDefaultName=flyFastMounts[1][3] 
                print(L.MMtextNil..MountShout.db.global.flyFastDefaultName)
            end
        end
        if nMounts > 0 then
            if MountShout.db.global.specialDefaultName == nil and mountTable[1][2] ~= nil then 
                MountShout.db.global.specialDefaultName=mountTable[1][2] 
                print(L.MMtextNil..MountShout.db.global.specialDefaultName)
            end
        end
    end -- function
    
    function MountShout:OnInitialize()
      -- Code that you want to run when the addon is first loaded goes here.
        self.db = LibStub("AceDB-3.0"):New("MountShoutDB", defaults)
    end -- function
    
    function MountShout:RefreshConfig()
      -- would do some stuff here
    end -- function
    
    local playerName = "na" --
    
    function MountShout:OnEnable()
    -- Called when the addon is enabled
        print(L.MMtextIntro1..CURRENT_VERSION)
        print(L.MMtextIntro2)
        print(L.MMtextSchan..MountShout.db.global.shoutChanName..L.MMtextWchan..MountShout.db.global.wootChanName)
        print(L.MMtextDate..MountShout.db.global.saveDate) -- do not remove
        MMbuildMountTables()
        setDefaultMount()
        MMbuildCritterTable()
        playerName = UnitName("player") 
        buildAllNames()
        MountShout:HideOrLock()
        end -- function
    
    function MountShout:OnDisable()
        -- Called when the addon is disabled
    end -- function
    
    local function getShoutFromSlot (slot)
    local _, creatureName, spellID = GetCompanionInfo("MOUNT", slot) -- by slot
    local shout = MountShout.db.global.shoutTable[creatureName]
        local cName = creatureName
        if shout then
            shout = string.gsub(shout,"$mount",cName)
            shout = string.gsub(shout,"$player",playerName)
            return shout
        else
            if creatureName ~= nil then
                shout = MountShout.db.global.defaultMountShout
                shout = string.gsub(shout,"$mount",cName)
                shout = string.gsub(shout,"$player",playerName)
            else
                shout = "no mounts to shout about"
            end
            return shout
        end
    end -- function
    
    local function sayMounted(slot)
    local shout = getShoutFromSlot(slot)
    local chan = MountShout.db.global.shoutChanName
        MM_SendChatMessage(shout,chan)
    end -- function
    
    local function callMount(slot)
        CallCompanion("MOUNT", slot)
        sayMounted(slot)
    end -- function
    
    local function newMountTest()
    local nM = GetNumCompanions("MOUNT")
        if MMmountCount < nM then
            MMbuildMountTables()
            setDefaultMount()
            local chan = MountShout.db.global.wootChanName 
            local shout = MountShout.db.global.wootShout
            shout = string.gsub(shout,"$item",newMount)
            shout = string.gsub(shout,"$player",playerName)
            shout = string.gsub(shout,"$type","mount") 
            shout = string.gsub(shout,"$num",nM) 
            MM_SendChatMessage(shout,chan)
            newMount = "na"
        end
    end -- function
    
    local function newCritterTest()
    local nC = GetNumCompanions("CRITTER")
        if MMcritterCount < nC then
            MMbuildCritterTable()
            local chan = MountShout.db.global.wootChanName
            local shout = MountShout.db.global.wootShout
            shout = string.gsub(shout,"$item",newCritter)
            shout = string.gsub(shout,"$player",playerName)
            shout = string.gsub(shout,"$type","companion")
            shout = string.gsub(shout,"$num",nC)
            MM_SendChatMessage(shout,chan)
            newCritter = "na"
        end
    end -- function
    
    -- set up updates
    totalUpdateTime = 0
    local function OnUpdate(self,elapsed)
        totalUpdateTime = totalUpdateTime + elapsed
        if totalUpdateTime > 1 then -- once a second
            totalUpdateTime = 0
            MountShout.db.global.saveDate = date("%m/%d/%y %H:%M:%S")
        end
    end -- function
    
    -- Here we build event handlers and redister them
    --================================================================
    
    local events = {}
    
    function events.PLAYER_ENTERING_WORLD(...)
        RandomButton:SetMovable(false)
        lockBtnBool = true
    end -- function
    ----------------------------------------------
    function events.PLAYER_LEAVING_WORLD(...)
        RandomButton:SetMovable(true)
    end -- function
    ----------------------------------------------
    function events.COMPANION_LEARNED(...)
        print("companion learned");
            newMountTest()
            newCritterTest()
    end -- function
    ----------------------------------------------
    function events.CHAT_MSG_CHANNEL_NOTICE(...)
    local eventType,numName, chanType, chanNum, chanName = select(2, ...), select(5, ...), select(8, ...), select(9, ...), select(10, ...)
        if eventType == "YOU_JOINED" or eventType == "YOU_LEFT" then
            buildAllNames() -- build name indexed array
        end
    end
    --================================================================
    
    local f = CreateFrame("frame")
    f:SetScript("OnUpdate", OnUpdate)
    f:SetScript("OnEvent", 
        function(self, event, ...)
        events[event](self, ...); -- call one of the registered events
        end);
        
    for k, v in pairs(events) do
        f:RegisterEvent(k); -- register all events for which handlers have been defined
    end
    
    local function getWhere(forceLand) -- type of mount based on location
    local where = "notAllowed"
    local inCombat = UnitAffectingCombat("player") -- true if in combat
        if IsMounted() then 
            where = "mounted"
        elseif inCombat then
            where = "combat"
        elseif IsOutdoors() and IsSwimming() and seaTurtle then
            where="swimming"
        elseif IsOutdoors() and forceLand and (nLand + nLandF) > 0 then 
            if MountShout.db.global.type2showBool and MountShout.db.global.type4showBool and nLand >0 and nLandF > 0 then
            where = "landAll"
            elseif MountShout.db.global.type4showBool and nLandF > 0 then
            where = "landFast"
            elseif MountShout.db.global.type2showBool and nLand > 0 then
            where = "land"
            end
        elseif IsOutdoors()and not IsFlyableArea() and (nLand + nLandF) > 0 then 
            if MountShout.db.global.type2showBool and MountShout.db.global.type4showBool and nLand >0 and nLandF > 0 then
            where = "landAll"
            elseif MountShout.db.global.type4showBool and nLandF > 0 then
            where = "landFast"
            elseif MountShout.db.global.type2showBool and nLand > 0 then
            where = "land"
            end
        elseif IsOutdoors() and IsFlyableArea() or ( GetSubZoneText() == "Krasus' Landing") and (nFly + nFlyF) > 0 then --  Fly is OK
            if MountShout.db.global.type8showBool and MountShout.db.global.type16showBool and nFly >0 and nFlyF > 0 then
            where = "flyAll"
            elseif MountShout.db.global.type16showBool and nFlyF > 0 then
            where = "flyFast"
            elseif MountShout.db.global.type8showBool and nFly > 0 then
            where = "fly"
            end
        end
        return where
    end -- function
    
    local function pickRandomMount(where)
        result = true
        if where=="mounted" then
            Dismount()
        elseif where == "combat" then
            print(L.MMtextInCombat) -- so you know why no mount summoned
            result = false
        elseif where=="notAllowed" then
            print(L.MMtextNotHere)
        elseif where=="swimming" then
            callMount(seaTurtle)
            ------- land mounts
        elseif where=="landAll" or forceland == "land" then
            local rolled = math.random(nLand + nLandF) -- total number of all land mounts
            if rolled > nLand then -- select from fast mounts
                rolled = rolled - nLand
                slot = landFastMounts[rolled][1]
                callMount(slot)
            else -- select from normal mounts
                slot = landMounts[rolled][1]
                callMount(slot)
            end
        elseif where=="landFast" then
            local rolled = math.random(nLandF) -- total number of fast land mounts
            local slot=landFastMounts[rolled][1]
            callMount(slot)
        elseif where=="land" then
            local rolled = math.random(nLand) -- total number of normal land mounts
            local slot=landMounts[rolled][1]
            callMount(slot)
            ------  Flying Mounts
        elseif where=="flyAll" then
            local rolled = math.random(nFly + nFlyF) -- total number of all flying mounts
            if rolled > nFly then -- select from fast mounts
                rolled = rolled - nFly
                slot = flyFastMounts[rolled][1]
                callMount(slot)
            else
                slot = flyMounts[rolled][1]
                callMount(slot)
            end
        elseif where=="flyFast" then
            local rolled = math.random(nFlyF) -- total number of fast flying mounts
            local slot=flyFastMounts[rolled][1]
            callMount(slot)
        elseif where=="fly" then
            local rolled = math.random(nFly) -- total number of normal flying mounts
            local slot=flyMounts[rolled][1]
            callMount(slot)
        else
            result = false
        end
        return result
    end -- function
    Posted in: Lua Code Discussion
  • 0

    posted a message on making movable button reappear where left when reloading WoW
    Never mind ... for anyone else looking at this thread, I did find a kludge fix for the problem (which was that leaving WoW with the button locked resulted in its position not being restored when WoW was reloaded. Leaving with the button movable did result in a restored position). The kludge which works is
    ----------------------------------------------
    function events.PLAYER_LEAVING_WORLD(...)
        RandomButton:SetMovable(true)
    end -- function
    ----------------------------------------------
    function events.PLAYER_ENTERING_WORLD(...)
        RandomButton:SetMovable(false)
        lockBtnBool = true
    end -- function
    ----------------------------------------------
    This does mean the button is locked in the desired location upon loading so the user must unlock it if it is to be moved but this may actually be the best behavior anyway.

    This allows me to move on ... I will return to finding a better approach as I become more familiar with the WoW API and Lua
    Posted in: Lua Code Discussion
  • 0

    posted a message on making movable button reappear where left when reloading WoW
    Quote from Phanx
    Post your whole code, or at least the whole function/script. It's pretty much pointless to try to diagnose problems when you only post random snippets.


    Sorry ... looking at my original post you see
        MSbut:SetScript("OnDragStart", MSbut.StartMoving)
        MSbut:SetScript("OnDragStop", MSbut.StopMovingOrSizing)

    You suggest that I place function calls for the Drag Start and Drag Stop scripts (at least that is what you do in Speedometer). I simply do not seem to be able to make that work. What should I place in the lines above and what should the functions look like? I realize you feel I should figure this out for myself and I have tried. Lua and wow addons are new to me and my bad habits developed with languages like SOAP, Fortran, and Forth sometimes get in my way.
    Posted in: Lua Code Discussion
  • 0

    posted a message on making movable button reappear where left when reloading WoW
    Thanks: I tried that using
    local point, relativeTo, relativePoint, xOfs, yOfs = RandomButton:GetPoint()
    MountShout.db.global.RandomButtonPoint=point
    MountShout.db.global.RandomButtonXoff=xOfs
    MountShout.db.global.RandomButtonYoff=yOfs
    
    and 
    
    RandomButton:ClearAllPoints()
    RandomButton:SetPoint(RandomButtonPoint,MountShout.db.global.RandomButtonXoff,MountShout.db.global.RandomButtonYoff)
    end -- function

    It did not seem to help but I will look further.
    Posted in: Lua Code Discussion
  • 0

    posted a message on making movable button reappear where left when reloading WoW
    I have created a movable button group where the first button is movable and the rest are attached, each to its predecessor. This works with just one problem. I lock/unlock the group with
        if MountShout.db.global.lockBtnBool == true then
            RandomButton:SetMovable(false)
        else
            RandomButton:SetMovable(true)
        end
    using a checkbox to set the state of the lockBtnBool global. If I close WoW with the button group unlocked, it reappears where it was left when WoW is relaunched. However, if I close WoW with the button group locked, it instead reappears at this 'birthplace' 150 units below the center of UIParent. How can I force it to reappear where it has been dragged?
    local buttonParms={ -- "label",clickHandler,"name"
        {"Random",function() pickRandomMount(getWhere()) end,"RandomButton"},
        {"Default",function() pickDefaultMount(getWhere()) end,"DefaultButton"},
        {"Land",function() pickDefaultMount(getWhere("land")) end,"LandButton"},
        {"Any Land",function() pickRandomMount(getWhere("land")) end,"AnyLandButton"},
        {"Special",function() pickSpecialMount(getWhere()) end,"SpecialButton"},
        }
    do local MSbut= CreateFrame("BUTTON",buttonParms[1][3], UIparent,"UIpanelButtonTemplate")
    --do local entry= CreateFrame("BUTTON","$parentEntry1", UIparent,"UIpanelButtonTemplate")
        MSbut:SetID(1)
        MSbut:SetPoint("CENTER",UIparent,"CENTER",0,-150); 
        MSbut:SetWidth(64); MSbut:SetHeight(20);
        MSbut:SetAlpha(1)
        MSbut:SetText(buttonParms[1][1])
        MSbut:RegisterForClicks("LeftButtonUp")
        MSbut:SetScript("OnClick",buttonParms[1][2])
        MSbut:SetMovable(true)
        MSbut:EnableMouse(true)
        MSbut:RegisterForDrag("LeftButton")
        MSbut:SetScript("OnDragStart", MSbut.StartMoving)
        MSbut:SetScript("OnDragStop", MSbut.StopMovingOrSizing)
        for i = 2 ,#buttonParms do
            local MSbut= CreateFrame("BUTTON",buttonParms[i][3], UIparent,"UIpanelButtonTemplate")
    --        local entry= CreateFrame("BUTTON","$parentEntry"..i, UIparent,"UIpanelButtonTemplate")
            MSbut:SetID(i)
            MSbut:SetPoint("TOP",buttonParms[i-1][3],"BOTTOM"); 
            MSbut:SetWidth(64); MSbut:SetHeight(20);
            MSbut:SetAlpha(1)
            MSbut:SetText(buttonParms[i][1])
            MSbut:RegisterForClicks("LeftButtonUp")
            MSbut:SetScript("OnClick",buttonParms[i][2])
        end
    end
    Phanx was correct but gave little help in exactly how to do what he suggested. What works is to save the position in the globals as the button is being dragged:
    --!!!    MSbut:SetScript("OnDragStop", MSbut.StopMovingOrSizing)
        MSbut:SetScript("OnDragStop", function(this) this:StopMovingOrSizing(); local point, relativeTo, relativePoint, xOfs, yOfs = RandomButton:GetPoint()
            MountShout.db.global.RandomButtonPoint=point
            MountShout.db.global.RandomButtonXoff=xOfs
            MountShout.db.global.RandomButtonYoff=yOfs
        end)
    ----------------------- and to restore it
    function MountShout:OnEnable()
    --  misc other stuff
    RandomButton:ClearAllPoints() 
    RandomButton:SetPoint(MountShout.db.global.RandomButtonPoint,MountShout.db.global.RandomButtonXoff,MountShout.db.global.RandomButtonYoff)        MountShout:HideOrLock()
    end -- function
    Posted in: Lua Code Discussion
  • 0

    posted a message on Player rating addon
    There is an addon from folks at CMI WowLens which tries to do ratings. See http://wowlens.cs.umn.edu/research for more. I find it much too complicated to be practical but it is interesting never-the-less. A simple +/0/- overall rating with autodefault to 0 might be practical.
    Posted in: Addon Ideas
  • 0

    posted a message on Hello guild
    I agree that these things are not best automated. How hard is it to type "/g Hi there folks" ?
    Posted in: Addon Ideas
  • 0

    posted a message on Why do I get 'Addon ... already exists'?
    I am trying my second Ace3 addon for WoW. The first works well but the second gives me the following message when I launch WoW Ithough the addon works just fine). The line that generates the message is:
    MudgeTools = LibStub("AceAddon-3.0"):NewAddon("MudgeTools", "AceConsole-3.0")


    Can anybody help me with this?
    ---------------------
    Date: 2009-10-08 13:14:25
    ID: 1
    Error occured in: Global
    Count: 1
    Message: ..\AddOns\MudgeTools\core.lua line 2:
    Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - Addon 'MudgeTools' already exists.
    Debug:
    [C]: ?
    [C]: error()
    Ace3\AceAddon-3.0\AceAddon-3.0.lua:93: NewAddon()
    MudgeTools\core.lua:2: in main chunk
    -------
    Posted in: AddOn HELP!
  • 0

    posted a message on Need example of select and/or multiselect
    I posted asking for examples of type = "select" but got no help here. I finally figured out how to create a select item and store selected values. I post it here for some other nub with the same question. This is undoubtedly not the best example of Ace3 coding .. probably someone will tell me what dumb things I have done.

    edit: I still can not see how to pass a table with default values that set the initial state of 'spells'
    --------------------------------------------------------------------------------
    mudgeAce3 = LibStub("AceAddon-3.0"):NewAddon("mudgeAce3", "AceConsole-3.0")
    
    function mudgeAce3:OnInitialize()
        self.db = LibStub("AceDB-3.0"):New("mudgeAce3DB", defaults)
        -- more stuff here like refresh
    end
    
    function mudgeAce3:OnEnable()
        -- Called when the addon is enabled
    end
    
    function mudgeAce3:OnDisable()
        -- Called when the addon is disabled
    end
    
    -- ...
    
    -- Hunter spells of interest
    local spellList = { -- name, spellID, CD
               {"Misdirection",34477,30}, 
               {"Tranq Shot",19801,8}, 
               {"Serpent Sting",49001,15},
               {"Steady Shot",49052,2},
    } -- spellList end
    
    ---------------------------------------------
    local options = {
           name = "mudgeAce3",
           handler = mudgeAce3,
           type = 'group',
           args = {
             spells= {
             name = "Spell List",
             desc = "list of Hunter's spells of interest",
             type = 'select',
             order = 0,
             values = function()
                 spell_table = {}
          for i=1,#spellList,1 do
                   spell_table[i]=spellList[i][1]
                   end
                   return spell_table
              end,
              get = function(info)
                   return mudgeAce3.db.profile.spell_key
              end,
              set = function(info, key)
                   mudgeAce3.db.profile.spell_key=key
                   mudgeAce3.spell_print(key)
              end,
             }, -- arg spells end --------------------------
             gui = {
                   name = "Show the GUI",
                   type = "execute",
                   func = function()
                         LibStub("AceConfigDialog-3.0"):Open("mudgeAce3")
                   end,
                   guiHidden = true, -- don't show this in the GUI
             }, -- arg gui end
           } -- group end
    } -- options end
    
    function mudgeAce3:GetMyMessage(info)
           return myMessageVar
    end
    
    function mudgeAce3:SetMyMessage(info, input)
           myMessageVar = input
           mudgeAce3:Print(input)
    end
    
    LibStub("AceConfig-3.0"):RegisterOptionsTable("mudgeAce3", options, {"mudgeAce3","ma3"})
    LibStub("AceConfigDialog-3.0"):SetDefaultSize("mudgeAce3", 600, 400)
    LibStub("AceConfigDialog-3.0"):AddToBlizOptions("mudgeAce3")
    Posted in: Ace3
  • To post a comment, please or register a new account.