Saturday, April 21, 2012

Need help extracting data from DamageMeters

Hi guys. So basically I'm venturing into the world of creating my first custom addon. I've been looking into using Ace2 as the library and basically the premise of the addon is that I want to utilize data from DamageMeters and create an addon that allows me to compare the damage from one weapon to another.

The way I want to go about it, is basically to fight 5 or 10 battles with a certain weapon. After each battle, I wanna save the current damage done and after 10 battles, I wanna average the damage from all the battles. This way, I figure I could get a base damage estimate of each weapon. However, the problem comes from extracting information from DamageMeters. I know it can write to a text file but I was having problems getting that to work.

Does anyone have any advice on how I could possible extract information from DamageMeters in order to use in my addon? Any help would be very much appreciated. Thanks|||(Moved to correct forum.)|||Any Ideas? I would really appreciate some input. Thanks|||I don't know ACE and I don't use Damage Meters. Why don't you just collect data from the combat log and make your own calculations?|||DamageMeters broadcasts data in some form over the addon communication channel so you could probably read what you want out of that. Though the easier method would be to check if DM has any easy get methods in it for the data which you can call. Otherwise hack some in yourself. Arguably easier method again (and probably better for the end user too) is just to parse the combat log yourself as Jumpy suggests.

Started with XML and kinda confused

Hi Guyz. i was trying to make a simple square of pixels in the screen, looking for different ways to dock it. But it seems my Xml files don't work at all. It visualize the square owever it always appear on the left side of the screen even if i told him to anchor on top enter or top right. What's is wrong with this ? Can you help or explain ?

Thank you much in advance.

Arngrim




Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">

<Script file="MyFrame.lua"/>

<Frame name="MyFrame" toplevel="true" frameStrata="BACKGROUND" movable="true" enableMouse="true" hidden="false" parent="UIParent">
<Size>
<AbsDimension x="350" y="100"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture file="Interface\TabardFrame\TabardFrameBackground">
<Size>
<AbsDimension x="350" y="100"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
MyFrame_OnLoad();
</OnLoad>
<OnEvent>
MyFrame_OnEvent();
</OnEvent>
</Scripts>
</Frame>
</Ui>
|||Moved as per the FAQ:
Quote:




Threads about finding, installing, using and troubleshooting mods go in the UI customisation Forum.

Threads about designing, coding and testing mods go in the UI Development Forum.

Threads about other topics should go in the relevant other forum.|||Quote:








Moved as per the FAQ:




Thank you for moving. Sorry to have posted in the wrong place. So anyone up on this ?|||You defined the frame to be moveable in your xml with


Code:
movable="true" enableMouse="true"

so why not complete your script and just move it to where you want it?


Code:
<Scripts>
<OnLoad>
this:RegisterForDrag("LeftButton")
this:SetAlpha(0.8);
</OnLoad>
<OnDragStart>
this:StartMoving();
this.isMoving = true;
</OnDragStart>
<OnDragStop>
this:StopMovingOrSizing();
this.isMoving = false;
</OnDragStop>
</Scripts>
|||Quote:








You defined the frame to be moveable in your xml with


Code:
movable="true" enableMouse="true"

so why not complete your script and just move it to where you want it?


Code:
<Scripts>
<OnLoad>
this:RegisterForDrag("LeftButton")
this:SetAlpha(0.8);
</OnLoad>
<OnDragStart>
this:StartMoving();
this.isMoving = true;
</OnDragStart>
<OnDragStop>
this:StopMovingOrSizing();
this.isMoving = false;
</OnDragStop>
</Scripts>






Basically because i want to let it pop exactly where i need or where i left it the last time the addon reloaded or frame popped. I could try to use the SetPOint() function, but I started brand new and i don't know how to set dynamic variables, and how anchor point are passed. I was wondering to do it later. It's possible that anyone don't know why i can't anchor a new frame exactly where i want ? I need just this information.|||Well here is one thing wrong


Code:
<Anchors>
<Anchor point="TOPLEFT">
</Anchors>

should be


Code:
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>

You left off the / after TOPLEFT

How do I create a button that can be dragged to the action bar ?

Hi,

I'm new to writing WOW AddOns.

I want to create a button that can be dragged to the action bar the same way items from the spell book or the inventory can be dragged and dropped into the action bar.

My question is: can this be done, and if so how ?

Thanks,

San|||You could create a macro that calls an addon. That macro icon could then be placed on the action bar.|||Thanks,

