View Single Post
02/11/23, 02:35 PM   #12
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 247
Originally Posted by Baertram View Post
You always should read the API documentation txt file for the parameters and parameter TYPES used! unitTags are not the same as character names or displaynames!

Afaik IsUnitInCombat(unitTag) only accepts unittags like "player" (yourself), "group1" to "groupN", "boss1" to "bossN" or "reticleover" and not any charactername or displayname!
So you cannot test IsUnitInCombat for any name on the server, only for yourself or grouped players.
There exist API group functions to check what name the group1, group2 etc. tags have but I'm not sure anymore, you need to search the API documentation txt file for them

I think it was a loop over group members by
Code:
for i=1, GetGroupSize() do
  local unitTag = GetGroupUnitTag(i)
end
or something similar.
Ive been working with this gem but cant get it working.. i know im close but cant seem to put my finger on why. any suggestions?

Code:
function RidinDirty.TravelToPlayer()
	local savedPlayer = RidinDirty.savedVariables.savedPlayer -- target saved player
	local effectId = RidinDirty.savedVariables.effectId
	local effectDelay = RidinDirty.savedVariables.effectDelay
	local savedPlayerId = nil -- savedID reset
	for i = 1, GetGroupSize() do
		local savedPlayerId = GetGroupUnitTagByIndex(i)
		if not GetUnitDisplayName("savedPlayerId") == savedPlayer then
			df("|c9900FF[RidinDirty]|r unit online is %s", savedPlayer) -- trying to execute this ONLY if previous line matches original savedPlayer
		end
	end
  Reply With Quote