• 0

    posted a message on CurseForge
    I have 5 files total uploaded to my project, i only want the newest one. How do i delete the other's?
    Posted in: General Chat
  • 0

    posted a message on Why isn't this working?
    Had alot of those unfinished, and i also forgot the '/' for the closing of the OnLoad's. But, now my button's won't for for the guildLoot frame. Any idea's?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Why isn't this working?
    I added the buttons to my guildloot frame, and a background to it. I have been away for awhile, and just now bought time last night. Durring my month of not playing i added my button's and the function's in the lua and the lua. I also added the printing to FirstDayRunning.txt
    Posted in: Lua Code Discussion
  • 0

    posted a message on Why isn't this working?
    That is correct, but not even the minimap button frame is showing anymore
    Posted in: Lua Code Discussion
  • 0

    posted a message on Why isn't this working?
    Sorry, was in a hurry and forgot to describe the problem. My minimap icon isn't being displayed, but it says its using 8 kib.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Why isn't this working?
    Alright, this is my .xml:

    <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="GuildLoot.lua" />
    	<Button name="guildLoot_MinimapButton" parent="Minimap" enableMouse="true" movable="true" hidden="false">
    		<Size>
    			<AbsDimension x="30" y="30"/>
    		</Size>
    		<Anchors>
    			<Anchor point="TOPLEFT"/>
    		</Anchors>
    		<Layers>
    			<Layer level="BACKGROUND">
    				<Texture name="guildLoot_MinimapButton_Icon" file="Interface\Addons\GuildLoot\MMimage\fixedMM">
    					<Size>
    						<AbsDimension x="25" y="25"/>
    					</Size>
    					<Anchors>
    						<Anchor point="BOTTOM">
    							<Offset>
    								<AbsDimension x="0" y="5"/>
    							</Offset>
    						</Anchor>
    					</Anchors>
    				</Texture>
    			</Layer>
    			<Layer level="OVERLAY">
    				<Texture file="Interface\Minimap\MiniMap-TrackingBorder">
    					<Size>
    						<AbsDimension x="50" y="50"/>
    					</Size>
    					<Anchors>
    						<Anchor point="TOPLEFT"/>
    					</Anchors>
    				</Texture>
    			</Layer>
    		</Layers>
    		<Frames>
    			<Frame name="guildLoot_MinimapButton_DraggingFrame" hidden="true">
    				<Scripts>
    					<OnUpdate>
    						guildLoot_MinimapButton_DraggingFrame_OnUpdate()
    					</OnUpdate>
    				</Scripts>
    			</Frame>
    		</Frames>
    		<HighlightTexture alphaMode="ADD" file="Interface\Minimap\UI-Minimap-ZoomButton-Highlight"/>
    		<Scripts>
    			<OnLoad>
    				self:RegisterForClicks("LeftButtonUp","RightButtonUp")
    				self:RegisterForDrag("LeftButton","RightButton")
    			</OnLoad>
    			<OnDragStart>
    				self:LockHighlight()
    				guildLoot_MinimapButton_DraggingFrame:Show()
    			</OnDragStart>
    			<OnDragStop>
    				self:UnlockHighlight()
    				guildLoot_MinimapButton_DraggingFrame:Hide()
    			</OnDragStop>
    			<OnClick>
    				guildLoot_MinimapButton_OnClick(button, self)
    			</OnClick>
    		</Scripts>
    	</Button>
    	<Frame name="guildLoot" parent="UIParent" toplevel="true" movable="true" enableMouse="true">
    		<Size>
    			<AbsDimension x="650" y="26" />
    		</Size>
    		<Anchors>
    			<Anchor point="CENTER">
    				<Offset x="1" y="1" />
    			</Anchor>
    		</Anchors>
    		<TitleRegion setAllPoints="true">
    			<Size>
    				<AbsDimension x="-10" y="5" />
    			</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="5" right="5" top="5" bottom="5" />
    			</BackgroundInsets>
    			<TileSize>
    				<AbsValue val="32" />
    			</TileSize>
    			<EdgeSize>
    				<AbsValue val="32" />
    			</EdgeSize>
    			<Color r="0.4" g="0" b="1" />
    			<BorderColor r="0.5" g="0" b="1" />
    		</Backdrop>
    		<Layers>
    			<Layer level="OVERLAY">
    				<FontString name="lootAmounts" font="Interface\Addons\GuildLoot\Fonts\COPRGTB.TTF" text=" " outline="NORMAL">
    					<Size>
    						<AbsDimension x="600" y="50" />
    					</Size>
    					<Anchors>
    						<Anchor point="CENTER">
    							<Offset x="0" y="0" />
    						</Anchor>
    					</Anchors>
    					<FontHeight>
    						<AbsValue val="14" />
    					</FontHeight>
    					<Color r="1" g="1" b="0" />
    				</FontString>
    			</Layer>
    		</Layers>
    		<Scripts>
    			<OnLoad>
    				guildLoot_OnLoad(self);
    			</OnLoad>
    			<OnEvent>
    				guildLoot_OnEvent(self, event, ...);
    			</OnEvent>
    			<OnDragStart>
    				self:StartMoving();
    			</OnDragStart>
    			<OnDragStop>
    				self:StopMovingOrSizing();
    			</OnDragStop>
    		</Scripts>
    	</Frame>
    
    <Button name="guildLoot_SendMoneyGuild" inherits="UIPanelButtonTemplate" parent="guildLoot"
    	<Size>
    		<AbsDimension x="15" y="15" />
    	</Size>
    			
    		<Layers>
    			<Layer level="OVERLAY">
    				<FontString name="guildLoot_SendMoneyGuildText" font="Interface\Addons\GuildLoot\Fonts\COPRGTB.TTF" text="Guild" outline="NORMAL">
    					<Size>
    						<AbsDimension x="15" y="15" />
    					</Size>
    					<Anchors>
        						<Anchor point="TOPRIGHT"/>
    						<Offset x="0" y="-40" />
      					</Anchors>
    					<FontHeight>
    						<AbsValue val="14" />
    					</FontHeight>
    				</FontString>
    			</Layer>
    		</Layers>
    	<Scripts>
    		<OnClick>
    			guildLoot_SendMoneyGuild_OnClick(button, self)
    		<OnClick>
    	</Scripts>
    	<HighlightColor r="1" g="0" b="0" />
    	<DisabledColor r="0" g="0" b="1" />
    </Button>
    
    <Button name="guildLoot_SendMoneyParty" inherits="UIPanelButtonTemplate" parent="guildLoot"
    	<Size>
    		<AbsDimension x="15" y="15" />
    	</Size>	
    		<Layers>
    			<Layer level="OVERLAY">
    				<FontString name="guildLoot_SendMoneyPartyText" font="Interface\Addons\GuildLoot\Fonts\COPRGTB.TTF" text="Party" outline="NORMAL">
    					<Size>
    						<AbsDimension x="15" y="15" />
    					</Size>
    					<Anchors>
        						<Anchor point="TOPLEFT"/>
    						<Offset x="0" y="-40" />
      					</Anchors>
    					<FontHeight>
    						<AbsValue val="14" />
    					</FontHeight>
    				</FontString>
    			</Layer>
    		</Layers>
    	<Scripts>
    		<OnClick>
    			guildLoot_SendMoneyParty_OnClick(button, self)
    		<OnClick>
    	</Scripts>
    	<HighlightColor r="1" g="0" b="0" />
    	<DisabledColor r="0" g="0" b="1" />
    </Button>
    
    <Frame name="GL_infoFrame" parent="UIParent" toplevel="true" movable="true" enableMouse="true">
    		<Size>
    			<AbsDimension x="650" y="150" />
    		</Size>
    		<Anchors>
    			<Anchor point="CENTER">
    				<Offset x="1" y="1" />
    			</Anchor>
    		</Anchors>
    		<TitleRegion setAllPoints="true">
    			<Size>
    				<AbsDimension x="-10" y="5" />
    			</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="5" right="5" top="5" bottom="5" />
    			</BackgroundInsets>
    			<TileSize>
    				<AbsValue val="32" />
    			</TileSize>
    			<EdgeSize>
    				<AbsValue val="32" />
    			</EdgeSize>
    			<Color r="0.4" g="0" b="1" />
    			<BorderColor r="0.5" g="0" b="1" />
    		</Backdrop>
    		<Layers>
    			<Layer level="OVERLAY">
    				<FontString name="infoFirst_GL" font="Interface\Addons\GuildLoot\Fonts\COPRGTB.TTF" text=" " outline="NORMAL">
    					<Size>
    						<AbsDimension x="600" y="125" />
    					</Size>
    					<Anchors>
    						<Anchor point="CENTER">
    							<Offset x="0" y="0" />
    						</Anchor>
    					</Anchors>
    					<FontHeight>
    						<AbsValue val="14" />
    					</FontHeight>
    					<Color r="1" g="1" b="0" />
    				</FontString>
    			</Layer>
    		</Layers>
    		<Scripts>
    		</Scripts>
    	</Frame>
    
    	<Button name="GL_infoFrameClose" inherits="UIPanelButtonTemplate" parent="GL_infoFrame"
    	<Size>
    		<AbsDimension x="15" y="15" />
    	</Size>	
    		<Layers>
    			<Layer level="OVERLAY">
    				<FontString name="guildLoot_InfoText" font="Interface\Addons\GuildLoot\Fonts\COPRGTB.TTF" text="Close" outline="NORMAL">
    					<Size>
    						<AbsDimension x="15" y="15" />
    					</Size>
    					<Anchors>
        						<Anchor point="TOPLEFT"/>
    						<Offset x="0" y="-40" />
      					</Anchors>
    					<FontHeight>
    						<AbsValue val="14" />
    					</FontHeight>
    				</FontString>
    			</Layer>
    		</Layers>
    	<Scripts>
    		<OnClick>
    			GL_infoFrameClose_OnClick(button, self)
    		<OnClick>
    	</Scripts>
    	<HighlightColor r="1" g="0" b="0" />
    	<DisabledColor r="0" g="0" b="1" />
    </Button>
    </Ui>


    .lua:

    local goldLoot = GOLD_AMOUNT:gsub("%%d", "%(%%d+%)")
    local silverLoot = SILVER_AMOUNT:gsub("%%d", "%(%%d+%)")
    local copperLoot = COPPER_AMOUNT:gsub("%%d", "%(%%d+%)")
    
    -- Get ready for GuildLoot to recognize old amount's that you have deposited.
    -- It will load total amount and send it to the guildLoot frame, to show your
    -- current total, even if you haven't looting any money this session,
    
    function guildLoot_OnLoad(self)
    	self:Hide()
    	GL_infoFrame:Hide()
    	self:RegisterEvent("PLAYER_ENTERING_WORLD")
    	self:RegisterEvent("CHAT_MSG_MONEY")
    	self:RegisterEvent("VARIABLES_LOADED")
    end
    
    function guildLoot_OnEvent(self, event, msg)
    	if event == "PLAYER_ENTERING_WORLD" then
    			local  yourGuild, _, _ = GetGuildInfo("player")
    			guildLoot_currentTotal = guildLoot_currentTotal or 0
    			print( GetCoinTextureString( guildLoot_currentTotal or 0 ) .. " since first running GuildLoot." )
    	end
    	if event == "VARIABLES_LOADED" then
    		print("GuildLoot has been loaded.")
    			lootAmounts:SetText( "You have looted " .. GetCoinTextureString( guildLoot_currentTotal or 0 ) .. " for " .. yourGuild .. "'s bank." )
    			if virgin_GL < 2 then
    				GL_infoFrame:Show()
    				GL_infoFrame:SetText("Hold down the Alt key, and right click the GuildLoot minimap button to functionalize the AddOn. If you want to see your total in the GuildLoot frame before you have looted any money when starting a new session, you will need to do this upon every login. If you wait until you loot, you will not need to do this.")
    				virgin_GL = virgin_GL + virgin_GL
    				if GL_firstDay < 29 then
    					print(os.date("%c"))
    					local file = io.open("FirstDayRunning.txt", "w")
    						file:write(os.date("%c"))
    					file:close()
    					GL_firstDay = GL_firstDay + GL_firstDay
    				end
    			else
    				print("GuildLoot : You know what to do.")
    				-- print(os.date("%c")
    			end
    
    	end
    	if event == "CHAT_MSG_MONEY" then
    			local _, guild = msg:match( "(.+)%((.+)%)" )
    	
    			local gold = guild:match(goldLoot) or 0
    			local silver = 	guild:match(silverLoot) or 0
    			local copper = guild:match(copperLoot) or 0
    		
    			if guildLoot_currentTotal == nil then
    				guildLoot_currentTotal = 0
    			else
    				guildLoot_currentTotal = guildLoot_currentTotal
    			end
    
    			guildLoot_currentTotal = guildLoot_currentTotal + (gold*1000) + (silver*100) + copper
    			local guildLoot_mainTotal = guildLoot_currentTotal
    			local guildLoot_yourGuild, _, _ = GetGuildInfo("player")
    			-- local guildLoot_guildAnnounce = guildLoot_currentTotal + (gold*1000) .. " gold " .. + (silver*100) .. " silver " .. + copper .. " copper"
    			gold_Announce = gold
    			silver_Announce = silver
    			copper_Announce = copper
    
    
    			print("You have deposited " .. GetCoinTextureString( guildLoot_mainTotal ) .. " in total to " .. guildLoot_yourGuild .. "'s bank." )
    
    			lootAmounts:SetText("You have looted " .. GetCoinTextureString( guildLoot_mainTotal ) .. " for " .. guildLoot_yourGuild .. "'s bank." )
    		
    			guildLoot_currentTotal = guildLoot_mainTotal
    		
    			guildLoot_currentTotal = guildLoot_currentTotal -- or 0
    
           			guildLoot_currentTotal.variable = guildLoot_currentTotal.variable + 1
    	end
    end
    
    guildLoot_Settings = {
    	MinimapPos = 0 -- default position of the minimap icon in degrees
    }
    
    function guildLoot_MinimapButton_Reposition()
    		guildLoot_MinimapButton:SetPoint("TOPLEFT","Minimap","TOPLEFT",52-(80*cos(guildLoot_Settings.MinimapPos)),(80*sin(guildLoot_Settings.MinimapPos))-52)
    end
    
    
    function guildLoot_MinimapButton_DraggingFrame_OnUpdate()
    		local xpos,ypos = GetCursorPosition()
    		local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom()
    	
    		xpos = xmin-xpos/UIParent:GetScale()+70
    		ypos = ypos/UIParent:GetScale()-ymin-70
    
    		guildLoot_Settings.MinimapPos = math.deg(math.atan2(ypos,xpos))
    		guildLoot_MinimapButton_Reposition() -- move the button
    end
    
    
    --function guildLoot_MinimapButton_OnClick(button, self)	
    --	if button == "LeftButton" then
    --		guildLoot:Show()
    --	else
    -- 		if IsAltKeyDown() and IsControlKeyDown() then
    --			guildLoot_mainTotal = guildLoot_currentTotal
    --			SendChatMessage( gold .. " gold " .. silver .. " silver " .. copper .. " copper " put in the bank from me looting.", PARTY )
    --		else
    --		if IsAltKeyDown() then
    --			ReloadUI()
    --		elseif IsShiftKeyDown() then 
    --			local guildLoot_gold = gold_Announce; local guildLoot_silver = silver_Announce; local guildLoot_copper = copper_Announce; local guildLoot_mainTotal = guildLoot_currentTotal; local yourGuild, _, _ = GetGuildInfo("player"); SendChatMessage( ( guildLoot_gold or 0 ) .. " gold " .. ( guildLoot_silver or 0 ) .. " silver " .. ( guildLoot_copper or 0 ) .. " copper put in " .. yourGuild .. "'s bank, from me looting.", GUILD )
    --		elseif guildLoot and guildLoot:IsShown() then
    --			guildLoot:Hide()
    --		else
    --			guildLoot:Show()
    --		end
    --	end
    --end
    
    function guildLoot_MinimapButton_OnClick(button, self)	
    	if button == "LeftButton" then
    		guildLoot:Show()
    	else
    		guildLoot:Hide()
    	end
    end
    
    function guildLoot_SendMoneyGuild_OnClick(button, self)
    	local guildLoot_gold = gold_Announce; local guildLoot_silver = silver_Announce; local guildLoot_copper = copper_Announce; local guildLoot_mainTotal = guildLoot_currentTotal; local yourGuild, _, _ = GetGuildInfo("player"); SendChatMessage( ( guildLoot_gold or 0 ) .. " gold " .. ( guildLoot_silver or 0 ) .. " silver " .. ( guildLoot_copper or 0 ) .. " copper put in " .. yourGuild .. "'s bank, from me looting.", GUILD )
    	self:SetText("Guild")
    end
    
    function guildLoot_SendMoneyParty_OnClick(button, self)
    	local guildLoot_gold = gold_Announce; local guildLoot_silver = silver_Announce; local guildLoot_copper = copper_Announce; local guildLoot_mainTotal = guildLoot_currentTotal; local yourGuild, _, _ = GetGuildInfo("player"); SendChatMessage( ( guildLoot_gold or 0 ) .. " gold " .. ( guildLoot_silver or 0 ) .. " silver " .. ( guildLoot_copper or 0 ) .. " copper put in " .. yourGuild .. "'s bank, from me looting.", PARTY )
    	self:SetText("Party")
    end
    
    function GL_infoFrameClose_OnClick(button, self)
    	GL_infoFrame:Close()
    end


    And my .toc:

    ## Interface: 40000
    ## Title: GuildLoot
    ## Author: wwwDot
    ## Version: 2.6.1
    ## Notes: Show's how much gold you have deposited in your guild bank from looting.
    ## SavedVariablesPerCharacter: guildLoot_currentTotal, gold_Announce, silver_Announce, copper_Announce
    GuildLoot.xml
    GuildLoot.lua
    


    Also, you may say inside my lua i have it writing to a txt file, i have it in the folder.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Where Do I Start?
    /reload does the same
    Posted in: Lua Code Discussion
  • 0

    posted a message on Help with frames
    Double post*
    Posted in: Lua Code Discussion
  • 0

    posted a message on Help with frames
    crtm:SetPoint("CENTER", myframe, "CENTER", 30, 0)


    Assuming you want myframe to be crtm's parent, are you sure that's in the right place?

    Also your telling the font to be:

    "GameFontNormal"


    Then:

    crtm:SetFont("Fonts\\FRIZQT__.TTF", 30)


    Just more contradicting.

    And

    critChance = format("%.2f", GetCritChance())


    Need's to be defined as a variable -- "local critChance = format("%.2f", GetCritChance())"
    Posted in: Lua Code Discussion
  • 0

    posted a message on Help with frames
    myframe:RegisterEvent("PLAYER_ENTERING_WORLD")
    myframe:SetScript("OnEvent", eventHandler)


    Are you sure this is correct, and it is registering the event correctly?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Help with frames
    function eventHandler_OnEvent(self)
    -- self:RegisterEvent("EVENT_NAME")
    end


    Would he need this for a full lua AddOn? (Not using xml) and this:

    function eventHandler(self, event, ...)
    if event == "EVENT_NAME" then
    local critChance = GetCritChance() 
    local critChance = format("%.2f", critChance)
    crtm:SetText(critChance)
    end
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Help with frames
    local function eventHandler(self, event, ...)
    local critChance = GetCritChance()
    local critChance = format("%.2f", critChance)
    crtm:SetText(critChance)
    end


    As i stated before, don't use local function, it's not needed.

    Also, i don't know about frame's in lua, but in xml you need to tell the frame to have a text, before you can set the text to something.

    So you would just set the text to "" and it would work great. You might need to do something like this in lua.

    Where are you telling it to register the event?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Help with frames
    Quote from Elsia
    The first option you posted is correct, this one is wrong. Functions are first-order types, you can just pass then as variables. The moment you add parenthesis, it is assumed to be a function call no longer an access to the variable. Check the lua reference manual to get a more detailed explanation on this.


    I'm going to have to do this sometime soon, i want to totally cut xml from my AddOn's, even though it's KINDA easy to use.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Help with frames
    local critChance
    function eventHandler(self, event, ...)
    critChance = GetCritChance()
    critChance = format("%.2f", critChance)
    end


    Define critChance in you local variable

    local critChance = GetCritChance()


    And you are just changing critChance with:

    critChance = GetCritChance()
    critChance = format("%.2f", critChance)


    (I think. I don't really know about the format function, but it might not)

    And this might be wrong:

    myframe:SetScript("OnEvent", eventHandler)
    myframe:Show()


    Maybe try this:

    myframe:SetScript("OnEvent", eventHandler(self, event)
    myframe:Show()
    end)


    But like i said, i basically know nothing about frame's with lua.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Help with frames
    Quote from myrroddin
    No, put local variableName at the top of the file. You want it local to your addon, but global to the whole addon.


    And was my example correct?
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.