1. Frame
a. Opens/closes with slash command
b. closes with a button (X)
c. opens automatically on the keyword
c. movable, resize able
2. Check raid chat
a. Frame:RegisterEvent("CHAT_MSG_RAID"); or whatever
b. checks for the word "me" then does some work
c. save the users name ( the on that said me) and guild rank
3. Work =P Parsing officer note for numbers and does a division
a. oNote is in the format x|x|x|x x=integers ie. 0|36700|0|450
b. get priority, divide #2 by #4 ie. 36700/450=priority
c. print users Name Priority and Rank in to the Frame perhaps...
msgFrame:AddMessage(name.." "..rank..": ".priority);
I have done some work but I am having some problems. I don't have the code I was working on with me, but I have this much....
Code:
Frame.lua
-- A-- Author : abinning
-- Create Date : 4/30/2008 9:03:34 AM
function Frame1_OnLoad()
this:RegisterEvent("CHAT_MSG_SAY"); --for testing outside of raid
--this:RegisterEvent("CHAT_MSG_RIAID");
end
function Frame1_OnEvent(text,author)
if (event == "CHAT_MSG_SAY") then
if (text == "me" )then
for i=1, GetNumGuildMembers(true) do
name, rank, rank_index, level, class, zone, note, officer_note, online, status = GetGuildRosterInfo(i);
if( name == author )
priority = epgpPriority(officer_note);
end
pMsg:AddMessge(name.." "..rank..": "..priority);
end
end
end
function epgpPriority(onote)
--get onote and parse out 0|EP|0|GP
--prio = ep/gp
return prio;
end
function Button1_OnClick()
Frame1:Hide();
end
function Button2_OnClick()
MessageFrame1:Clear();
end
=======================================
Frame.xml
<Ui>
<Script file="Frame.lua"/>
<Frame name="Frame1" parent="UIParent" toplevel="true" movable="true" enableMouse="true">
<Size>
<AbsDimension x="200" y="200"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="146" y="-126"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnMouseDown>self:StartMoving();</OnMouseDown>
<OnMouseUp>self:StopMovingOrSizing();</OnMouseUp>
<OnLoad>Frame1_OnLoad();</OnLoad>
<OnEvent>Frame1_OnEvent();</OnEvent>
</Scripts>
<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>
<MessageFrame name="MessageFrame1" fade="false" displayDuration="10000">
<Size x="170" y="170"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="15" y="-15"/>
</Anchor>
</Anchors>
<Frames>
<Button name="Button2" inherits="UIPanelButtonTemplate" text="Clear">
<Size x="44" y="20"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="104" y="-3"/>
</Anchor>
</Anchors>
</Button>
<Button name="Button1" inherits="UIPanelButtonTemplate" text="X">
<Size x="22" y="20"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="145" y="-4"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick>Button1_OnClick();</OnClick>
</Scripts>
<HighlightColor r="1" g="1" b="1"/>
<NormalColor r="1" g="1" b="1"/>
</Button>
<ScrollingMessageFrame name="pMsg" fade="false" maxLines="25">
<Size x="167" y="138"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="3" y="-29"/>
</Anchor>
</Anchors>
</ScrollingMessageFrame>
</Frames>
</MessageFrame>
</Frames>
</Frame>
</Ui>