Jump to content

Abandon quest by id


Nosferatuepic

Recommended Posts

hello there, can you help me pls with abandon quest? for Vanilla wow, This code dont work

local questId = 12345;
for i=1,GetNumQuestLogEntries() do
	local _, _, _, _, _, _, _, id = GetQuestLogTitle(i);
	if id == questId then
		SelectQuestLogEntry(i);
		SetAbandonQuest();
		AbandonQuest();
	end
end
Link to comment
Share on other sites

19 minutes ago, FNV316 said:

dont work:
local questId = The Absent Minded Prospector;
for i=1,GetNumQuestLogEntries() do
    local _, _, _, _, _, _, _, id = GetQuestLogTitle(i);
    if id == questId then
        SelectQuestLogEntry(i);
        SetAbandonQuest();
        AbandonQuest();
    end
end

Link to comment
Share on other sites

2 hours ago, Mike Mail said:

local questId = 12345; <- "12345" Change to your quest id, if you havent already.
for i=1,GetNumQuestLogEntries() do
	local _, _, _, _, _, _, _, id = GetQuestLogTitle(i);
	if id == questId then
		SelectQuestLogEntry(i);
		SetAbandonQuest();
		AbandonQuest();
	end
end

This code dont work at vanilla

Link to comment
Share on other sites

1 hour ago, Zan said:

"The Absent Minded Prospector"

and change all questid to questname to avoid confusion.

local questId = The Absent Minded Prospector;
for i=1,GetNumQuestLogEntries() do
    local _, _, _, _, _, _, _, id = GetQuestLogTitle(i);
    if id == The Absent Minded Prospector then
        SelectQuestLogEntry(i);
        SetAbandonQuest();
        AbandonQuest();
    end
end

this?

Link to comment
Share on other sites

13 minutes ago, Nosferatuepic said:

local questId = The Absent Minded Prospector;
for i=1,GetNumQuestLogEntries() do
    local _, _, _, _, _, _, _, id = GetQuestLogTitle(i);
    if id == The Absent Minded Prospector then
        SelectQuestLogEntry(i);
        SetAbandonQuest();
        AbandonQuest();
    end
end

this?

The Absent Minded Prospector needs to be a string.

Link to comment
Share on other sites

7 hours ago, Nosferatuepic said:

dont work

That's why I said, use quest name (-> quest title) instead of id. Calling that Lua function returns (in Vanilla) 7 different values, so you need a variable for the very first value. You then check, if the value (string) of the quest title variable is the same (string.match / string.find) as your quest name string.

Please read the documentation. There is an example of how to use these variables right at the bottom. http://classic-wow.wikia.com/wiki/API_GetQuestLogTitle#questTag

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...