Yes I am aware of that option but that is not what I'm looking to do. For example I did that with SmartBuff, but the macro button does not get updated with the spell image the way the SmarfBuff button does.

I would also like to supply my AddOn with a popup that holds the various buttons so that they can be dragged to the action bars.|||I can't think of any mod that does this but you'd probably be best tryng to pillage someone else's code .|||Yeah I figured as such and run into the same issue myself (can't think of any). So my next thought was: "Find a forum of WOW AddOn authoring experts and ask them to point you in the right direction"...



Let's try a different approach: where will I find the most complete documentation for Blizz's framework objects / API ?|||http://www.wowwiki.com/Interface_Customization|||WowWiki has a decent API.

(EDIT: Jumpy beat me to it .)

Newbie Question: How to detect de-cloak events of monsters?

Hello,

This is my first attempt at an addon for WoW. I intend to develop a simple mod that provides a visual alternative (visual feedback) whenever the de-cloak sound is played ("Sound\\Spells\\Stealth.wav"). My reason: I know a number of players who miss the auditory cue due to a hearing impairment and therefore would appreciate a caption of some sort that communicates the stealth-sound visually.

I spend some time browsing tutorials and http://www.wowwiki.com/World_of_Warcraft_API but so far I haven't figured out how I can detect whether or not this sound file is triggered because of an enemy de-cloaking (like for instance Fen Creepers do - http://wow.allakhazam.com/db/mob.html?wmob=1040). Can anyone help me out?

Thank you!|||I don't think there is a way to detect sound events with the Blizzard API. If there is a message in the combat log about the mob becoming visible then you might be able to use that, but I don't know if there is.|||I just checked the combat log while walking around a Shadowmaw Panther (http://wow.allakhazam.com/db/mob.html?wmob=684) that was cloaking and de-cloaking, but there is nothing in the combat log unfortunately. I was thinking about maybe trying to use Unitfunctions (http://www.wowwiki.com/World_of_Warc...Unit_Functions) if that is possible. Does anyone know if this "cloaking"-behaviour (don't really what else to call it - "invisibility / stealth state"?) can be found using UnitBuff (http://www.wowwiki.com/API_UnitBuff) in some sort of way?

Thank you!|||You might able to do it in 2.3 when all target buffs will show up, but even then it'd still need to be your target/focus or a group member's target/focus (or some combination chain of targets from one of these units). And if it's stealthed then you generally can't target it so that won't really help.|||It may be possible to hook PlaySound(), have it check what sound is being played and do whatever you want if its the stealth sound.

I haven't tried hooking functions before, but this should give you the general idea:


Code:
local oldPlaySound;
function MyAddonLoad()
oldPlaySound = PlaySound;
PlaySound = MyAddonsNewPlaySound;
end
function MyAddonsNewPlaySound(sound)
if sound == "Sound\\Spells\\Stealth.wav" then
DEFAULT_CHAT_FRAME:AddMessage("Someone entered/left stealth!");
end
oldPlaySound(sound);
end

(Note this code is untested, may not work)

This assumes that blizz uses PlaySound() to play the stealth function, which I doubt they do.

Simple - How to identify the target??

Hi, I've searched the wowwiki and even screwed around but I can't seem to find the right variable. Here is some example code of what I'm trying to do:


Code:
if ("target" ==nil) then
WhatsTargetted = "Nothing";
elseif ("target" ~=nil) then
WhatsTargetted = "target"; -- This is what is always run, obviously
end;

if (WhatsTargetted ~="Nothing") then
SendChatMessage("I have you targetted", "WHISPER", this.language, WhatsTargetted);
else
DEFAULT_CHAT_FRAME:AddMessage("Nothing is targetted");
end;

I'm having trouble finding the variable that stores what the player is currently targetting. That same variable should be nil or "" if there is nothing targetted, right?

"target" obviously doesn't seem to be it..

Thanks so much in advance!|||Code:
UnitName("target")

Will return the name of the target (or nil for no target), if this is what you mean.|||Hi,

The solution towards finding out things about your current target is (mainly) the so called WoW unit functions. You can find an excellent summary here:

http://www.wowwiki.com/World_of_Warc...Unit_Functions

Each of these functions returns a specific piece of information about a unit. A unit is identified by a string and the string "target" relates to .... the current target. As mentioned int he privous reply the functions call "UnitName("target")" gives you the name of your current target, or nil if there is no target. As you can see there are some 30 to 40 other functions related to units that you might find useful.

Have a look here to find out what other units are supported by those functions:

http://www.wowwiki.com/UnitId

Skeeve|||Quote:









Code:
UnitName("target")

Will return the name of the target (or nil for no target), if this is what you mean.




This is exactly what I was looking for. Thank you!

Tooltips

Hi,

Could anyone give me a brief explanation of how they work? More specifically, what event tells the tooltip what to display? I can't find any explanation on wowwiki.

Cheers.|||Check out http://www.wowwiki.com/Widget_API#GameTooltip

Basically: You set the text of GameTooltip by GameTooltip:SetText("Title"), append with GameTooltip:AddLine("Some text"); and show it with GameTooltip:Show();|||Thanks Dinnerbone.

But what event triggers tooltips to show up in the game, say when you mouseover a mob or pet etc? And can that event be used in mods?

Cheers.|||In your xml, the OnEnter triggers it.


Code:
<Scripts> 
<OnEnter>
GameTooltip:SetText(text)
</OnEnter>
</Scripts>

http://www.wowwiki.com/API_GameTooltip_SetText

Or you have to hook some Blizzard function such as GameTooltip_ShowCompareItem(). I don't think there is any API event you can use.|||Ok thanks. So there's no way to detect specifically what mob or item in the world is under the mouse cursor? I found
Code:
GetMouseFocus()

but it just returns World frame no matter what the mouse is over.|||I don't know the answer. Maybe if you could describe what you are trying to do with your addon we can better understand what you need. Or maybe not. LOL|||I'm trying to make a basic hunter pet mod that displays extra pet info on the tooltip when you mouse over the pet. I have all the info sorted and can print it to chat or wherever, I just can't work out the tooltip bit. I can write to the tooltip, I just can't work out how to get it to show up specifically when the mouse is over the pet.|||If you look at the PetFrame in the FrameXML you will see


Code:
<OnEnter>
UnitFrame_OnEnter(self);
PartyMemberBuffTooltip:SetPoint("TOPLEFT", this, "TOPLEFT", 60, -35);
PartyMemberBuffTooltip_Update("pet");
</OnEnter>

You can look at the pet Lua and the pet xml here http://wdn.wowinterface.com/latest

You can see where or what function you might want to hook.|||Quote:








Check out http://www.wowwiki.com/Widget_API#GameTooltip

Basically: You set the text of GameTooltip by GameTooltip:SetText("Title"), append with GameTooltip:AddLine("Some text"); and show it with GameTooltip:Show();




Uhm, relatively random intermission here: would I be able to use some of this stuff to remove information from essentially all of my tooltips? Especially things like level and monster type? Maybe even names... though that'd leave awfully little tooltip, heh.

What kind of tooltip are we talking here? What kind of information is controlled by it? All "mouse-over" information? Just NPCs/PCs? What about items and such?|||Thanks guys,

I got it working using the event:


Code:
UPDATE_MOUSEOVER_UNIT

and
Code:
UnitName("mouseover") == UnitName("pet")

to see if my pet was under the cursor. Works nicely :)

