Thread Tools Display Modes
03-22-12, 04:05 AM   #1
Clarkey
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Apr 2011
Posts: 8
TinyDPS - Report via macro

Hello..

I'd like to report the top 5 overall damage and top 2 overall healing at the end of a dungeon with a click of a button.

Is this possible?

Regards,
Matt
  Reply With Quote
03-22-12, 11:44 AM   #2
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 124
Very much so, I'd have thought. But you could use a keybind function too.

There's a keybinding function that you could use that simulates a button press. Could you not just use that on the tinydps report button and then bind the key to an action bar? That way you could click the button with the mouse, or use the defined keybind.

This shows how:

http://wowprogramming.com/docs/api/SetBindingClick

I don't know anything about that particular addon though, so I don't have a clue about it reporting different data at the same time ie dps and healing.
__________________
__________________
  Reply With Quote
03-22-12, 12:57 PM   #3
Waky
A Cobalt Mageweaver
 
Waky's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 200
Well, most of the functions in TinyDPS' code are local, so it wouldn't be the easiest thing to accomplish. I would ask Talyrius to add /tdps report <channel> and /tdps <overall/current> to the slash commands.

I'll try to come up with a macro using the current state of TDPS as is, but if that doesn't work I'll let you know.

Edit:
From what I've tried, it's currently not possible to report anything other than just whispers via slash commands or scripts. The problem is, as I stated before, most functions (including the report function) are local meaning they cannot be access by anything other than the TinyDPS.lua file.

The only manner that I can find that allows the user to run the functions is by right clicking the TDPS frame and navigating through the drop down menus. The problem with this is, external scripts are unable to access any sub-menus which is where all of the functions are located.

If you're still interested in implementing this, it could be edited into the code, or you could ask Talyrius to add it.

Sadly from what I've seen as is, it's not possible. Sorry.

Last edited by Waky : 03-22-12 at 01:27 PM.
  Reply With Quote
03-22-12, 03:19 PM   #4
Clarkey
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Apr 2011
Posts: 8
Thanks for your efforts on this buddy, I will get in contact and hope he reads it!
  Reply With Quote
03-22-12, 03:57 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
External scripts can absolutely access the dropdown menu entries; however, I don't have time to write such a script right now.

Probably the simplest solution for now is simply to modify TinyDPS to allow the report function to be called externally.

Open TinyDPS.lua and find line 2388:
Code:
	local function deleteSpellData()
Before it, on one of the blank lines, add:
Code:
	TinyDPS_Report = report
This will allow you to access the report function globally, such as in a macro:
Code:
/run TinyDPS_Report(nil, "RAID")
Code:
/run TinyDPS_Report(nil, "WHISPER", "Clarkey")
Looking at the TinyDPS download page, you could (probably) set up your desired reports and show them using the addon's slash commands, eg:
Code:
/tinydps damage
/tinydps reportlength 5
/run TinyDPS_Report(nil, "PARTY")
/tinydps healing
/tinydps reportlength 2
/run TinyDPS_Report(nil, "PARTY")
  Reply With Quote
03-22-12, 04:23 PM   #6
Waky
A Cobalt Mageweaver
 
Waky's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 200
I considered doing something like that, Phanx, but the only problem left is there's no way of telling if the data is [overall] or [current fight]. You'd need to globalize the function responsible for changing it.

I haven't been able to find it yet, lol.
  Reply With Quote
03-22-12, 11:14 PM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Reading this addon's code gives me the feeling that it was built ass-backwards, starting with a GUI and then tacking on functionality. It cannot be very much fun to maintain, especially considering its near-total lack of descriptive variable names.

Anyway, the easiest thing would be to ignore my last post, and just add these lines to the very end of TinyDPS.lua:

Code:
function TinyDPS_Report(fight, view, max, channel, target)
	local _fight, _view, _max = tdpsF, tdpsV, tdpsReportLength

	if type(fight) ~= "number" then
		if fight == "all" or fight == "overall" or fight == "global" then
			fight = 1
		else
			fight = 2
		end
	end

	changeFight(nil, fight) -- 1 = overall, 2 = current
	changeView(nil, view:sub(1, 1)) -- d = damage, h = healing
	tdpsReportLength = max

	report(nil, channel, target)

	changeFight(nil, _fight)
	changeView(nil, _view)
	tdpsReportLength = _max
end
Then, to report the top 5 damage dealers from the current/last fight to party chat, use this macro:

Code:
/run TinyDPS_Report("current", "damage", 5, "PARTY")
To report the top 2 healers from all fights (since the last reset) in a whisper:

Code:
/run TinyDPS_Report("all", "healing", 2, "WHISPER", "Phanx")
Let me know if there are any errors; I cannot log in and test anything right now.
  Reply With Quote
03-25-12, 05:54 AM   #8
Clarkey
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Apr 2011
Posts: 8
Phanx, your a star! This works absolutely perfectly!
(see what I did there with your name, aha).

woo
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » TinyDPS - Report via macro


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