Lua Code:
-- Quest details
local questID = 75665
local questName = "A Worthy Ally: Loamm Niffen"
-- Register event handler for when new adventure notices are displayed
local frame = CreateFrame("Frame")
frame:RegisterEvent("AJ_REFRESH_DISPLAY")
frame:SetScript("OnEvent", function(self, event, ...)
if event == "AJ_REFRESH_DISPLAY" then
local adventureID, adventureType, adventureState = ...
-- Check if the adventure is of the correct type and state
if adventureType == "quest" and adventureState == "new" then
-- Check if the adventure's ID and name match the ones we want to automatically accept
local adventureInfo = C_AdventureJournal.GetAdventureInfo(adventureID)
if adventureInfo.adventureID == questID and adventureInfo.name == questName then
-- Automatically accept the quest
C_GossipInfo.SelectOption(1)
end
end
end
end)
-- Activate the adventure entry for the quest with ID 75665
local adventureIndex = 1 -- Replace with the appropriate index of the adventure you want to activate
C_AdventureJournal.ActivateEntry(adventureIndex)
-- Get the reward for the current adventure
local rewardIndex = 1 -- Replace with the appropriate index of the reward you want to retrieve
local reward = C_AdventureJournal.GetReward(rewardIndex)
Hello. The result is the following code. The problem with this code is that, as I understand it, it takes the very first task from the log.