English->Spanish Mod translation Offer!!!

Hi everybody, i'm a spanish guy who want to help the mod community, so as i don't own the needed skills to make a mod/addon, at least i can translate them to spanish language (you know, more languages=more potential users=more downloads :P ). If you are interested in my help, just send me a pm and i'll answer as soon as possible.

P.S.- I don't use any automatic-translation software or stuff like that :)|||Quote:








Hi everybody, i'm a spanish guy who want to help the mod community, so as i don't own the needed skills to make a mod/addon, at least i can translate them to spanish language (you know, more languages=more potential users=more downloads :P ). If you are interested in my help, just send me a pm and i'll answer as soon as possible.

P.S.- I don't use any automatic-translation software or stuff like that :)




Hey man, just a suggestion but, have you tried localizing the addons you have? Its actually a pretty decent way to get familiar with code...

They are all text files, you should be able to scan for the english text and write in the replacement text instead. Thats actually not good coding practice, and the code should be properly localized but that is a little more involved and this is something you could start right away. If you offer up your edits to the person who did the addon they might offer it as a seperate version.

And if not, at least you friends will have a spanish version to use.

delay in lua

Hi

I'm trying to write a mod to output multiple lines of text to the chat channel and was trying to find out a way of putting a delay (say 5 seconds) between each line|||Code:
function ActionButton_OnUpdate()
if (MyAddon_LastTime == nil) then
MyAddon_LastTime = GetTime()
else
if (GetTime() >= MyAddon_LastTime + 5) then

-- Do stuff here every 5 seconds --

MyAddon_LastTime = GetTime()
end
end
end

