Skip to content

Commit 076f097

Browse files
author
Freddie
committed
Auto-accept debug junk
1 parent 499861e commit 076f097

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

Modules/AutoAccept.lua

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function Module:OnEnteringWorld()
3939
end
4040

4141
function Module:AJ_REFRESH_DISPLAY()
42+
-- print('AJ_REFRESH_DISPLAY ', self.mode)
4243
if self.mode ~= MODE_SCAN then return end
4344

4445
local suggestions = CAJ_GetSuggestions()
@@ -48,6 +49,7 @@ function Module:AJ_REFRESH_DISPLAY()
4849
end
4950

5051
local currentOffset = C_AdventureJournal.GetPrimaryOffset()
52+
-- print('currentOffset = '..currentOffset)
5153
if currentOffset ~= self.offset then
5254
-- print('offset '..currentOffset..' != '..self.offset)
5355
C_AdventureJournal.SetPrimaryOffset(self.offset)
@@ -61,19 +63,23 @@ function Module:AJ_REFRESH_DISPLAY()
6163
suggestion.description or '',
6264
suggestion.buttonText or ''
6365
}, '|')
66+
-- if i == 3 then print(i..' - '..seenKey) end
6467
if self.seenEntries[seenKey] == nil then
6568
self.seenEntries[seenKey] = true
6669

6770
local shouldAccept = self:CheckSuggestion(suggestion, currentOffset, i)
71+
-- print(shouldAccept)
6872
if shouldAccept then
6973
self.mode = MODE_ACCEPT
70-
C_AdventureJournal.ActivateEntry(i)
74+
pcall(C_AdventureJournal.ActivateEntry, i)
75+
-- print('Auto accept '..seenKey)
7176
return
7277
end
7378
end
7479
end
7580

7681
local numSuggestions = C_AdventureJournal.GetNumAvailableSuggestions()
82+
-- print(numSuggestions)
7783
if (currentOffset + 1) < numSuggestions then
7884
self.offset = self.offset + 1
7985
C_Timer.After(0, function() C_AdventureJournal.SetPrimaryOffset(self.offset) end)
@@ -131,16 +137,25 @@ function Module:CheckSuggestion(suggestion, offset, index)
131137
local acceptQuest = L['autoAccept:acceptQuest']
132138
local startQuest = L['autoAccept:startQuest']
133139

140+
-- if suggestion.title ~= 'Bonus Event: Timewalking' then return end
141+
-- print('title: --'..suggestion.title..'--')
142+
-- print('desc: --'..suggestion.description..'--')
143+
-- print('button: --'..suggestion.buttonText..'--')
144+
134145
for choreKey, acceptData in pairs(ScannerModule.autoAccept) do
135146
local parts = { strsplit('.', choreKey) }
136147
local enabled = Addon.db.profile.chores[parts[1]][parts[2]][parts[3]][parts[4]]
137148
if enabled == true then
149+
-- print(choreKey)
138150
local matchString, questIds = unpack(acceptData)
139-
if (suggestion.buttonText == acceptQuest or
140-
suggestion.buttonText == startQuest) and
151+
-- TODO: 12.0 broke this somehow with duplicate timewalking entries, cool
152+
-- if (suggestion.buttonText == acceptQuest or
153+
-- suggestion.buttonText == startQuest) and
154+
if suggestion.buttonText == acceptQuest and
141155
(strmatch(suggestion.title, matchString) or
142156
strmatch(suggestion.description, matchString))
143157
then
158+
-- print('yey')
144159
local start = true
145160
for _, questId in ipairs(questIds) do
146161
local questStatus = ScannerModule.quests[questId]

0 commit comments

Comments
 (0)