#marker assignments WA
23 messages · Page 1 of 1 (latest)
If you are having errors we need a copy of the entire error's text to be able to help.
See this message #pins message for details on getting detailed Lua errors
https://pastebin.com/HP4yRauY is this good ?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
and where do you want that to work?
entirely impossible.
yes
https://pastebin.com/96ammEbH i've gotten to 4 lua error
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
but they used something simmilar during race to world first on ovinax
positional data is not available inside of instanced combat.
you dont get the player position.
what then i dont get do they do it 😦
-- Debuff IDs to track
local debuffIDs = {
436923, -- Assassination
442526 -- Experimental Dosage
}
-- Raid marker names in French for tracking
local raidMarkerIDs = {
[1] = "Étoile", -- Star
[2] = "Cercle", -- Circle
[3] = "Diamant", -- Diamond
[4] = "Triangle", -- Triangle
[5] = "Lune", -- Moon
[6] = "Carré", -- Square
[7] = "Croix", -- Cross
[8] = "Crâne" -- Skull
}
-- Maximum distance threshold for alert (in yards)
local maxRange = 100 -- Adjust this value to set the maximum valid distance for a marker (e.g., 100 yards)
-- Track assigned markers
local assignedMarkers = {}
-- Get the list of players in the group
local groupSize = GetNumGroupMembers()
local debuffedPlayers = {}
-- Check each player in the group for the specified debuffs
for i = 1, groupSize do
local unitID = "raid" .. i -- "raid" or "party" depending on your group setup
-- Check if the player has one of the debuffs
for _, debuffID in pairs(debuffIDs) do
if AuraUtil.FindAuraBySpellID(debuffID, unitID, "HARMFUL") then
table.insert(debuffedPlayers, unitID)
break
end
end
end
-- If no players are debuffed, no need to trigger the aura
if #debuffedPlayers == 0 then
return false
end
-- Get player's current position
local mapID = C_Map.GetBestMapForUnit("player")
local playerPos = C_Map.GetPlayerMapPosition(mapID, "player")
if not playerPos then
return false -- If we can't get the player's position, return false
end
local playerX, playerY = playerPos:GetXY()
-- Table to hold marker positions
local markers = {}
-- Collect all available marker positions
for i = 1, 8 do
local x, y, z, instanceID = C_WorldMarker.GetWorldMarkerInfo(i)
if x then
table.insert(markers, { id = i, x = x, y = y })
end
end
-- If no markers are placed, no need to trigger the aura
if #markers == 0 then
return false
end
-- Assign each debuffed player the closest marker
local markerText = ""
for _, unitID in ipairs(debuffedPlayers) do
local closestMarker = nil
local closestDistance = maxRange + 1
-- Get the player's position
local unitPos = C_Map.GetPlayerMapPosition(mapID, unitID)
if not unitPos then
return false
end
local unitX, unitY = unitPos:GetXY()
-- Find the closest available marker
for _, marker in ipairs(markers) do
if not assignedMarkers[marker.id] then
-- Calculate the distance between player and the marker
local distance = math.sqrt((marker.x - unitX)^2 + (marker.y - unitY)^2)
-- Convert the calculated distance from map coordinates to yards
distance = distance * C_Map.GetMapScalingFactorForID(mapID)
if distance < closestDistance then
closestDistance = distance
closestMarker = marker
end
end
end
-- Assign the closest marker to this player
if closestMarker then
assignedMarkers[closestMarker.id] = true
-- The alert text in French: "Déplacez-vous vers [Marker] à [Distance] mètres"
markerText = markerText .. string.format("Déplacez-vous vers %s (%.2f mètres)\n", raidMarkerIDs[closestMarker.id], closestDistance)
end
end
-- If a marker is found within range, return true to trigger the WeakAura
if markerText ~= "" then
return true, markerText
end
-- No markers found or out of range
return false
end
``` so this is not possible at all in combat ?
alr rip then i guess i dont get how they do it
sorry for bothering you wasnt the point i was trying to make
can i get marker position during fight ?