You have to drive this kind of code by hooking events or use an On_Update from a frame. I use the Blizzard bar function ActionButton_OnUpdate() which is driven MANY times a second.|||Be carefull with using OnUpdate() though... That code is processed multiple times per second, so it needs to be as light as possible.

Better to trigger off of events, but from what you're describing, yes, OnUpdate is your trigger...|||The problem with triggering from events is that you might not get one for more than 5 seconds, or whatever time measurement you want to use. The only way to have complete accuracy ,as far as timing goes, is to use an On_Update. If time accuracy is not important to what you are trying to do then yes, hooking events is the way to go.|||Thanks guys tried the OnUpdate() and it works nicely , will try the OnEvent handler later to see how they compare|||You may want to count passed time yourself using first argument for OnUpdate handler. I didn't check how heavy GetTime implementation is, but addition and getting two variables from local stack is sure to be faster than table lookup (function is in _G) and function call.

BTW, you can hide frame with OnUpdate handler when you no longer need to watch delay to stop receiving updates and nullify any performance penalty and bring it up again when you need it. In that case you wouldn't have to worry about microsavings much.|||A neater timeout function looks like this:


Code:
function fnBGW_OnUpdate(arg1) -- arg1 is in secs so may me small like 0.020s

glb_elapsedTime = glb_elapsedTime + arg1;

if(glb_elapsedTime >= TIME_TICKS) then
glb_elapsedTime = glb_elapsedTime - TIME_TICKS;
fnBGW_TimeOut();
end
end

The argument to OnUpdate is in secs so it may be small 0.020 (50Hz). Arg1 is time elapsed since last call to OnUpdate. This one saves a call to GetTime else it's the same|||I've been trying every timeout method I could find.

The ones posted here do not work in my application.

The GetTime() looked a little closer, but I only need a one time 5 second delay.

Here is was I need to wait 5 seconds before executing.


Code:
function LevelUp_OnEvent(event)
if ( (event == "PLAYER_LEVEL_UP") ) then
playerName = UnitName("player");
levlup = UnitLevel("player");
SendChatMessage("DING! "..playerName.." has reached level "..levelUp.." !", "GUILD", mylang, "");
end
end

This code is getting the level info too fast, and reporting the LAST level not the level gained.

I've used levelup = UnitLevel("player")+1;

as a temporary fix.

But I worry that if used on a slow comp, or lag comes into play it might report the level wrong (one level up).

Would like to just see this wait 5 seconds before execution, then the level info gathered should be the new correct level.|||Quote:








I've been trying every timeout method I could find.

The ones posted here do not work in my application.

The GetTime() looked a little closer, but I only need a one time 5 second delay.

Here is was I need to wait 5 seconds before executing.


Code:
function LevelUp_OnEvent(event)
if ( (event == "PLAYER_LEVEL_UP") ) then
playerName = UnitName("player");
levlup = UnitLevel("player");
SendChatMessage("DING! "..playerName.." has reached level "..levelUp.." !", "GUILD", mylang, "");
end
end

This code is getting the level info too fast, and reporting the LAST level not the level gained.

I've used levelup = UnitLevel("player")+1;

as a temporary fix.

But I worry that if used on a slow comp, or lag comes into play it might report the level wrong (one level up).

Would like to just see this wait 5 seconds before execution, then the level info gathered should be the new correct level.






When the PLAYER_LEVEL_UP event occurs, then the details you need are actually passed as arguments, and the NEW Player level can be found in arg1 so you shouldn't need any delaying mechanism if I have understood the thread (?)...


Code:
function LevelUp_OnEvent(event)
if ( (event == "PLAYER_LEVEL_UP") ) then
local playerName = UnitName("player");
local levlup = arg1;
SendChatMessage("DING! "..playerName.." has reached level "..levelUp.." !", "GUILD", mylang, "");
end
end

Other useful information is passed in the other default args, such as how much Stamina increase they earned that level...

Check out http://www.wowwiki.com/Events_P_(Par...rBank,_Player)

and scroll down to the PLAYER_LEVEL_UP event...

["icon"] = "Circle" help me

I have been messing around working on an add-on for some friends. I am a newb to programming language and am stuck here. for my quest givers and poi's i have been using ["icon"] = "Circle" what I would like is a clear ring similar to what gatherer uses when you mark a node so what would my icon be for that? Please help.

example:

["info"] = "If you are having trouble finding this guy, he wanders around on the top floor of the inn",

["titleCol"] = 13908198,

["icon"] = "Ring",

