Love what you have done I not much on multiboxing however like you code. I am just having trouble incorparting the oncooldown code. I am trying to clean up my supermacro and cant get the oncooldown to work I keep getting a nil value. I am not sure what I am doing wrong. What is the proper way for the lua code to get a return of a number to compare for a spell that is on cool down. Say I dont want it to tell me that the judgement spell of my paladin is not available if I spam it and wont cast it until it is off cooldown. thanks For the help
top of page

Stop playing one toon at a time--that's just so 2004!
5-Minute Multiboxing
An informal system for multiboxing in Classic WoW and
on private 1.12 Vanilla Servers
bottom of page
Well, "not available" is more than just CD. If you don't have enough mana, los blocked, or out of range will all cause error text.
But if you really want to test it before you cast:
if not OnCooldown("Judgement") then cast("Judgement") end
OnCooldown() calls SpellExists(), so you need that code:
function SpellExists(findspell)
for i = 1, MAX_SKILLLINE_TABS do
local name, texture, offset, numSpells = GetSpellTabInfo(i);
if not name then
break;
end
for s = offset + 1, offset + numSpells do
local spell, rank = GetSpellName(s, BOOKTYPE_SPELL);
if rank then
local spell = spell.." "..rank;
end
if string.find(spell,findspell,nil,true) then
return true
end
end
end
end