-- Args: "diff" only lists skills where the IDs are different from the main skill.xml file. (Default if no arg given) -- "full" lists all skills in your skillbook, not including passive skills that the bot doesn't use. function SkillBookDump(_mode) player:update() if _mode == nil or string.lower(_mode) ~= "full" then _mode = "diff" end local str local ClassMap = { [CLASS_NONE] = "None", [CLASS_WARRIOR] = "Warrior", [CLASS_SCOUT] = "Scout", [CLASS_ROGUE] = "Rogue", [CLASS_MAGE] = "Mage", [CLASS_PRIEST] = "Priest", [CLASS_KNIGHT] = "Knight", [CLASS_WARDEN] = "Warden", [CLASS_DRUID] = "Druid", [CLASS_WARLOCK] = "Warlock", [CLASS_CHAMPION] = "Champion", } local filename = getExecutionPath() .. "/userfunctions/SkillBookDump.txt"; local file, err = io.open(filename, "a"); if file then str = sprintf("Main Class: %s / Secondary Class: %s\n\n", ClassMap[player.Class1], ClassMap[player.Class2]) file:write(str) for tab = 2, 4 do local numskills = RoMScript("GetNumSkill("..tab..")") if numskills then if tab == 2 then str = sprintf("\t\n") elseif tab == 3 then str = sprintf("\t\n") elseif tab == 4 then str = sprintf("\t\n") end file:write(str) for slot = 1, numskills do local skillname, _, _, passive, _, _, _, _, _ = RoMScript("GetSkillDetail("..tab..","..slot..")") if skillname == nil then print("Error: GetSkillDetail Command returned NIL") file:close() return end skillname=string.upper(string.gsub(skillname," ","_")) skillname=string.upper(string.gsub(skillname,"-","_")) skillname=string.upper(string.gsub(skillname,"'","")) if tab == 3 then skillname = string.upper(ClassMap[player.Class2]).."_"..skillname else skillname = string.upper(ClassMap[player.Class1]).."_"..skillname end if passive ~= 2 then local link = RoMScript("GetSkillHyperLink("..tab..","..slot..")") if link == nil then print("Error: GetSkillHyperLink Command returned NIL") file:close() return end local _type, _id = string.match(link,"|H(%a*):(%x*)") local id if _id then if _type == "item" then id = tonumber("0x".._id) else id = _id end end local skillused = true local idchanged = false if database.skills[skillname] == nil then skillused = false else if tonumber(id) ~= tonumber(database.skills[skillname].Id) then idchanged = true end end if (string.lower(_mode) == "full") or (skillused == false) or (idchanged == true) then skillname = skillname.."\" " local skillpad if math.fmod(39-string.len(skillname),4) == 0 then skillpad = (39-string.len(skillname))/4 else skillpad = math.floor((39-string.len(skillname))/4)+1 end skillname = skillname..string.rep("\t",skillpad) local skillCD, _ = RoMScript("GetSkillCooldown("..tab..","..slot..")") if skillCD == nil then print("Error: GetSkillCooldown Command returned NIL") file:close() return end local casttime, range = readTooltipInfo(tab, slot) str = sprintf("\t\n", skillname, tostring(id), range, casttime, tostring(math.floor(skillCD))) file:write(str) str = "" end end end end end str = sprintf("\n") file:write(str) file:close() end end function readTooltipInfo(_tab,_slot) RoMCode("Sol.tooltip.ClearAllText(GameTooltip)") RoMCode("GameTooltip:SetSkillItem(".._tab..",".._slot..")") local sname, uses, casttime = RoMScript("igf_GetTooltip(\"Left\", \"SetSkillItem\", ".._tab..", ".._slot..")") if uses == "Instant" or casttime == "Instant" then casttime = "0" elseif string.sub(uses,1,13) == "Casting Time:" then casttime = string.sub(uses,15,14+(string.len(uses)-24)) elseif string.sub(casttime,1,13) == "Casting Time:" then casttime = string.sub(casttime,15,14+(string.len(casttime)-24)) else casttime = "0" end RoMCode("Sol.tooltip.ClearAllText(GameTooltip)") RoMCode("GameTooltip:SetSkillItem(".._tab..",".._slot..")") local sname, range = RoMScript("igf_GetTooltip(\"Right\", \"SetSkillItem\", ".._tab..", ".._slot..")") if range == nil then range = "0" elseif string.sub(range,1,6) == "Range:" then range = string.sub(range,8,string.len(range)) else range = "0" end return casttime, range end