["title"] = "Innkeeper Thulfram",



The info section pops up on screen when you mouse over it on your mini map or reg map. My problem is using "Circle", or "Ring" creates a opaque symbol over the quest giver on the mini map and you cannot see the default gold dot. Like when you have gatherer and you can see an active node inside the clear circle.|||Download Gatherer and look in the Shaded folder. There you will find several .tga files that Gatherer uses to impose those circles over the minimap.

sqlhelper problem

hey im just instaled mod its looks cool but i get this eror on news page

Warning: mysql_connect(): Unknown MySQL server host 'dbserver' (1) in /home/content/a/t/i/atilla03/html/bp/itemstats/includes/sqlhelper.php on line 30

string(39) "Unable to connect to SQL host: dbserver"

pls help :|

Problems when highlighting text

I've been writing a mod to pull data out of wow onto notepad. To achieve this the mod puts all the data into an edit box from which you can cut and paste to wherever you want.

What I have at the moment is:

GetDataText:SetText(DataList);

GetDataText:SetFocus();

GetDataText:HighlightText();

GetDataDlg:Show();



The highlight seems to cause all the text to become selected because I can then Ctrl-C and then paste somewhere else and that all works fine. But the text is not shown as highlighted.

Even more weirdly if I run the app again the second time I show the EditBox the highlighting is shown. I've been put a ton of debug messages in and it seems to me that what I need to do is on my first pass through, after calling HighlightText() is get an OnCursorChanged event to be triggered for my edit box.

I've tried calling the function within the XML :

<OnCursorChanged>

ScrollingEdit_OnCursorChanged(arg1, arg2, arg3, arg4);

</OnCursorChanged>

and that does nothing. So my guess is that it's some default functionality which is part of all edit boxes.

Can I just send an event to my edit box? I cannot find any function that will do that for me.

Or does anyone know of another way round my problem.

I'll be grateful for any help people can offer|||Quote:








I've been writing a mod to pull data out of wow onto notepad. To achieve this the mod puts all the data into an edit box from which you can cut and paste to wherever you want.

What I have at the moment is:

GetDataText:SetText(DataList);

GetDataText:SetFocus();

GetDataText:HighlightText();

GetDataDlg:Show();



The highlight seems to cause all the text to become selected because I can then Ctrl-C and then paste somewhere else and that all works fine. But the text is not shown as highlighted.

Even more weirdly if I run the app again the second time I show the EditBox the highlighting is shown. I've been put a ton of debug messages in and it seems to me that what I need to do is on my first pass through, after calling HighlightText() is get an OnCursorChanged event to be triggered for my edit box.

I've tried calling the function within the XML :

<OnCursorChanged>

ScrollingEdit_OnCursorChanged(arg1, arg2, arg3, arg4);

</OnCursorChanged>

and that does nothing. So my guess is that it's some default functionality which is part of all edit boxes.

Can I just send an event to my edit box? I cannot find any function that will do that for me.

Or does anyone know of another way round my problem.

I'll be grateful for any help people can offer






Some random thoughts.... ;)

In other words, I'm not sure why your problem happens, but these are some things I'd be considering...

1.)

Have you tried the SetText and Highlight AFTER the :Show() ?

OR

You could try the SetText after the :Show(), and put the Highlight() in the EditBox's OnUpdate function.... ?

( This relates to the suggestion about the ScrollingEdit_OnUpdate function below... )

2.)

If your EditBox is part of a ScrollChild then I think you do need the XML you mentioned above, but you also need to call a default <OnTextChanged> function and OnUpdate function too ...although if you are only ever filling the edit box via code and the user isn't ever manually editing it then maybe its not important.


Code:


<OnTextChanged>
ScrollingEdit_OnTextChanged();
</OnTextChanged>
<OnCursorChanged>
ScrollingEdit_OnCursorChanged(arg1, arg2, arg3, arg4);
</OnCursorChanged>
<OnUpdate>
ScrollingEdit_OnUpdate();
</OnUpdate>

3.)

Have you set your EditBox to autofocus="true" ?

It might be worth a try....

4.)

Finally, its just a thought, but have you tried Hiding, and then Showing your EditBox again

to refresh it....based on your comment about the text being highlighted the next time you run it....although this is just me thinking about that autofocus feature again really...|||Thanks for all of those Telic. I've tried them all. No luck I'm afraid, but thanks for the suggestions.

