• 0

    posted a message on .lua working with numbers
    It is pretty and everything now with

    if currentTotal == nil then
    			currentTotal = 0
    		end
    		if currentTotal ~= nil then
    			currentTotal = currentTotal
    		end


    But it is not overwriting, only printing the just looted amount.
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    Ok, i will check that out.

    Also, i just got an error with the 2 lines of code.

    1x GuildLoot-0.1\GuildLoot.lua:18: attempt to perform arithmetic on global 'currentTotal' (a nil value)
    <string>:"*:OnEvent":1: in function <[string "*:OnEvent"]:1>

    Locals:
    self = guildLoot {
    0 = <userdata>
    }
    event = "CHAT_MSG_MONEY"

    ---


    I don't see anything wrong with the arithmetic, but maybe it's because i have currentTotal set to be a savedvariable, and since there currently is nothing saved, the addition is bad?

    So maybe:

    if currentTotal == nil then
       currentTotal = 0
    end


    before the addition is fired?
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    WOOW. Thank you both, so effin much lol.

    I have to reload wow before i can test because of lag spikes.

    But i also had a few more question's..

    For some reason my icon doesn't show for my minimap button, it's just a clear button, and i also can't get it to stay in the spot the user move's it to. It always goes back to the top left of the minimap.
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    I'm very confused with the addition with .lua.

    Here is the section of the .lua that i am trying to get to do the addition and send it to my AddOn frame.

    function guildLoot_OnEvent(self, event, msg)
    	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
    
    		local lootAmount = 0
    		local first = 0 + lootAmount
    		local firstTotal = first + newLoot + lootAmount
    		local newLoot = (gold*1000) + (silver*100) + copper + lootAmount
    		local lastTotal = lootAmounts
    		local currentTotal = newLoot + lootAmounts
    		
    		if lootAmount == 0 then
    			lootAmounts:AddMessage( GetCoinTextureString( firstTotal ) )
    		else
    			lootAmounts:AddMessage( GetCoinTextureString( currentTotal ) )
    		end
    	end
    end


    And i know i'm most likely doing this part wrong, but i have set to print/send the info in to the AddOn through and into a frontstring:

    <Layer level="OVERLAY">
    			<FontString name="lootAmounts" font="Interface\Addons\GuildLoot\Fonts\COPRGTB.TTF" text="You have looted " .. 
    
    firstTotal .. " for your guild bank." outline="NORMAL">


    I'm sorry about all these noobish question's I've asked a lot, and i am truly grateful for any and all help i receive.
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    What i am trying to do, is when the AddOn receive's a number it need's, print it to my addon, and keep it saved, until it receive's another number to keep track of. What i want it to do, is add those number's together (last number and just received number) and re-print the new number to the addon. I am not that used to .lua yet, so i don't exactly know how to do this.

    I have the AddOn receiving the number's, i just cant figure out how to get it to save it, and wait, and re-print to the AddOn.

    With javascript, i probably would have made the AddOn print the number to a .txt file for an easy storage, print the new number under the last number, have the AddOn read both lines, and add them together, print the sum to the AddOn, and upon closing, clear the .txt file, and write the newest number (the sum) back to the .txt file.

    That seem's like it's a little much, but it actually wouldn't be to hard.
    Posted in: Lua Code Discussion
  • 0

    posted a message on NewFrame with minimap button
    I used a kind of outdated guide to create the minimap button, could it be because of this:

    guildLoot_MinimapButton:SetPoint("TOPLEFT","Minimap","TOPLEFT",52-(80*cos(guildLoot_Settings.MinimapPos)),(80*sin(guildLoot_Settings.MinimapPos))-52)
    Posted in: Lua Code Discussion
  • 0

    posted a message on NewFrame with minimap button
    Ok, disregard that lol. The problem was when i reloaded the UI, it went back to the original positioning, and i already had an AddOn button there.

    My new question now is, how do i get the new positioning to save, for when logging out and back in?
    Posted in: Lua Code Discussion
  • 0

    posted a message on NewFrame with minimap button
    I created my minimap button and after alot of de-bugging, i got it to show on the map and be movable.

    But once i add a frame to my .xml and set the minimap button as the parent, the minimap button disappear's.

    Is there an special snippet that needs to be added for the button to show while it has a childframe?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Guild Deposit Loot String?
    Ok, thank you.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Guild Deposit Loot String?
    Would they be considered event's? or would you need it to check the chat box when you loot or something like that?
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    Ok, i guess not. Can anyone that uses .xml tell me why these won't work?

    MainHand.xml
    SecondHand.xml
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    Would turning off word wrap in notepad cause .xml to not work?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Arathi Basin -- DBM
    CHAT_MSG_RAID_BOSS_EMOTE

    Needed to be added to the RegisterEvent calls for the check_for_updates function to trigger, at the beginning of the Arathi.lua

    That's the right call for the cap timer's to work.
    Posted in: AddOn HELP!
  • 0

    posted a message on Arathi Basin -- DBM
    The mod, Arta said "I think this fixed it ... try r4806" But where the hell do you download this version? They don't have the version's added to there AddOn's, so i have no idea what version mine is.
    Posted in: AddOn HELP!
  • 0

    posted a message on Arathi Basin -- DBM
    If they did update it, from the version i have, they didn't update much, i went through, comparing file's, and out of all the one's i checked, they were the same as the one's i've had since early October.
    Posted in: AddOn HELP!
  • To post a comment, please or register a new account.