May 16, 20196 yr I am trying to build my Quester bot for the first few levels to train spells as the character levels. To help me get started I'm trying to take this snippet: https://wrobot.eu/forums/topic/2681-snippets-codes-for-quest-profiles/?do=findComment&comment=13536 As I'm pretty new, I'm Using the Easy Quests Editor. In this case, I'm trying to get a Level 3 Warrior to train Battle Shout. In the image "Battle-Shout-2-twinstar" you can see how I'm researching the spellID. (In the image "Battle-shout-1" you can see that I got a long list of ID's from the Helper Tools and decided I needed to make sure I had the right rank.) Next, In my Quest editor I'm setting the "Is complete condition" value. I'm using the snippet I got from the XML file in the forum post "Snippets codes for quest profiles", and replacing "local id = 2018" with "local id = 6673". So the value of my Is complete condition is "return Lua.LuaDoString<bool>("local id = 6673; local skillType, spellId = GetSpellBookItemInfo(GetSpellInfo(id)); return id == spellId");" as you can see in the image "Battle-Shout-3-complete-condition." My primary concern is that when the Quester bot is running then once this step is reached in the Quests order this error message is spammed on the screen: "attempt to call global 'GetSpellBookItemInfo' (a nil value)". See Battle-Shout-4-ingame-error. Thanks so much for your help!
May 17, 20196 yr Hello, GetSpellBookItemInfo seem added in Wow 4.0.1. Try: local id = 6673; local nSearch = GetSpellInfo(id); if nSearch then local i = 1 while true do local spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL) if not spellName then break end if nSearch == spellName then return true; end i = i + 1 end end return false;
May 17, 20196 yr If you want to know if you know a spell, you can call GetSpellInfo("name"). It will only resolve the spell by name, if it's in your spell book and otherwise return nil. The function was added to Lua in TBC.
May 17, 20196 yr Author Thanks @Droidz! How would I enter this into the Complete Condition? I'm pretty new so I don't understand all the syntax requirements for the various languages of code you can use.
March 12, 20242 yr On 5/17/2019 at 8:47 PM, Droidz said: Hello, GetSpellBookItemInfo seem added in Wow 4.0.1. Try: local id = 6673; local nSearch = GetSpellInfo(id); if nSearch then local i = 1 while true do local spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL) if not spellName then break end if nSearch == spellName then return true; end i = i + 1 end end return false; hey @Droidz how to add these codes into the IsCompleteCondition? thanks a lot!
March 14, 20242 yr On 3/12/2024 at 6:50 PM, dravrah said: hey @Droidz how to add these codes into the IsCompleteCondition? thanks a lot! Hello, you can replace new line by space, or use multiline c# string: return Lua.LuaDoString<bool>("local id = 6673; local nSearch = GetSpellInfo(id); if nSearch then local i = 1 while true do local spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL) if not spellName then break end if nSearch == spellName then return true; end i = i + 1 end end return false;");
Create an account or sign in to comment