I tried using ResetCursor() today that does send an OnCursorChanged event, but still no joy with the display so back to the drawing board. You may be right in that the ScrollChild could be responsible for updating the selected shading. So I'll try putting all my debug messages there, rather than the edit box, next time I get a chance to play :o)|||Prat displays URLs in a pop up box and the text is highlighted, you could check how it's done there.|||Can I see your entire frames xml?|||Quote:








Can I see your entire frames xml?




It still needs alot of work on the focusing and the like, but I'm hoping that isn't my problem. Anyway here it is:


Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">
<!-- Lua Scripts -->
<Script file="GetData.lua"/>

<!-- Frames -->
<Frame name="GetData_MainFrame">
<Scripts>
<OnLoad>
DEFAULT_CHAT_FRAME:AddMessage("Adding Slash XML",1,1,1);
GetData_OnLoad();
</OnLoad>
</Scripts>
</Frame>


<Frame name="GetDataDlg" toplevel="true" parent="UIparent" movable="false" resizable="false" enableMouse="true" hidden="true" enableKeyboard="true" frameStrata="DIALOG">
<Size>
<AbsDimension x="450" y="350"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<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="GetDataButtonClose" inherits="UIPanelButtonTemplate" text="Close">
<Size>
<AbsDimension x="75" y="20"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-20" y="20"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
GetDataDlg:Hide();
</OnClick>
</Scripts>
</Button>

<ScrollFrame name="GetDataScrollFrame" inherits="UIPanelScrollFrameTemplate">
<Size>
<AbsDimension x="390" y="255"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="18" y="-18"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="GetDataScrollBarTop" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="156"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="5"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.484375" top="0" bottom="1.0"/>
</Texture>
<Texture name="GetDataScrollBarBottom" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="106"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
</Texture>
<Texture name="GetDataScrollBarMiddle" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="60"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="GetDataScrollBarTop" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
<Anchor point="BOTTOM" relativeTo="GetDataScrollBarBottom" relativePoint="TOP">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.484375" top=".75" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnTextChanged>
ScrollingEdit_OnTextChanged(GetDataScrollFrame);
</OnTextChanged>
<OnCursorChanged>
ScrollingEdit_OnCursorChanged(arg1, arg2, arg3, arg4);
</OnCursorChanged>
<OnUpdate>
ScrollingEdit_OnUpdate(GetDataScrollFrame);
</OnUpdate>
</Scripts>
<ScrollChild>
<EditBox name="GetDataText" autofocus="true" multiLine="true" letters="12000">
<Size>
<AbsDimension x="541" y="234"/>
</Size>
<Scripts>
<OnTextChanged>
ScrollingEdit_OnTextChanged(GetDataScrollFrame);
</OnTextChanged>
<OnCursorChanged>
ScrollingEdit_OnCursorChanged(arg1, arg2, arg3, arg4);
</OnCursorChanged>
<OnUpdate>
ScrollingEdit_OnUpdate(GetDataScrollFrame);
</OnUpdate>
</Scripts>
<FontString inherits="ChatFontNormal"/>
</EditBox>
<Scripts>
<OnTextChanged>
ScrollingEdit_OnTextChanged(GetDataScrollFrame);
</OnTextChanged>
<OnCursorChanged>
ScrollingEdit_OnCursorChanged(arg1, arg2, arg3, arg4);
</OnCursorChanged>
<OnUpdate>
ScrollingEdit_OnUpdate(GetDataScrollFrame);
</OnUpdate>
</Scripts>
</ScrollChild>
</ScrollFrame>

</Frames>
</Frame>


</Ui>
|||Quote:








Prat displays URLs in a pop up box and the text is highlighted, you could check how it's done there.




hehe on first scan I thought you were insulting me ;o)

I downloaded Prat and gave it a try. Am I right in that the URL pops up in an separate box with just a single line of text. If so I'm not sure it helps. I stole some similar code from Deadly Boss Mods to base mine on. My problem seems to be the volume of text I'm trying to highlight. If I just populate a couple of lines in the edit box they get highlighted fine. But what I'm trying to do involves hundreds of lines of text, the start of which is beyond the top of the scroll box and has scrolled off. I'm wondering if I'm actually trying to get the UI to do something for which it was has never really been tested :o/

K|||Yeah it's just the URL on a single line as you say, ah well figured it was worth mentioning, hope you get it working :) .|||This 'probably' won't help with your problem but just to clarify my earlier point...

The "ScrollingEdit_On..." Scripts only need to be set for the EditBox. (i.e. within the EditBox tags)

Not for the ScrollFrame or the ScrollChild

