Thread Tools Display Modes
06-04-24, 11:35 PM   #1
Hubb777
A Flamescale Wyrmkin
 
Hubb777's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2024
Posts: 134
Aj_refresh_display

https://warcraft.wiki.gg/wiki/AJ_REFRESH_DISPLAY

Hi all. Is it possible to make the quest automatically accepted without opening the "AJ_REFRESH_DISPLAY" interface?

I made a little code here, but it doesn't work. Can he even work?

Lua Code:
  1. -- Register event handler for when new adventure notices are displayed
  2. local frame = CreateFrame("Frame")
  3. frame:RegisterEvent("AJ_REFRESH_DISPLAY")
  4.  
  5. frame:SetScript("OnEvent", function(self, event, ...)
  6.     local questID = 75665 -- Quest ID to automatically accept
  7.  
  8.     if event == "AJ_REFRESH_DISPLAY" then
  9.         local adventureID, adventureType, adventureState = ...
  10.  
  11.         -- Check if the adventure is of the correct type and state
  12.         if adventureType == "quest" and adventureState == "new" then
  13.             -- Check if the adventure's ID matches the one we want to automatically accept
  14.             if adventureID == questID then
  15.                 -- Automatically accept the quest
  16.                 C_GossipInfo.SelectOption(1)
  17.             end
  18.         end
  19.     end
  20. end)
  Reply With Quote
06-05-24, 07:03 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,969
It's possible that there is no automated way to do what you want - some stuff does need that interactive element like clicking a button etc.

The wiki.gg has the following Adventure Journal functions.

C_AdventureJournal.ActivateEntry(index)
C_AdventureJournal.CanBeShown()
C_AdventureJournal.GetNumAvailableSuggestions()
C_AdventureJournal.GetPrimaryOffset()
C_AdventureJournal.GetReward()
C_AdventureJournal.GetSuggestions([suggestions])
C_AdventureJournal.SetPrimaryOffset(offset)
C_AdventureJournal.UpdateSuggestions([levelUp])

Unfortunately no details available for them yet, so you might have to test them out to see what they let you do.

You might also have to use Blizzard_EncounterJournal as a required dependency if you haven't already.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
06-05-24, 09:28 PM   #3
Hubb777
A Flamescale Wyrmkin
 
Hubb777's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2024
Posts: 134
Thank you very much, I will look at this data.
  Reply With Quote
06-06-24, 06:43 AM   #4
Hubb777
A Flamescale Wyrmkin
 
Hubb777's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2024
Posts: 134
Lua Code:
  1. -- Quest details
  2. local questID = 75665
  3. local questName = "A Worthy Ally: Loamm Niffen"
  4.  
  5. -- Register event handler for when new adventure notices are displayed
  6. local frame = CreateFrame("Frame")
  7. frame:RegisterEvent("AJ_REFRESH_DISPLAY")
  8.  
  9. frame:SetScript("OnEvent", function(self, event, ...)
  10.     if event == "AJ_REFRESH_DISPLAY" then
  11.         local adventureID, adventureType, adventureState = ...
  12.  
  13.         -- Check if the adventure is of the correct type and state
  14.         if adventureType == "quest" and adventureState == "new" then
  15.             -- Check if the adventure's ID and name match the ones we want to automatically accept
  16.             local adventureInfo = C_AdventureJournal.GetAdventureInfo(adventureID)
  17.             if adventureInfo.adventureID == questID and adventureInfo.name == questName then
  18.                 -- Automatically accept the quest
  19.                 C_GossipInfo.SelectOption(1)
  20.             end
  21.         end
  22.     end
  23. end)
  24.  
  25. -- Activate the adventure entry for the quest with ID 75665
  26. local adventureIndex = 1 -- Replace with the appropriate index of the adventure you want to activate
  27. C_AdventureJournal.ActivateEntry(adventureIndex)
  28.  
  29. -- Get the reward for the current adventure
  30. local rewardIndex = 1 -- Replace with the appropriate index of the reward you want to retrieve
  31. 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.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Aj_refresh_display


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off