• 0

    posted a message on Array In AceDB
    This is my set:

    set = function(item, value) OxyAddon.db.profile[item[#item]] = value end,
    


    This is my set function:
    function OxyAddon:SetGroundMounts(info, newValue)
    	self.db.profile.GroundMount = { strsplit(";", newValue) }
    end
    


    This is my get:
    get = function(item) return OxyAddon.db.profile[item[#item]] end,
    


    This is my get function:
    function OxyAddon:GetGroundMounts(info)
    	self.string = ""
    	for index,value in ipairs(self.db.profile.GroundMount) do
    		self.string = self.string..value..";"
    	end
    	return self.string
    end
    

    Any help would be great, thanks again guys.
    Posted in: Need Help?
  • 0

    posted a message on Array In AceDB
    In short I am trying to make a random mount caster
    for all the dif type of area, ground, flying, and sea. I want to store the numbers of the mount ex. out of 12 on each page using the numbers say 3 are flyers, number 2 across, number 5 across and so on, would look like 2,5,...
    I was using the options and acedb so i could have diff profiles for each toon. you would go into interface>addons tab and select my addon in txt boxes were numbers 2,5,... for ground mounts, and in the flying mounts was 1,3,... what ever the numbers are will randomly choose a mount and cast.

    Thanks! Any help is great.
    Posted in: Need Help?
  • 0

    posted a message on Array In AceDB
    It is a number, it would be like 1,2,3

    The Database contents look like this.

    OxyAddonDB = {
    	["profileKeys"] = {
    		["Milfanated - Shandris"] = "Default",
    	},
    	["profiles"] = {
    		["Default"] = {
    			["GroundMount"] = {
    				"2,3,4", -- [1]
    			},
    		},
    	},
    }
    
    Posted in: Need Help?
  • 0

    posted a message on Array In AceDB
    Hey guys, I am building a small project that is requiring me to store an array for later use. I am storing the array as follows.

    local options1 = {
    	name = L["OxyAddon Setup"],
    	type = "group",
    	handler = OxyAddon,
    	get = function(item) return OxyAddon.db.profile[item[#item]] end,
    	set = function(item, value) OxyAddon.db.profile[item[#item]] = value end,
    	args = {
    		GroundMount = {
    			type = "input",
    			name = L["Ground Mounts Label"],
    			desc = L["Ground Mounts Desc"],
    			usage = L["Ground Mounts Usage"],
    			order = 1,
    			width = "full",
    			get = "GetGroundMounts",
    			set = "SetGroundMounts",
    		},
    
    
    unction OxyAddon:GetGroundMounts(info)
    	self.string = ""
    	for index,value in ipairs(self.db.profile.GroundMount) do
    		self.string = self.string..value..";"
    	end
    	return self.string
    end
    
    function OxyAddon:SetGroundMounts(info, newValue)
    	self.db.profile.GroundMount = { strsplit(";", newValue) }
    end
    


    When I run this it returns a hex number or similar, but mot the actual data I have entered.

    print(self.db.profile.GroundMount)
    


    Question is How do I store a array in the acedb and or fetch it for later use.


    Thank you, Any help would be great.
    Posted in: Need Help?
  • 0

    posted a message on Shift-clicking an item
    Hello again, and sorry, I should have stated but I am a bit new to lua, I have good experience in c++ and lsl(lyndon scripting language) but very little in lua, I would love to learn more and have been playing around a bit with it. As far as the globals I should use local for the most of then unless I need to globally access them correct?
    Posted in: Need Help?
  • 0

    posted a message on Shift-clicking an item
    Im sorry but I don't see a reply to me, I am trying to figure how to get the value for this part of he code:
    local itemLink = blahblah -- Get your itemlink somehow
    
    How do I get item link in that variable?
    
    Thank you again, any help would be great.
    
    
    Here is some of the code:
    
    function TradeTalker_Broadcast()
    
        rString = EditBox_RecruitmentString:GetText()
        bCastTime = EditBox_BroadcastTime:GetNumber()
        bCastTimeString = tostring(bCastTime)
        TradeTalker_ClearFocus()
        if bCastTime <= 29 then
            DEFAULT_CHAT_FRAME:AddMessage("[TradeTalker]Sorry, this is not a spamming tool. Time must be greater than 30 seconds.")
            TradeTalker_StopTimer()
        else
        DEFAULT_CHAT_FRAME:AddMessage(string.format("%s %s %s", "[TradeTalker]Starting broadcast in ", bCastTimeString, " seconds..."))
        f:Show()
        
        -- Frame to receive OnUpdate calls
        -- last is the time since the code last executed
        -- throttle is the time to wait between executions (in seconds). This is a 1 minute delay.
        local last, throttle = 0, bCastTime
        f:SetScript('OnUpdate', function(self, elapsed)
    
    	-- Increment the time since last update
    
    	last = last + elapsed
    
    	-- If the time since last execution exceeds the wait time, then broadcast a message.
        
    	if last >= throttle then
    		local index = GetChannelName("Trade - City") -- It finds trade is a channel at index 1
            if (index~=nil) then 
                SendChatMessage(rString, "CHANNEL", nil, index);
            end
            
    		-- Reset time since last update
    
    		last = 0
    
    	    end
    
        end)
        
        end
        
    end
    
    --[[
       Shift click func.
    ]]--
    function TradeTalkerUI:OnClick(self, button)
    
        local itemLink = blahblah -- Get your itemlink somehow
        local itemName = GetItemInfo(itemLink)
        if (itemLink and button == "LeftButton" and IsShiftKeyDown() and ChatFrameEditBox:IsVisible()) then
            -- Insert itemlink into chat
            ChatFrameEditBox:Insert(itemLink)
            return
        end
        if (itemLink and button == "LeftButton" and IsShiftKeyDown() and (not ChatFrameEditBox:IsVisible()) and (EditBox_RecruitmentString and EditBox_RecruitmentString:IsVisible())) then
            -- Insert itemlink into AH browse editbox
            EditBox_RecruitmentString:SetText(itemName)
            return
        end
        
    end
    
    Posted in: Need Help?
  • 0

    posted a message on Shift-clicking an item
    In regards to this post http://forums.curseforge.com/showthread.php?t=10347 I also am looking for the same function but to no avail have been able to get the itemlink from chat or inventory. Any help would be great, thank you, rawroot
    Posted in: Need Help?
  • 0

    posted a message on Shift-clicking an item
    How would I go about getting the itemlink from chat or inventory?

    Any help would be great, Thank you, rawroot
    Posted in: Need Help?
  • To post a comment, please or register a new account.