Thread Tools Display Modes
05-03-08, 03:08 PM   #1
abinning
A Kobold Labourer
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 1
Question EPGPHelper, need help making this mod...

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>

Last edited by abinning : 05-03-08 at 03:23 PM.
  Reply With Quote
05-04-08, 08:21 AM   #2
Dreadlorde
A Pyroguard Emberseer
 
Dreadlorde's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 2,302
Here's some example code

1a.(code from Hacking World of Warcraft)
Code:
function Whereabouts_OnEvent(self, event, ...)
    if ( event =="VARIABLES_LOADED" ) then
        Whereabouts_InitDisplay();
    elseif ( event == "ZONE_CHANGED_NEW_AREA" ) then
        SetMapToCurrentZone();
    end
end
Code:
function Whereabouts_OnLoad(self)
SLASH_WHEREABOUTS1 = "/whereabouts";
SLASH_WHEREABOUTS2 = "/wa";
SlashCmdList["WHEREABOUTS"] = Whereabouts_SlashCommand;
self:RegisterEvent("VARIABLES_LOADED");
end
Code:
function Whereabouts_Toggle()
    if ( Whereabouts_Frame:IsShown() ) then
        Whereabouts_Frame:Hide();
        Whereabouts_Options.show = false;
    else
        Whereabouts_Frame:Show();
        Whereabouts_Options.show = true;
    end
end
Code:
function Whereabouts_Options_Toggle()
    if ( Whereabouts_Options_Frame:IsShown() ) then
        Whereabouts_Options_Frame:Hide();
    else
        Whereabouts_Options_Frame:Show();
    end
end
And istead of having a X to close the frame, you could maybe try having it close with the Esc key. A how-to is at wowwiki
Hope that helps you a little.
__________________

Funtoo - Plan 9 - Windows 7
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » EPGPHelper, need help making this mod...

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off