I'm not sure what the consequences would be of trying to add those scripts to all 3 - it probably just generates FrameXML errors, and skips 'em when not needed...

Anyway, sorry the suggestions didn't help - don't forget to post the solution if you do find one ;)|||Quote:








This 'probably' won't help with your problem but just to clarify my earlier point...

The "ScrollingEdit_On..." Scripts only need to be set for the EditBox. (i.e. within the EditBox tags)

Anyway, sorry the suggestions didn't help - don't forget to post the solution if you do find one ;)




No worries. This wasn't my inention for the final XML, I just went mad (mainly with desparation) and dumped the handler stuff all over the place. Thanks for pointing out that it was still there, I'll take it out again

Thanks for all the help and don't worry if I ever solve the problem I'll let you know

Checking for combat

I was wondering if anyone has any idea on how to determine a) whether or not a player is in combat and if so b) if the unit they are attacking/being attacked by is an npc boss, like an in instance. I'm trying to create an auto-reply system for whispers but I can't get UnitAffectingCombat to work. Sorry if that was confusing, and thanks in advance.|||Quote:








I was wondering if anyone has any idea on how to determine a) whether or not a player is in combat and if so b) if the unit they are attacking/being attacked by is an npc boss, like an in instance. I'm trying to create an auto-reply system for whispers but I can't get UnitAffectingCombat to work. Sorry if that was confusing, and thanks in advance.




There has always been an option in AlphaMap to hide the map during combat, (and re-open it when combat is over).

It does this by monitoring for the "PLAYER_REGEN_DISABLED" and "PLAYER_REGEN_ENABLED" events, and has always seemed pretty reliable to me. I haven't tested what happens when a player has special buffs/abilities that allow some regeneration during combat, but I suspect they will still receive these events.



For determining target details you could try the following :

UnitClassification should report "worldboss", "rareelite", "elite", "rare",........

http://www.wowwiki.com/API_UnitClassification

and

UnitLevel should report -1 when unit is a special boss (whatever that means...)

http://www.wowwiki.com/API_UnitLevel



Other people may have better suggestions :)|||Quote:




UnitLevel should report -1 when unit is a special boss (whatever that means...)




If I remember correctly this means that the target is a "Skull" level monster so it should work for what you're trying to detect here.

For reference, the skull means it pretends to be three levels above you regardless of your level (in terms of hit/resist chances but its health/mana/damage/etc stay the same).|||Not sure if it will work in all situations but I'm currently using InCombatLockdown() to check for combat status.|||I can't remember the name of the mod right now, but there is an answering machine type addon that takes your messages when afk, but also auto-replies to tells during combat. The one I saw replied with the name of the boss you were fighting as well. Anyone remember the name of that mod?|||Thank you for the help, I've managed to detect whether the player is in combat with a boss in order to determine if an auto-reply is needed. I've been working on a few keyboard replacements (eg %HP for Boss Health Percent) but can't seem to get it work right.


Code:
autoreply=string.gsub(autoreply,"$B" , UnitName("target"));
autoreply=string.gsub(autoreply,"$P", UnitName("player"));
autoreply=string.gsub(autoreply,"$HP",((UnitHealth("target")/UnitHealthMax("target"))*100).." %");

Which returns the correct number as a percentage, and allows for other things to be added after it, but the % sign is always mysteriously missing, any ideas?

For example, if you type "$P is fighting $B, who has $HP health left. Try again later."

This is returned: "Dinarin is fighting Pygmy Venom Web Spider, who has 100 . health left. Try again later."|||Since it is a pattern do you need to code it this way, with an extra % sign? Pattern matching confuses me so I am just guessing since % is a "magic" character.


Code:
autoreply=string.gsub(autoreply,"$HP",((UnitHealth("target")/UnitHealthMax("target"))*100).." %%");
|||Yes, you need to escape it somehow, but I'm not certain on how you do that in Lua.|||Quote:








Since it is a pattern do you need to code it this way, with an extra % sign? Pattern matching confuses me so I am just guessing since % is a "magic" character.


Code:
autoreply=string.gsub(autoreply,"$HP",((UnitHealth("target")/UnitHealthMax("target"))*100).." %%");






That did it, thank you very much. Now I just have to make sure my conditions to test for raid/5-man bosses are correct lol.|||I think this is the problem... Some "magic characters" (such as %) have special uses in LUA. These are:

^ $ ( ) % . [ ] * + - ?

To use these in a pattern you have to precede them with a % symbol. So for example, "%%" would match a single %... lol, just saw that Jumpy beat me to this:)

