miminio 11 Posted January 6, 2019 Share Posted January 6, 2019 how to abandon a quest? i have tryed but is not working local questId = 786; for i=1,GetNumQuestLogEntries() do local _, _, _, _, _, _, _, id = GetQuestLogTitle(i); if id == questId then SelectQuestLogEntry(i); SetAbandonQuest(); AbandonQuest(); end end i also try this that i use in vanilla but im getting an error var logId = Quest.GetLogIdByQuestId(409); if (logId > 0) { Lua.LuaDoString("SelectQuestLogEntry(" + logId + "); SetAbandonQuest(); AbandonQuest(); "); } [E] 09:36:04.090 - Compilator Error : c:\Users\wow1\AppData\Local\Temp\upb0zp3d\upb0zp3d.0.cs(26,27) : error CS0117: Το 'wManager.Wow.Helpers.Quest' δεν περιέχει ορισμό για το 'GetLogIdByQuestId' Link to comment Share on other sites More sharing options...
Droidz 2733 Posted January 6, 2019 Share Posted January 6, 2019 Hello, Use this code: local questId = 786; local i = 1 while GetQuestLogTitle(i) do local questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete, isDaily = GetQuestLogTitle(i); if ( not isHeader and GetQuestLink(i)) then if questId == tonumber(string.match(GetQuestLink(i), 'Hquest:(%d+)')) then SelectQuestLogEntry(i); SetAbandonQuest(); AbandonQuest(); break; end end i = i + 1 end Link to comment Share on other sites More sharing options...
Matenia 625 Posted January 6, 2019 Share Posted January 6, 2019 Check here: In Customscript, I put a class called QuesterHelper. WIth it, you can then call C# code: QuestHelper.AbandonQuester("questName") in any Quester step. Link to comment Share on other sites More sharing options...
miminio 11 Posted January 6, 2019 Author Share Posted January 6, 2019 3 hours ago, Droidz said: Hello, Use this code: local questId = 786; local i = 1 while GetQuestLogTitle(i) do local questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete, isDaily = GetQuestLogTitle(i); if ( not isHeader and GetQuestLink(i)) then if questId == tonumber(string.match(GetQuestLink(i), 'Hquest:(%d+)')) then SelectQuestLogEntry(i); SetAbandonQuest(); AbandonQuest(); break; end end i = i + 1 end i have test it there is no errors but the quest ist delete Link to comment Share on other sites More sharing options...
miminio 11 Posted January 6, 2019 Author Share Posted January 6, 2019 2 hours ago, Matenia said: Check here: In Customscript, I put a class called QuesterHelper. WIth it, you can then call C# code: QuestHelper.AbandonQuester("questName") in any Quester step. thnx m8 that work..and is C# code: QuestHelper.AbandonQuest("questName") . fast question how i can put 2 costum script ? in 2 profiles im using for key looting using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Threading; using wManager.Events; using wManager.Wow.Bot.Tasks; using wManager.Wow.Enums; using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; using System.ComponentModel; using Microsoft.VisualBasic; using robotManager.Helpful; public class Key { public static bool haveKey(int keyId) { bool haveKey = Lua.LuaDoString<bool>("local itemIdSearch = " + keyId + "; local bag = KEYRING_CONTAINER; for slot = 1,MAX_CONTAINER_ITEMS do local itemLink = GetContainerItemLink(bag,slot); local _, itemCount = GetContainerItemInfo(bag,slot); if itemLink and itemCount then local _,_,itemId = string.find(itemLink, '.*|Hitem:(%d+):.*'); if itemId and tonumber(itemId) == itemIdSearch then return true end end end return false"); return haveKey; } } Link to comment Share on other sites More sharing options...
Matenia 625 Posted January 6, 2019 Share Posted January 6, 2019 Copy this underneath the other class: public class Key { public static bool haveKey(int keyId) { bool haveKey = Lua.LuaDoString<bool>("local itemIdSearch = " + keyId + "; local bag = KEYRING_CONTAINER; for slot = 1,MAX_CONTAINER_ITEMS do local itemLink = GetContainerItemLink(bag,slot); local _, itemCount = GetContainerItemInfo(bag,slot); if itemLink and itemCount then local _,_,itemId = string.find(itemLink, '.*|Hitem:(%d+):.*'); if itemId and tonumber(itemId) == itemIdSearch then return true end end end return false"); return haveKey; } } If the compiler says any imports ("using" declarations) are missing, copy them to where the ones in my quester already are. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now