It is possible that once the unit becomes visible for you (but is still stealthed) the unit frame appears. In which case the code very likely will work.
I don't know though, I do not PVP. You will need to test to find out.
Try this code out, it won't do anything functional but it will give you an idea. It will spam your chat if you can query an arena unit of a player with a stealth buff. Put it at the top of your rotation, it won't stop the rest from working.
Name: Unit Check
Spell ID: 0
Code:
Code:
for i=1,5 do
if UnitExists("arena"..i) then
local taretStealth = UnitBuffID("arena"..i, 1784)
local taretProwl = UnitBuffID("arena"..i, 5215)
if targetStealth or targetProwl then
PQR_WriteToChat("Detected an arena unit that is stealthed!")
end
end
end
It is possible you can still query the unit for a split second when the player uses stealth but the client hasn't unregistered the unit, so you might get some false alarms. Be sure it is going off when a player is near you, you can see them, but they are stealthed. It would be interesting to know, profiles could for example detect a stealthed but visible enemy and (non-targetted) AOE them out before they get a chance to sap.