Hey guys
Alright, so I don't really know where else to post this, so I hope this section is suitable for the question. Otherwise, could a moderator move it? x)
Well, what I want to ask is, how can I update the label on my XML frame, when something happens in my Lua script? Currently, I got it to work with only saying +1 to the variable 'Count' every time a spell is successfully casted, but I can't seem to make it actually appear on the label xP Like, update the label when the event "UNIT_SPELLCAST_SUCCEEDED" happens. So... Anyone got an idea? This is how the frame looks so far:

But the '0' in it, just stays 0 since I have no idea how to go about updating it, and before you say 'Try google', I have tried. But there is just SO little documentation on how to do it, and those few things there is, haven't really helped me out :s
So please, MMOwned, halp! D:
Thanks
Newtech
@Edit:
Lua:
Code:
local Count = 0
function events:UNIT_SPELLCAST_SUCCEEDED(...)
Count = Count + 1
print(Count);
-- Its here, I assume it would be something like "label:SetText(Count)" or something :s
end
-- I got the code below from a tutorial somewhere xP
local frame, events = CreateFrame("Frame"), {};
function events:PLAYER_ENTERING_WORLD(...)
-- handle PLAYER_ENTERING_WORLD here
end
function events:PLAYER_LEAVING_WORLD(...)
-- handle PLAYER_LEAVING_WORLD here
end
frame:SetScript("OnEvent", function(self, event, ...)
events[event](self, ...);
end);
for k, v in pairs(events) do
frame:RegisterEvent(k);
end
XML:
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--Autogenerated by wowuides, Version=1.0.300.0, Culture=neutral, PublicKeyToken=null-->
<Frame name="SpellCounterForm" movable="true" enableMouse="true">
<!--<FrameSkin skinid="8309da78-006d-4401-9d4f-cbc448d08261" frameid="047a5294-fa59-460b-83cb-0c19711baeb7" />-->
<Size>
<AbsDimension x="152" y="170" />
</Size>
<Anchors>
<Anchor point="CENTER" relativeTo="UIParent">
<Offset>
<AbsDimension x="0" y="0" />
</Offset>
</Anchor>
</Anchors>
<TitleRegion setAllPoints="true" />
<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>
<Frames>
<Button name="$parentButton1" text="Party">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="63" y="28" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="16" y="-125" />
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Panel-Button-Down">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</PushedTexture>
<DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</DisabledTexture>
<HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</HighlightTexture>
<ButtonText name="$parentText">
<FontHeight>
<AbsValue val="10" />
</FontHeight>
</ButtonText>
<NormalFont style="GameFontNormal" />
<HighlightFont style="GameFontHighlight" />
<DisabledFont style="GameFontDisable" />
</Button>
<Frame name="SpellCounter_Number">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="121" y="35" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="16" y="-84" />
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer>
<FontString name="$parentLabel" font="Fonts\FRIZQT__.TTF" text="0">
<Anchors>
<Anchor point="TOPLEFT" />
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<FontHeight>
<AbsValue val="16" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEvent>
if event == "UNIT_SPELLCAST_SUCCEEDED" then
count = count + 1
print(count);
end
</OnEvent>
<OnLoad>local count = 0</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentLabel2">
<!--<FrameSkin skinid="f15d4970-d66d-444e-bb2d-1ad102c87fed" frameid="f15d4978-d66d-444e-bb2d-1ad102c87fed" />-->
<Size>
<AbsDimension x="112" y="26" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="20" y="-52" />
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer>
<FontString name="$parentLabel" setAllPoints="true" font="Fonts\FRIZQT__.TTF" text="Spells casted:">
<FontHeight>
<AbsValue val="12" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</FontString>
</Layer>
</Layers>
</Frame>
<Frame name="$parentLabel1">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508885-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="121" y="28" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="16" y="-18" />
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer>
<FontString name="$parentLabel" font="Fonts\FRIZQT__.TTF" text="Spell Counter">
<Anchors>
<Anchor point="TOPLEFT" />
<Anchor point="BOTTOMRIGHT" />
</Anchors>
<FontHeight>
<AbsValue val="16" />
</FontHeight>
<Color r="1" g="0.8196079" b="0" />
<Shadow>
<Color r="0" g="0" b="0" />
<Offset>
<AbsDimension x="1" y="-1" />
</Offset>
</Shadow>
</FontString>
</Layer>
</Layers>
</Frame>
<Button name="$parentComponent1" text="Reset">
<!--<FrameSkin skinid="dcb143e1-a4ab-4e7c-b934-1efa40101d21" frameid="2d508884-59c2-4f83-ae10-27aaad48391b" />-->
<Size>
<AbsDimension x="52" y="28" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="85" y="-125" />
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\Buttons\UI-Panel-Button-Up">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</NormalTexture>
<PushedTexture file="Interface\Buttons\UI-Panel-Button-Down">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</PushedTexture>
<DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</DisabledTexture>
<HighlightTexture file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</HighlightTexture>
<ButtonText name="$parentText">
<FontHeight>
<AbsValue val="10" />
</FontHeight>
</ButtonText>
<NormalFont style="GameFontNormal" />
<HighlightFont style="GameFontHighlight" />
<DisabledFont style="GameFontDisable" />
</Button>
</Frames>
</Frame>
</Ui>
Yes, I made the XML with Wow UI Designer xP