Mod to Suppress Quest Progression Messages

I was wondering if it were at all possible for someone to create (if one is not already made that I am unaware of) a mod to block the Quest Progression Messages that come up. i.e. "Quest Crystals: 5/8" that come up. I am using nQuest Log and like how they're progression text comes up but cannot find a way to turn off the other one.

layers in .lua

Hi,

I have a little issue with my minimap and my UI frames which i have configured using Ten UI mod. Im using lua to make frames and attach frames to minimap, omen, SW damage meters etc. But when im moving my minimap over one of the frames the border is crossing over the minimap. I wonder if i can make a higher layer or priority of the minimap such that it gets over the borders.

Screenshot of the current:

large image of the UI



First time posting on these forums so be gentle :)|||Have fun messing about with frame:SetFrameLevel(level)

Example:


Code:
MyMinimap:SetFrameLevel(100)
|||Figured out the porblem. It was a nasty little addon called Bongos MapBar which caused all the trouble. :)

thank you for the response though

Healbot

Any chance someone might be working on updating the Healbot mod since the latest patch?

Customizable guildbank pricer (is there one? is it possable?)

I am looking for a mod that will make adjustments for item prices out of a guild bank

example

Greens = Vendor price + 5%

Blues = vendor price + 50%

Epics = Vendor price + 110%

then reports this price to the user somehow.

If there is a mod out there that already does this, please let me know.

If there is no mod out there, but it is possible, Please let me know.

Thank you in advance for all your help =)

Learning lua

Could some one help with learning lu? More specifically where to go to learn it. I've been looking around wowwwiki a lor.



Thanks for any help.|||http://www.lua.org/pil/

http://www.lua.org/manual/5.1/manual.html

Chat Throttling Question...

As I understand it, the new 2.3 chat throttling limits are something like 10 messages every ten seconds, correct? So you can send ten lines at once so long as you wait ten seconds before sending the next batch.

I have an addon that (is supposed to) report missing buffs in raid/party/whatever chat. One at a time is no problem, but trying to use the "report" function, which sends out five lines in one fell swoop, doesn't always work. Reporting to a custom channel works fine, but it gets throttled in raid or party chat.

Am I wrong about the throttling mechanics?|||My understanding is the same as yours regarding the 10/10 sec rule but I thought raid/party chat was exempted. But I haven't tested any of that.|||I thought that too, Jumpy, but then my first line prints and nothing else:(|||Iriel posted this in the Blizz UI and mods forum.


Quote:




* Each chat channel is limited separately, at a rate of 10 messages in 10 seconds. This means that you can send one message every second without ever seeing delays, or a burst of 10 messages every 10 seconds without seeing delays. Messages that exceed this rate are not dropped, but simply delayed in order until they can be sent. (This does not affect SendAddonMessage() or party/raid/guild chat. )




But I did not see anything about this in the patch notes. So either it was not properly implemented, or what he said was incorrect, or something is wrong with your code(?).|||It is always possible something is wrong with my code:) but it worked fine pre-2.3, so that's not my first thought. Also, it works fine in self and custom channels. I'll check through it again, but I'm wondering if chat throttling is not completely fixed yet...|||Maybe you should post the question on the Blizzard UI forums.|||Thanks Jumpy, but I did post there with no luck.

Rarefinder

Is anyone working on the mod update for RareFinder by chance? I LOVED that mod but it isnt working and hasn't been for several patches.|||Quote:








Is anyone working on the mod update for RareFinder by chance? I LOVED that mod but it isnt working and hasn't been for several patches.




Well..... it's strange, this addon. Mine is out of date and says so, but when I check 'enable out of date addons' or something like that on the addon screen, it now works fine for me. I don't understand why.....|||when it says Out of Date on the addons screen it just means that the toc version dosnt match that of the actual game, some mods have been out dated since version 1.2 but still work.

Mh to Oh

I would like to know, how to put a dagger in mainhand when i stealth, and when i breakstealth use the sword on mainhand.

ty|||Presuming that you're dual-wielding and want to switch weapons between hands, you could use this macro:

/script PickupInventoryItem(16); PickupInventoryItem(17);

/cast Stealth

The first line switches weapons between your hands (presuming that you're not using a main-hand-only weapon in your main hand!). The second should put you in stealth if you're not in it, and take you out if you are.

Note that the first line will always go, even if you can't go into stealth -- so you could wind up switching weapons, then not going into stealth because you can't right then.|||thanks for reply, although i found an awsome add-on called. ShadowDancer 2