At line 130, I will call a function Addon:UnknownToKnown() that will scan tooltips to get the names of released, ghost characters, and properly add that info to targetName. I looked at the original SmartRes code, but it seems needlessly complex, not commented should someone take over SR2 from me, is just a headache.
At least I think I should be scanning tooltips. Suggestions, howtos?
Also, line 202 begins the dead list function for ressing using the autokey (not coded yet) but I want players ressed in a specific order, and not willy-nilly like SR1 does. Specifically:
All dead Priests
All dead Paladins
All dead Shamans or Druids
Any order of other Mana using classes
Any order of the rest of the classes
Yeah, so I am trying to make SmartRes2 smarter than the original. Unfortunately, I am not as smart as even that.
One last question, about localizing. My slash commands I want localized, as not everybody has an English language compatible keyboard. In the Ace3 info I have found, it suggests my 4 /xx commands be written as you see them, and in the localization file, have
local L = LibStub("AceLocale-3.0"):NewLocale("SmartRes2", "enUS", true)
if L then
-- chat commands
L["sr"] = true
L["sr2"] = true
L["smartres"] = true
L["smartres2"] = true
end
Wow, I hope I got that correct. Oh, and I am not looking for bug-squashing yet, as you can see, there is a great deal of missing code. I can see the light at the end of the tunnel, however, and so are looking for some help now.
function Addon:getReleseList()
local relesedList = {}
for i=1, GetNumRaidMembers() do
if UnitIsGhost("raid"..i) then
local name = UnitName("raid"..i)
tinsert(releseList, name)
end
end
return relesedList
end
I thought of that, and did have almost the exact code, but then I realized a possible problem: since we are talking about ghosts, then how would that code know that the corpse you are clicking on is actually that player? Furthermore, say two healers click on two different corpses, again, how would it know? The idea is for the player with SmartRes2 to know all ressing targets, regardless of dead or ghost status, and regardless of whom is casting the res spell, and regardless whether or not other players have SR2.
As I said, the original SmartRes could make that distinction, but the related code is... beyond confusing. Not to mention buggy at this point.
If it helps, SR2 has two res keys. Press the autokey, and it will res a non-ghost player who has not been ressed already, and the manualkey gives you the hand cursor to target a corpse. In both cases, using either LibBars-1.0 or LibCandyBar-3.0 (I haven't decided which one to use) it puts bars on the screen that say "resser is ressing targetName" with optional chat output of same.
Released ghosts would say "resser is ressing unknown" which is precisely what I don't want.
if not targetName or targetName == "unknown" or targetName == "" then
You don't need to do this. ResComm_ResStart will never return unknown as targetName. It will have done the tooltip scanning for you.
The whole point of LibResComm is the tooltip scanning. It's the reason that we need a communication library to do do resurrection communication.
If a resser is not using CTRA, oRA2 or an addon embedding LibResComm there is NO possible way of knowing who he is ressing if it is a released target.
You sir, are a genius, and I thank you. I wasn't at all certain if LRC did or did not return unknowns, but now knowing that it does, makes me feel even more indebted to you.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
http://pastey.net/114425
At line 130, I will call a function Addon:UnknownToKnown() that will scan tooltips to get the names of released, ghost characters, and properly add that info to targetName. I looked at the original SmartRes code, but it seems needlessly complex, not commented should someone take over SR2 from me, is just a headache.
At least I think I should be scanning tooltips. Suggestions, howtos?
Also, line 202 begins the dead list function for ressing using the autokey (not coded yet) but I want players ressed in a specific order, and not willy-nilly like SR1 does. Specifically:
One last question, about localizing. My slash commands I want localized, as not everybody has an English language compatible keyboard. In the Ace3 info I have found, it suggests my 4 /xx commands be written as you see them, and in the localization file, have
Wow, I hope I got that correct. Oh, and I am not looking for bug-squashing yet, as you can see, there is a great deal of missing code. I can see the light at the end of the tunnel, however, and so are looking for some help now.
Thank you.
You should be able to use:
UnitIsGhost("unit")
and then cycle through the raid members like:
Haven't tested this... But seems likely
As I said, the original SmartRes could make that distinction, but the related code is... beyond confusing. Not to mention buggy at this point.
If it helps, SR2 has two res keys. Press the autokey, and it will res a non-ghost player who has not been ressed already, and the manualkey gives you the hand cursor to target a corpse. In both cases, using either LibBars-1.0 or LibCandyBar-3.0 (I haven't decided which one to use) it puts bars on the screen that say "resser is ressing targetName" with optional chat output of same.
Released ghosts would say "resser is ressing unknown" which is precisely what I don't want.
Thank you for the suggestion, however. :-D
You don't need to do this. ResComm_ResStart will never return unknown as targetName. It will have done the tooltip scanning for you.
The whole point of LibResComm is the tooltip scanning. It's the reason that we need a communication library to do do resurrection communication.
If a resser is not using CTRA, oRA2 or an addon embedding LibResComm there is NO possible way of knowing who he is ressing if it is a released target.
You sir, are a genius, and I thank you. I wasn't at all certain if LRC did or did not return unknowns, but now knowing that it does, makes me feel even more indebted to you.