JWalton85 3 Posted May 16, 2019 Share Posted May 16, 2019 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! Link to comment https://wrobot.eu/forums/topic/11238-how-to-train-spell-at-class-trainer/ Share on other sites More sharing options...
Droidz 2739 Posted May 17, 2019 Share Posted May 17, 2019 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; Link to comment https://wrobot.eu/forums/topic/11238-how-to-train-spell-at-class-trainer/#findComment-53727 Share on other sites More sharing options...
Matenia 629 Posted May 17, 2019 Share Posted May 17, 2019 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. Link to comment https://wrobot.eu/forums/topic/11238-how-to-train-spell-at-class-trainer/#findComment-53728 Share on other sites More sharing options...
JWalton85 3 Posted May 17, 2019 Author Share Posted May 17, 2019 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. Link to comment https://wrobot.eu/forums/topic/11238-how-to-train-spell-at-class-trainer/#findComment-53732 Share on other sites More sharing options...
dravrah 3 Posted March 12 Share Posted March 12 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! Link to comment https://wrobot.eu/forums/topic/11238-how-to-train-spell-at-class-trainer/#findComment-69210 Share on other sites More sharing options...
Droidz 2739 Posted March 14 Share Posted March 14 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;"); Link to comment https://wrobot.eu/forums/topic/11238-how-to-train-spell-at-class-trainer/#findComment-69212 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