• 0

    posted a message on Can't upload file
    Nevermind, I figured it out.
    Posted in: Need Help?
  • 0

    posted a message on Can't upload file
    So, I feel very silly right now. I accidentally realized I packaged an old lua file with my zip and instead of just updating the zip file on my project page....I deleted it. Now it keeps saying I can't upload the same file. I even renamed the zip and it still won't go through. Any ideas?

    This is what it says when I try to upload the file:
    This file has already been uploaded. Don't upload the same file more than once.
    Posted in: Need Help?
  • 0

    posted a message on First Addon Issues
    Okay, I have almost everything working. Anyone know of a good source to explain Metatables? I'm pretty sure it's the only way I'll be able to update the values of my keys in the array table. It'd be so much easier if it would just allow me to add....
    Posted in: AddOn HELP!
  • 0

    posted a message on First Addon Issues
    Quote from KalikaraBWR
    As for what I'm wanting to show, I'd like to show the results of a session of milling/DE'ing/prospecting in a simple window. For example, if I need to prospect 30 stacks of ore for my guild and I forgot to check my bags for gems first. It'd be nice to have a simple visual to check and see what I've done. I found an old addon which did something similar but to the tooltip. I'm just trying to modify it and update it.

    So what I'd end up seeing at the end of a boring day of clicking:
    Amberjewel - 4
    Carnelian - 12
    Ember Topaz - 3
    Zephyrite - 22

    If I was more advanced at Addon coding, I'd love to see it sorted by gem type. Granted, if I was making it for just Cata and above mats, I could probably make a big framework of individual font strings. I'm hoping to also make it user friendly for lower levels just for fun.


    So my two variables would be BIDItemName and BIDQuantity. Mostly I replaced information from a very old addon to update it and change how it works slightly. So far it seems I should have just started from scratch. Either way, I'd like to be able to create an array of the items looted and their quantity and then show them in a fontstring on the frame. The quantity numbers would be updated until the player hits the reset button.
    Posted in: AddOn HELP!
  • 0

    posted a message on First Addon Issues
    Woot! Now I have no bugs! And the slash command works. Now....to make the addon actually do what I'm trying to get it to do.

    local myBIDResults = {}
    --local texture, item, quantity, quality, locked = GetLootSlotInfo(i);
    
    local function WorkResults()
    	for i = 1, GetNumLootItems() do
    		local BIDitemName = GetLootSlotLink(i)
    		local BIDquantity = select(3, GetLootSlotInfo(i))
    		if not myBIDResults[BIDitemName] then
    			myBIDResults[BIDitemName] = {}
    		end
    		if myBIDResults[BIDitemName] then
    			myBIDResults[BIDitemName] = myBIDResults[BIDitemName] + BIDquantity
    		else
    			myBIDResults[BIDitemName] = BIDquantity
    		end
    	end
    end
    
    local function ShowResults()
    local text = ""
    	if myBIDResults > 0 then
    		for BIDitemName, BIDquantity in pairs(myBIDResults) do
    			text = BIDitemName.." - "..BIDquantity"\n"
    		end
    	end
    	fontString:SetText(text)
    end


    I've done plenty of VB coding but I have no idea how to translate it into WoW lua speak. Now I commented out one of the lines because it was creating an error. I assumed it was due to the fact I don't have to have it there. It was just in the original coding I'm dissecting.
    Posted in: AddOn HELP!
  • 0

    posted a message on First Addon Issues
    Okay, got both addons and ended up with this:

    1x BreakItDown-1.0\BreakItDown.lua:66: attempt to call method 'RegisterForEvent' (a nil value)


    1x <string>:"BIDFrame1:show()":1: attempt to index global 'BIDFrame1' (a nil value)
    <in C code>: in function `RunScript'
    Interface\FrameXML\ChatFrame.lua:2118: in function `?':
    Interface\FrameXML\ChatFrame.lua:4293: in function `ChatEdit_ParseText':
    Interface\FrameXML\ChatFrame.lua:3992: in function `ChatEdit_SendText':
    Interface\FrameXML\ChatFrame.lua:4031: in function `ChatEdit_OnEnterPressed':
    <string>:"*:OnEnterPressed":1: in function <[string "*:OnEnterPressed"]:1>
    Posted in: AddOn HELP!
  • 0

    posted a message on First Addon Issues
    Oops. Sorry about that. And the command doesn't do a thing. I know all I did was hit the close button when I was last testing it.

    Here is the information from my FrameXML log.

    2/4 11:50:04.538 Loading add-on BreakItDown
    2/4 11:50:04.538 ** Loading table of contents Interface\AddOns\BreakItDown\BreakItDown.toc
    2/4 11:50:04.538 Couldn't open Interface\AddOns\BreakItDown\BreakItDown
    2/4 11:50:04.538 Interface\AddOns\BreakItDown\BreakItDown.lua:104: '=' expected near '=='
    2/4 11:50:04.538 Loading add-on NeedToKnow
    2/4 11:50:04.538 ** Loading table of contents Interface\AddOns\NeedToKnow\NeedToKnow.toc
    2/4 11:50:04.538 Couldn't open Interface\AddOns\NeedToKnow\NeedToKnow_GroupOptionsTemplate.xml
    Posted in: AddOn HELP!
  • 0

    posted a message on First Addon Issues
    Quote from Dridzt
    3. What does /run BidFrame1:Show() do?


    Well, I named the frame BIDFrame1 so I assumed it would show the frame since it's currently hidden.
    Posted in: AddOn HELP!
  • 0

    posted a message on First Addon Issues
    Now I can't get the frame to show back up to test my code. I tried adding a slash command to show the frame but it's not registering /breakitdown as a command.

    -- Author      : Kali
    local PROSPECT_ID = 31252
    local MILLING_ID = 51005
    local DE_ID = 13262
    local PROSPECT = GetSpellInfo(PROSPECT_ID)
    local MILLING = GetSpellInfo(MILLING_ID)
    local DE = GetSpellInfo(DE_ID)
    local getContents = false
    local version = "v20122101"
    
    local pairs
    
    local frame = CreateFrame("Frame", "BidFrame1", UIParent)
    frame:SetToplevel(true)
    frame:SetMovable(true)
    frame:EnableMouse(true)
    frame:SetWidth(282)
    frame:SetHeight(348)
    frame:SetPoint("CENTER", 0, 71)
    
    frame:SetBackdrop({
    	edgeFile = [[Interface\DialogFrame\UI-DialogBox-Background]],
    	edgeSize = 32,
    	insets = { left = 11, right = 12, top = 12, bottm = 11 }
    })
    
    local titleText = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
    titleText:SetText("Break It Down")
    titleText:SetJustifyV("TOP")
    titleText:SetWidth(250)
    titleText:SetHeight(22)
    titleText:SetPoint("TOPLEFT", 16, -15)
    frame.titleText = titleText
    
    local resultsText = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
    resultsText:SetJustifyV("TOP")
    resultsText:SetWidth(250)
    resultsText:SetHeight(256)
    resultsText:SetPoint("TOPLEFT", 16, -34)
    frame.resultsText = resultsText
    
    local closeButton = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
    closeButton:SetText("Close")
    closeButton:SetWidth(75)
    closeButton:SetHeight(23)
    closeButton:SetPoint("TOPLEFT", 171, -296)
    closeButton:SetScript("OnClick", function(self, mouseButton)
    	BidFrame1:Hide()
    end)
    frame.closeButton = closeButton
    
    local resetButton = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate")
    resetButton:SetText("Reset Data")
    resetButton:SetWidth(75)
    resetButton:SetHeight(23)
    resetButton:SetPoint("TOPLEFT", 32, -296)
    resetButton:SetScript("OnClick", function(self, mouseButton)
    	myBIDResults = {}
    	wipe(myBIDResults)
    	BIDFrame1:Update();
    end)
    frame.resetButton = resetButton
    
    frame:RegisterForDrag("LeftButton")
    frame:SetScript("OnDragStart", frame.StartMoving)
    frame:SetScript("OnDragStop", frame.StopMovingOrSizing)
    
    frame:RegisterForEvent("ADDON_LOADED")
    frame:RegisterForEvent("LOOT_OPENED")
    frame:RegisterForEvent("PLAYER_LOGIN")
    
    frame:SetScript("OnEvent", function(self, event, ...)
    	if event == "LOOT_OPENED" then
    		if getContents then
    			WorkResults()
    		end
    	end
    end)
    
    local function BIDHelp()
    	print("Show Break It Down : /breakitdown show")
    end
    
    local function handler (msg, editbox)
    	if msg == '' then
    		BIDHelp()
    	elseif msg == 'show' then
    		BidFrame1:Show()
    	end
    end
    
    SlashCmdList["BREAKITDOWN"] = handler;
    SLASH_BREAKITDOWN1 = "/breakitdown"
    
    local myBIDResults = {}
    local lootIcon, lootName, lootQuantity, rarity, locked = GetLootSlotInfo(i);
    
    local function WorkResults()
    	for i = 1, GetNumLootItems() do
    		local BIDitemName = GetLootSlotLink(i)
    		local BIDquantity = select(3, GetLootSlotInfo(i))
    		if not myBIDResults[BIDitemName] then
    			myBIDResults[BIDitemName] = {}
    		end
    		if myBIDResults[BIDitemName] then
    			myBIDResults[BIDitemName] == myBIDResults[BIDitemName] + BIDquantity
    		else
    			myBIDResults[BIDitemName] == BIDquantity
    		end
    	end
    end
    
    local function ShowResults()
    local text = ""
    	if myBIDResults > 0 then
    		for BIDitemName, BIDquantity in pairs(myBIDResults) do
    			text = BIDitemName.." - "..BIDquantity"\n"
    		end
    	end
    	fontString:SetText(text)
    end
    
    local spellsToTrack = {
    	[13262] = true, -- Disenchant
    	[51005] = true, -- Milling
    	[31252] = true, -- Prospecting
    }
    
    frame:RegisterEvent("UNIT_SPELLCAST_START")
    frame:SetScript("OnEvent", function(self, event, ...)
    	if event == "UNIT_SPELLCAST_START" then
    		local unit, spellName, _, _, spellID = ...
    		if unit == "player" and spellsToTrack[spellID] then
    			getContents = true
    		end
    	end
    end)
    Posted in: AddOn HELP!
  • 0

    posted a message on First Addon Issues
    Quote from Phanx

    You're missing an "end" in there, and proper indentation of your code would have made that obvious. Here's the same code with the indentation fixed:

    local function ShowResults()
    	if myResults > 0 then
    		for itemName, num in pairs(myResults[itemName]) do
    			if itemName = quantity then
    				FSResults:SetText(itemName.." - "..quantity);
    			end
    		end
    	end
    


    The missing "end" at the end is obvious now. :)


    Ugg, this is what I get for not using Notepad++ from the start. I was trying to shortcut things and use the AddonStudio thing. So far, it seems to be more trouble then it's worth. Back to the basics for me. As for what I'm wanting to show, I'd like to show the results of a session of milling/DE'ing/prospecting in a simple window. For example, if I need to prospect 30 stacks of ore for my guild and I forgot to check my bags for gems first. It'd be nice to have a simple visual to check and see what I've done. I found an old addon which did something similar but to the tooltip. I'm just trying to modify it and update it.

    So what I'd end up seeing at the end of a boring day of clicking:
    Amberjewel - 4
    Carnelian - 12
    Ember Topaz - 3
    Zephyrite - 22

    If I was more advanced at Addon coding, I'd love to see it sorted by gem type. Granted, if I was making it for just Cata and above mats, I could probably make a big framework of individual font strings. I'm hoping to also make it user friendly for lower levels just for fun.
    Posted in: AddOn HELP!
  • 0

    posted a message on First Addon Issues
    Quote from Farmbuyer
    First thing: you only need to include the Lua file once. Either in the .toc or in the .xml, but not both.

    (Truthfully, you don't need the XML at all. If you're more comfortable learning with it, that's fine. Most people on these forums tend to prefer using only Lua, and bringing in XML only when strictly required.)

    Second thing: there are no global "this" or "event" variables set automatically for you. That went away many, many patches ago; whatever you're using for a reference is badly outdated.

    When you write <Stuff> blocks in XML, they get turned into Lua functions with some parameters already declared for you (listed here). If you want to have your XML blocks call functions defined in your Lua file, you need to pass those parameters along. Namely, "self", "event", and any event parameters (like the ones you're expecting to receive in "...").


    I was mostly using the xml to help me visually see what the frames would end up looking like. I'm going to read through the link you put up and start making changes to work with the updated version.
    Posted in: AddOn HELP!
  • 0

    posted a message on First Addon Issues
    <Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.blizzard.com/wow/ui/">
    	<Script file="BreakItDown.lua" />
    	<Frame name="BIDFrame1" parent="UIParent" toplevel="true" movable="true" enableMouse="true">
    		<Size>
    			<AbsDimension x="282" y="348" />
    		</Size>
    		<Anchors>
    			<Anchor point="CENTER">
    				<Offset x="-149" y="71" />
    			</Anchor>
    		</Anchors>
    		<TitleRegion name="" setAllPoints="true">
    			<Size>
    				<AbsDimension x="0" y="30" />
    			</Size>
    			<Anchors>
    				<Anchor point="TOPLEFT" />
    				<Anchor point="TOPRIGHT" />
    			</Anchors>
    		</TitleRegion>
    		<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
    			<BackgroundInsets>
    				<AbsInset left="11" right="12" top="12" bottom="11" />
    			</BackgroundInsets>
    			<TileSize>
    				<AbsValue val="32" />
    			</TileSize>
    			<EdgeSize>
    				<AbsValue val="32" />
    			</EdgeSize>
    		</Backdrop>
    		<Layers>
    			<Layer level="OVERLAY">
    				<FontString name="FSTitle" inherits="GameFontNormal" text="Break It Down" justifyV="TOP">
    					<Size>
    						<AbsDimension x="250" y="22" />
    					</Size>
    					<Anchors>
    						<Anchor point="TOPLEFT">
    							<Offset x="16" y="-15" />
    						</Anchor>
    					</Anchors>
    				</FontString>
    				<FontString name="FSResults" inherits="GameFontNormal" text="" justifyV="TOP">
    					<Size>
    						<AbsDimension x="250" y="256" />
    					</Size>
    					<Anchors>
    						<Anchor point="TOPLEFT">
    							<Offset x="16" y="-34" />
    						</Anchor>
    					</Anchors>
    				</FontString>
    			</Layer>
    		</Layers>
    		<Frames>
    			<Button name="Button1" inherits="UIPanelButtonTemplate" text="Close">
    				<Size>
    					<AbsDimension x="75" y="23" />
    				</Size>
    				<Anchors>
    					<Anchor point="TOPLEFT">
    						<Offset x="171" y="-296" />
    					</Anchor>
    				</Anchors>
    				<Scripts>
    					<OnClick>
    						Button1_OnClick();
    					</OnClick>
    				</Scripts>
    			</Button>
    			<Button name="Button2" inherits="UIPanelButtonTemplate" text="Reset Data">
    				<Size>
    					<AbsDimension x="75" y="23" />
    				</Size>
    				<Anchors>
    					<Anchor point="TOPLEFT">
    						<Offset x="32" y="-296" />
    					</Anchor>
    				</Anchors>
    				<Scripts>
    					<OnClick>
    						Button2_OnClick();
    					</OnClick>
    				</Scripts>
    			</Button>
    		</Frames>
    		<Scripts>
    			<OnLoad>
    				Frame1_OnLoad();
    				self:RegisterForDrag("LeftButton");
    			</OnLoad>
    			<OnDragStart>
    				self:StartMoving();
    				self:isMoving=true;
    			</OnDragStart>
    			<OnDragStop>
    				self:StopMovingOrSizing();
    				self:isMoving=false;
    			</OnDragStop>
    			<OnEvent>
    				Frame1_OnEvent();
    			</OnEvent>
    		</Scripts>
    	</Frame>
    </Ui>


    BreakItDown
    ## Author: Kali
    ## Interface: 40300
    ## Title: BreakItDown
    ## Version: 1.0
    BreakItDown.lua
    BreakItDown.xml


    Ah, I was wondering if it was a lost in translation type of problem.
    Posted in: AddOn HELP!
  • 0

    posted a message on First Addon Issues
    Well, I tried changing the name of the frame and the close button is still not working. Very annoying...

    local PROSPECT_ID = 31252
    local MILLING_ID = 51005
    local DE_ID = 13262
    local PROSPECT = GetSpellInfo(PROSPECT_ID)
    local MILLING = GetSpellInfo(MILLING_ID)
    local DE = GetSpellInfo(DE_ID)
    local getContents = false
    local version = "v20122101"
    
    local pairs
    
    function BIDFrame1_OnLoad()
    	this:RegisterEvent("ADDON_LOADED");	
    	this:RegisterEvent("LOOT_OPENED");
    	this:RegisterEvent("VARIABLES_LOADED");
    
    	DEFAULT_CHAT_FRAME:AddMessage("|cffff000Break it Down is ready for work")
    
    end
    
    function Button1_OnClick()
    	BIDFrame1:Hide();
    end
    
    function BIDFrame1_OnEvent()
    	if event == "UNIT_SPELLCAST_INTERRUPTED" then
    		local unitID, spell, rank = ...
    		if unitID == "player" and spell == PROSPECT or spell == MILLING or spell == DE then
    			getContents = false
    		end
    	end
    	if event == "LOOT_OPENED" then
    		if getContents then
    			WorkResults()
    		end
    	end
    	if event == "LOOT_CLOSED" then
    		getContents = false
    	end
    end
    
    function Button2_OnClick()
    	myResults = {}
    	BIDFrame1:Update();
    end
    
    local function WorkResults()
    	for i = 1, GetNumLootItems() do
    		local itemName = select(2, GetLootSlotInfo(i))
    		local quantity = select(3, GetLootSlotInfo(i))
    		if not myResults[itemName] then
    			MakeTableEntry(itemName)
    		end
    		if myResults[itemName] then
    			myResults[itemName] = myResults[itemName] + quantity
    		else
    			myResults[itemName] = quantity
    		end
    	end
    end
    
    local function ShowResults()
    	if myResults > 0 then
    		for itemName, num in pairs(myResults[itemName]) do
    		if itemName = quantity then
    		FSResults:SetText(itemName.." - "..quantity);
    		end
    	end
    end
    
    
    local function MakeTableEntry(itemName)
    	local name = GetItemInfo(itemName)
    	myResults[itemName] = {}
    end
    
    
    hooksecurefunc("CastSpell", function(...)
    	local spellName = GetSpellInfo(...)
    	if spellName:lower() == PROSPECT:lower() or spellName:lower() == MILLING:lower() or spellName:lower() == DE:lower() then
    		getContents = true
    	end
    end)
    
    hooksecurefunc("CastSpellByID", function(spellID)
    	if spellID == PROSPECT_ID or spellID == MILLING_ID or spellID == DE_ID then
    		getContents = true
    	end
    end)
    
    hooksecurefunc("UseAction", function(actionID)
    	local spellID = select(2, GetActionInfo(actionID))
    	if spellID == PROSPECT_ID or spellID == MILLING_ID or spellID == DE_ID then
    		getContents = true
    	end
    end)
    
    hooksecurefunc("CastSpellByName", function(spellName, onSelf)
    	if spellName:lower() == PROSPECT:lower() or spellName:lower() == MILLING:lower() or spellName:lower() == DE:lower() then
    		getContents = true
    	end
    end)


    That's the whole thing. Some of it is bits and pieces from other addons and some of it is mine. Mostly I've been working on creating a frame that shows the number of gems, pigments, and DE mats you end up getting in a large session. I figured I could add in general commands later, like a start recording type command (or button). At the moment, all that happens is the frame loads with all the labels and buttons in place. I can move it around. But it doesn't seem to do a thing.

    I also have the following showing up in my FrameXML file.
    1/26 18:52:56.714 Loading add-on BreakItDown
    1/26 18:52:56.714 ** Loading table of contents Interface\AddOns\BreakItDown\BreakItDown.toc
    1/26 18:52:56.714 Couldn't open Interface\AddOns\BreakItDown\BreakItDown
    1/26 18:52:56.714 Interface\AddOns\BreakItDown\BreakItDown.lua:28: cannot use '...' outside a vararg function near '...'
    1/26 18:52:56.714 ++ Loading file Interface\AddOns\BreakItDown\BreakItDown.xml
    1/26 18:52:56.714 Interface\AddOns\BreakItDown\BreakItDown.lua:28: cannot use '...' outside a vararg function near '...'
    1/26 18:52:56.714 [string "*:OnDragStart"]:2: function arguments expected near '='
    1/26 18:52:56.714 [string "*:OnDragStop"]:2: function arguments expected near '='
    Posted in: AddOn HELP!
  • 0

    posted a message on First Addon Issues
    I'm working on my first addon and I keep hitting a wall with it. I'm very familiar with VB coding and can get a basic idea of what the code is saying when I read it.

    The first problem which cropped up is that my close button doesn't seem to work at all. I figured I'd start fixing the simple problems first.

    function Button1_OnClick()
    	Frame1:Hide();
    end


    Sweet and simple code. Funny story, it works when I'm also running my "Hello World" app which I did to familiarize myself with the new language. If I'm running my addon by itself, the button shows itself pressing down but the frame never hides.
    Posted in: AddOn HELP!
  • To post a comment, please or register a new account.