Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Wowmimic api documentation 1.0
- ---------------------------------------------------------------------------------
- -- General scripting usage related:
- function GeneralScriptingUsage()
- -- this is just to for Symbols
- end
- api_LoadScript(path)
- -- Arguments:
- -- path; type string
- -- include the script from argument to the current lua project. path root is Bot folder>Script folder.
- -- api_LoadScript("lib\\timer.lua") includes timer.lua file from Bot folder>Script folder> lib folder into the curreny lua project.
- api_StopScript()
- -- by default it returns false. by press F7 it will make it return true and end the current lua thread,and then it will reset its return value back to false once thread end.
- -- this function could be used to break while loop and end the current lua thread.
- -- example: while not api_StopScript() do MyLogic() end; so when player fress F7 it breaks this while loop and end curent lua thread. Once press it again it restart the lua thread and reset the return value to default.
- api_IsEnteredWorld()
- -- return type: Bool
- -- return true if already entered game world, otherwise return false
- api_IsLoadingScreen()
- -- return type: Bool
- -- return true if game is in loading screen, otherwise return false
- api_TitlePrint(str)
- -- Arguments:
- -- str; type string
- -- change game window titile name to argument's content.
- -- example: api_TitlePrint("Hello World!")
- api_LoadCurrentStatus()
- -- return type: string
- -- return whatever saved string by api_SaveCurrentStatus(str) function
- api_SaveCurrentStatus(str)
- -- Arguments:
- -- str; type:string
- -- save the string content into current season window's config files.
- api_MathRandom(n1,n2)
- -- Arguments:
- -- n1,n2; type:number
- -- return type:number
- -- same usage as lua native math.random(n1,n2) function
- api_CloseGame()
- -- Close current season window.
- api_KeyDown(keyASCII)
- -- Arguments:
- -- keyASCII: number
- -- Press key down by the key's ASCII value input. function works even game running background.
- -- example: Key_W's ASCII = 87, api_KeyDown(87) will keep W key pressed until release it.
- api_KeyUp(keyASCII)
- -- Arguments:
- -- keyASCII: number
- -- Press key down by the key's ASCII value input. function works even game running background.
- -- example: Key_W's ASCII = 87, api_KeyUp(87) will release W key.
- api_GetTime()
- -- return type: number
- -- return tickcount since PC started, same as GetTickCount() from windows api.
- ---------------------------------------------------------------------------------
- -- GUI related --
- function GuiRelated()
- -- this is just to for Symbols
- end
- api_GetSelectedRotation()
- -- return selected rotation script path as string. could use api_LoadScript(api_GetSelectedRotation()) to include the Rotation script in your lua project.
- ---------------------------------------------------------------------------------
- -- Entity list/Grind/Gather related:
- function EntityListGrindGather()
- -- this is just to for Symbols
- end
- api_FaceTarget()
- -- Usage: make player face towards selected object.
- api_AggrMobNumByName(name)
- -- Arguments:
- -- name;type string
- -- return type: Number
- -- return amount of the mobs whose name match the argument's content and has aggro on player within current scence
- -- example: api_AggrMobNumByName("Beetle")
- api_GroundAggrNum(range)
- -- Arguments:
- -- range;type string
- -- return type: number
- -- return amount of mob that has aggro on player within range of argument.
- api_HasTarget()
- -- return type: bool
- -- return true if player has object selected, else false
- api_HasBuffId(BuffID)
- -- Arguments:
- -- BuffID; type:number
- -- return type:Bool
- -- return true if player has BuffID otherwise false. the BuffID could be a buff or debuff. could easlier find buff id by searching buff's name in wow data base website such as wowhead. keep in mind same buff with different rank has different id
- -- example: api_HasBuffId(33405) , this will return if player has Ice Barrier Rank 6 on.
- api_GetStance()
- api_GetWalkStatus()
- -- return 1 if player is walking otherwise 0
- api_ForwardCastState()
- -- return type:number
- -- return 0 if player is not casting any forward load spells such as Frostbolt( it loads from left to right in castbar), otherwise it returns the spell's id
- -- example: if api_ForwardCastState() == 0 then print("player is not casting any forward cast spell") else print("forward cast spell found") end
- api_BackwardCastState()
- -- return type: number
- -- return 0 if player is not casting any backward load spells such as Blizzard( it loads from right to left in castbar), otherwise it returns the spell's id
- -- example: if api_BackwardCastState() == 0 then print("player is not casting any Backward cast spell") else print("Backward cast spell found") end
- api_GetFaceAngle(x,y)
- -- Arguments:
- -- x; type:number
- -- y; type:number
- -- returns: angle
- -- angle; type:number
- -- if calculate the angle from player's current position to face the argument's x y postion, and return angle value
- api_SetFaceAngle(angle)
- -- Arguments:
- -- angle; type:number
- -- change player's face direction by the angle given
- api_FacePos(x,y)
- -- Arguments:
- -- x; type:number
- -- y; type:number
- -- Usage: make player face to x,y position.
- api_GetMyLv()
- api_GetMyMoney()
- api_GetMyHp()
- api_GetMyMaxHp()
- api_GetMyMp()
- api_GetMyMaxMp()
- api_GetMyX()
- api_GetMyY()
- api_GetMyZ()
- api_GetMySpeed()
- api_GetMyMaxSpeed()
- -- return type: number
- -- the above functions returns character info by its literal meaning. no Agruments needed.
- -- it all returns 0 if not entered world or game in loading screen.
- api_GetObjectFaceAngle(actor)
- -- Arguments:
- -- actor; type:number
- -- it returns the Object's current face angle by object's actor
- api_CastSpell(str,x,y,z)
- -- Arguments:
- -- str; type:string
- -- x,y,z; type:number
- -- str is a marco command, x,y,z is the postion xyz you want the spell been cast.
- -- example: api_CastSpell("/cast Blizzard(Rank 1)",api_GetMyX(),api_GetMyY(),api_GetMyZ()) , this will make player cast Blizzard(Rank 1) at its current position.
- api_CastSpell2(str,x,y,z)
- -- Arguments:
- -- str; type:string
- -- x,y,z; type:number
- -- str is in game lua command,could be protected command such as "CastSpell(spellId)", CastSpellByName(spellName),x,y,z is the postion xyz you want the spell been cast.
- -- example: api_CastSpell("CastSpell(10)",x,y,z); api_CastSpell("CastSpellByName(Blizzard(Rank 1))",x,y,z), both could make player cast Blizzard(Rank 1) at xyz position.
- api_GatherObjName(actor)
- -- Arguments:
- -- actor; type:number
- -- return type: string
- -- returns the gathering object name by the engtity's actor
- api_GatherObjX(actor)
- api_GatherObjY(actor)
- api_GatherObjZ(actor)
- -- Arguments:
- -- actor; type:number
- -- return type:number
- -- returns the postion info x,y,z number by the entity's actor
- api_GatherObjExist(actor)
- -- Arguments:
- -- actor; type:number
- -- return type:bool
- -- return true if the Gather object still exist by its actor, else return false
- api_dw_HasLoot(actor)
- -- Arguments:
- -- actor; type:number
- -- return type:bool
- -- return true if the object still has loot by its actor, else return false
- api_CorpseX()
- api_CorpseY()
- api_CorpseZ()
- -- return type:number
- -- returns 0 when player is alive, returns player's corpse x,y,z info if player is dead/ghost
- -- in most cases, when player die inside instance, the corpse xyz are unique for each unique instance.
- -- could use this to check if player's corpse inside instance.
- -- example:
- function IsCorpseInSFKInstance()
- if math.floor(api_CorpseX()) == -231 and math.floor(api_CorpseY()) == 1571 and math.floor(api_CorpseZ()) == 76 then
- print("corpse inside SFK instance")
- return true
- else
- print("corpse not inside instance")
- return false
- end
- end
- api_Interact(name)
- -- Arguments:
- -- name; type:string
- -- interact by entity's name around player, player must stand close to the entity.
- -- example: api_Interact("Morgum") will open dialog with Morgum in Orgrimmar when player stand next to it.
- -- example2: api_Interact("Mailbox") will open the mail box dialog when player stand next to it.
- api_RightClick(id1,id2)
- -- Arguments:
- -- id1,id2; type:number
- -- it is same as player right click Object by Object's id1,id2 from entity list. it could triggers auto attack/loot/moveto objects just like what it does when player right click object.
- api_SelectObject(id1,id2)
- -- Arguments:
- -- id1,id2; type:number
- -- it is same as player left click Object by Object's id1,id2 from entity list. it only triggers select the object.
- api_AIGatherInfo(x,y,z,height,range,X_CoordinateBlackList,herb,mini)
- -- Usage: it returrns the closest gatherable object info base on current herb/mining skill rank at xyz position with scan height and within range, it also consider object's X coordinate to filter objects.
- -- this function only returns object that is gatherable under current Herbalism/Mining rank.
- -- Arguments:
- -- x,y,z,height,range; type:number
- -- X_CoordinateBlackList; type:table
- -- herb,mini; type:number
- -- returns: actor,mx,my,mz,id1,id2,name
- -- actor,mx,my,mz,id1,id2; type:number
- -- name; type:string
- -- actor is gatherable's actor from entitylist; mx,my,mz is its position; name is the gatherable's name
- -- id1,id2 could be used by api_RightClick(objid1,objid2) and it will makes character do the same as player manually right click on the gather object.
- -- if no gatherable fits the condition found, all returns will be 0
- -- example:
- function StandGather(x,y,z,height,range)
- local X_CoordinateBlackList = {}
- while not api_StopScript() and api_GetMyHp() > 0 do
- local herb,mini = GetGatherSkillRank()
- local objactor,objx,objy,objz,objid1,objid2,objname = api_AIGatherInfo(x,y,z,height,range,X_CoordinateBlackList,herb,mini)
- if objactor ~= 0 then -- found gatherable object fits its condition
- if not table.find(X_CoordinateBlackList,objx) then
- table.insert(X_CoordinateBlackList,objx) -- insert object's x coordinate so api_AIGatherInfo will filter this object in next scan. just in case have to give up this object and do a new scan.
- end
- -- could add your navigation logic here.
- api_RightClick(objid1,objid2) -- player right click object
- else
- print("no gatherable obj found. break function!")
- break
- end
- end
- end
- api_GroundGatherInfo(x,y,z,height,range,gatherObjectNametable,gatherObjectBlackList,X_CoordinateBlackList)
- -- Usage: it returrns the closest gatherable object info based on gatherObjectNametable,gatherObjectBlackList at xyz position with scan height and within range, it also consider object's X coordinate to filter objects.
- -- both gatherObjectNametable,gatherObjectBlackList are fuzzy matching
- -- this function doesnt take Herbalism and Mining skill rank into consideration.
- -- Arguments:
- -- x,y,z,height,range; type:number
- -- gatherObjectNametable,gatherObjectBlackList,X_CoordinateBlackList; type:table
- -- herb,mini; type:number
- -- returns: actor,mx,my,mz,id1,id2,name
- -- actor,mx,my,mz,id1,id2; type:number
- -- name; type:string
- -- actor is gatherable's actor from entitylist; mx,my,mz is its position; name is the gatherable's name
- -- id1,id2 could be used by api_RightClick(objid1,objid2) and it will makes character do the same as player manually right click on the gather object.
- -- if no gatherable fits the condition found, all returns will be 0
- api_GroundMobInfo(x,y,z,height,range,MobNametable,ActorFilter)
- -- Arguments:
- -- x,y,z,height,range; type:number
- -- MobNametable,actorfilter; type:table
- -- Usage: this function returns the closest mob info that at xyz position within height,range and also match the MobNametable, and whose actor not in the ActorFilter table.
- -- MobNametable is fuzzy matching
- -- returns: actor,mx,my,mz,id1,id2,name
- -- actor,mx,my,mz,id1,id2; type:number
- -- actor is mob's actor from entitylist; mx,my,mz is its position; name is the mob's name
- -- id1,id2 could be used by api_SelectObject(id1,id2) to select the mob
- -- if no mob fits the condition found, all returns will be 0
- -- example:
- function StandGrind(x,y,z,height,range)
- local ActorFilter = {}
- local MobNametable = {"Wolf"}
- while not api_StopScript() and api_GetMyHp() > 0 do
- local actor,mx,my,mz,id1,id2,name = api_GroundMobInfo(x,y,z,height,range,MobNametable,ActorFilter)
- if actor ~= 0 then -- found mob that fits condition
- if not table.find(ActorFilter,actor) then
- table.insert(ActorFilter,actor) -- insert mob's actor in ActorFilter so it will filter this mob in next scan. just in case have to give up this mob and do a new scan.
- end
- api_SelectObject(id1,id2) -- player select the mob
- -- could add your navigation/combat logic here.
- else
- print("no mob found. break function!")
- break
- end
- end
- end
- api_BlackListMobInfo(x,y,z,height,range,MobNameBlackList,ActorFilter)
- -- this function is similar as api_GroundMobInfo() but instead of returning what matches MobNametable, it returns whose name is not in the MobNameBlackList
- -- usage, argument, and return detail could take api_GroundMobInfo(x,y,z,height,range,MobNametable,ActorFilter) as reference.
- api_GroundClick(height,range,name)
- -- Arguments:
- -- height,range; type:number
- -- name; type:string
- -- Usage: it right clicks every interactable object that fuzzy matches name within height and range at current player's position in a split second.
- -- it also right clicks corpse that is lootable within height and range at current player's position in a split second. could use this for looting
- -- example:
- -- api_GroundClick(5,5,"Shallow Grave") will make character click every Shallow Grave at 5 height and 5 range. this is useful in Zul'Farrak.
- api_MobNumInList(x,y,z,height,range,nametable,MatchOrFilter)
- --Arguments:
- -- x,y,z,height,range; type:number
- -- nametable; type:table
- -- MatchOrFilter; type:number( accept 0 and 1 only, 0 means mobname matches nametable and 1 means mobname that filter out by nametable.)
- -- returns type: number
- -- Usage: this function could be used to return the amount of mob at position xyz wthin height and range and whose name Match/FilterOut by MatchOrFilter arguments.
- -- function auto filter out small creatures that has very little HP.
- -- example:
- -- local x,y,z = api_GetMyX(),api_GetMyY(),api_GetMyZ()
- -- local amount = api_MobNumInList(x,y,z,20,35,{"Cabal Acolyte"},0)
- -- this will return amount of mob whose name matches "Cabal Acolyte" at player current position within 20 height and 35 range.
- api_MobDensity(x,y,z,height,range)
- -- Arguments:
- -- x,y,z,height,range; type:number
- -- function auto filter out small creatures that has very little HP.
- -- Usage: this function returns amount of mob at xyz position within height and range without considering mob's name.
- api_BlackListMobTotalHp(x,y,z,height,range,MobNameBlackList)
- -- Arguments:
- -- x,y,z,height,range; type:number
- -- MobNameBlackList; type:table
- -- function auto filter out small creatures that has very little HP.
- -- returns: count,totalHp
- -- count,totalHp; type:number
- -- Usage: this function returns amount of mob and their currrent Hp sum at xyz position within height and range whose name is not in the MobNameBlackList.
- api_AggrMobTotalHp(x,y,z,height,range)
- -- Arguments:
- -- x,y,z,height,range; type:number
- -- returns: count,totalHp
- -- count,totalHp; type:number
- -- Usage: this function returns amount of mob and their currrent Hp sum at xyz position within height and range who has aggro to player.
- api_AggrMobList()
- -- returns: actor,mx,my,mz,id1,id2,name
- -- actor,mx,my,mz,id1,id2; type:number
- -- name ; type:string
- -- id1,id2 could be used by api_SelectObject(id1,id2) to select the mob
- -- Usage: this function could return the closest mob info who has aggro on player
- -- if no mob fits the condition found, all returns will be 0
- api_AggrNum()
- -- returns: amount
- -- amount; type:number
- -- Usage: this function returns amount of mob who has aggro on player within the scene
- api_GroundCorpseNum(height,range)
- -- Arguments:
- -- height,range; type:number
- -- returns: amount
- -- amount; type:number
- -- Usage: this function returns the amount of corpse who is still lootable within height and range at player's current position
- api_InteractNpcList(x,y,z,height,range,nametable)
- -- Arguments:
- -- x,y,z,height,range; type:number
- -- nametable; type:table
- -- returns: actor,mx,my,mz,id1,id2,name
- -- actor,mx,my,mz,id1,id2; type:number
- -- actor is npc's actor from entitylist; mx,my,mz is its position; name is the npc's name
- -- id1,id2 could be used by api_SelectObject(id1,id2) to select the mob
- -- if no npc fits the condition found, all returns will be 0
- -- Usage: this function returns the closest npc info at position xyz within height and range whose name fuzzy matchese whatever inside nametable.
- ---------------------------------------------------------------------------------
- -- Pathing related:
- function Pathing()
- -- this is just to for Symbols
- end
- api_Walk(x,y,z)
- -- Arguments:
- -- x,y,z; type:number
- -- characte move to x,y,z postion by CTM
- api_KeyBoardWalk(x,y,z)
- -- Arguments:
- -- x,y,z; type:number
- -- characte move to x,y,z postion by KeyPress W key
- api_GetNaviMeshPath(x,y,z,mapid)
- -- Arguments:
- -- x,y,z,id; type:number
- -- return type:string
- -- return waypoint string from current location to x,y,z position in mapID
- -- example:
- function CurrentMapID()
- local code = string.format([[
- /run
- ret = -1
- local _, _, _, _, _, _, _, mapid = GetInstanceInfo()
- ret = mapid
- ]])
- api_Macro(code)
- local id = tonumber(api_GetLua())
- return id
- end
- function GetWayPoints(x,y,z,id)
- local a = api_GetNaviMeshPath(x,y,z,mapid) -- request waypoint string from server.
- if mapid == nil then
- mapid = CurrentMapID() -- if didnt provide mapid, it will use current mapid.
- end
- if a ~= nil and a ~= "" and a ~= " " and a ~= "{ }" and a ~= "{}" then
- a = string.gsub(a,'"','')
- a = string.gsub(a,':','=')
- local b = load("return " .. a)
- a = b() -- convert string into table
- return a -- return the navi mesh waypoint table.
- else
- return {} -- request navi mesh waypoint failed from server, return empty table.
- end
- end
- -- if player is too far or too close to x,y,z or if waypoint from current position to x,y,z is invalid, it will only return 2 waypoints string( current xyz and destination xyz).
- ---------------------------------------------------------------------------------
- --Wow's Lua and Marco related:
- function WowLuaUsage()
- -- this is just to for Symbols
- end
- RunLua(str)
- -- Arguments:
- -- str; type:string
- -- Usage: this function could execute all wow's ingame lua functions including protected functions.
- -- example: RunLua('JumpOrAscendStart()') will make player jump.
- api_Macro(str)
- -- Arguments:
- -- str; type:string
- -- this is the in game macro function call. could use it to execute in game marco command or unprotected lua command. protected lua command wont work.
- -- example: api_Marco("/cast Ice Armor"); api_Marco("/p leave party!"); api_Marco("/run LeaveParty()")
- api_SetLua(str)
- -- Arguments:
- -- str; type:string
- -- this command usually could be used with api_GetLua() and api_Macro(str) to get return string from wow's lua call.
- -- check api_GetLua() to get the example of usage.
- api_GetLua()
- -- return type: string
- -- this command must be used with api_SetLua(str) and api_Macro(str) in order to get return strings from wow's lua call.
- -- example:
- function IsPlayerInGroup()
- local code = "/run ret = tostring(IsInGroup())"
- api_Macro(code)
- local str = api_GetLua()
- if str == "true" then
- return true
- else
- return false
- end
- end
- -- must use specific string "ret" to save the return value as string in the marco code execution.
- -- after marco code executed, GetLua() will return whatever is restored in "ret" variable by format of string.
- -- by comparing the return string you could tell function to return bool value base on need.
- -- example2:
- function GetInstanceID()
- local code = string.format([[
- /run
- ret = 0
- local name, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceID, instanceGroupSize, LfgDungeonID = GetInstanceInfo()
- if instanceID then
- ret = instanceID
- end
- ]])
- api_Macro(code)
- local str = api_GetLua()
- return tonumber(str)
- end
- -- must use specific string "ret" to save the return value as string in the marco code execution.
- -- after marco code executed, GetLua() will return whatever is restored in "ret" variable by format of string.
- -- by convert the return string to data type needed could easliy get whatever info you want from wow's lua api.
- ---------------------------------------------------------------------------------
- -- InGame function calls related:
- function InGameFunctionCalls()
- -- this is just to for Symbols
- end
- api_DestoryItemPos(bag,slot)
- -- Arguments:
- -- bag,slot; type:number
- -- instantly throw away item at bag, slot. could get item's bag/slot position by lua returns.
- ---------------------------------------------------------------------------------
- -- Hack features related:
- function HackFeatures()
- -- this is just to for Symbols
- end
- api_NoClipOnObject(name)
- -- Arguments:
- -- name; type:string
- -- gives player ability to pass the entity by its name.
- -- example: api_NoClipOnObject("Karazhan Gatehouse Portcullis") will allow player enter Karazhan without open its gate.
- -- since this feature is a locale modification, itself wont cause player getting banned.
- -- but if ppl sees this and report player, player could still getting banned. please use this at your own risk.
- api_WallClimb(n)
- -- Arguments:
- -- n; type:number
- -- change player's wall climb level to n. by default wall climb level is 1, if higher number player could climb more steep walls. it doesnt makes any difference if goes above 100.
- -- Please notice this feature could cause player getting banned. different server has different ban rules. use this at your own risk.
- ---------------------------------------------------------------------------------
- -- Commonly used lua functions:
- -- Notice the following commands are not native api from bot, in order to use it you will have to copy the function itself to your own lua script.
- function CommonUseLuafunctions()
- -- this is just to for Symbols
- end
- function Dist2P(x,y) -- returns floor value of distance between player and the x,y position
- local i = math.abs(math.sqrt((api_GetMyX() - x)^2 + (api_GetMyY() - y)^2))
- return math.floor(i)
- end
- function Dist2PExact(x,y) -- returns value of distance between player and the x,y position
- local i = math.abs(math.sqrt((api_GetMyX() - x)^2 + (api_GetMyY() - y)^2))
- return i-i%0.01
- end
- function Dist2PExact3D(x,y,z) -- returns value of distance between player and the x,y,z position
- local i = math.abs(math.sqrt((api_GetMyX() - x)^2 + (api_GetMyY() - y)^2 + (api_GetMyZ() - z)^2))
- return i-i%0.01
- end
- function Dist2DCal(x1,y1,x2,y2) -- returns value of distance between x1,y1 and the x2,y2
- local i = math.abs(math.sqrt((x1 - x2)^2 + (y1 - y2)^2))
- return math.floor(i)
- end
- function Dist3DCal(x1,y1,z1,x2,y2,z2) -- returns value of distance between x1,y1,z1 and the x2,y2,z2
- local i =math.abs(math.sqrt((x1 - x2)^2 + (y1 - y2)^2 + (z1 - z2)^2))
- return i
- end
- function GetGatherSkillRank() -- returns current Herbalism and Mining skill rank.
- local code = string.format([[
- /run
- ret = 0
- local num = GetNumSkillLines()
- local herb,min = 0,0
- local shit = {"Mining","Herbalism"}
- for i = 1,num do
- local skillName, header, isExpanded, skillRank, numTempPoints, skillModifier, skillMaxRank, isAbandonable, stepCost, rankCost, minLevel, skillCostType = GetSkillLineInfo(i)
- if skillName then
- if skillName == "Mining" then
- min = skillRank
- elseif skillName == "Herbalism" then
- herb = skillRank
- end
- end
- end
- ret = tostring(herb..","..min)
- ]])
- api_Macro(code)
- local str = tostring(api_GetLua())
- if str ~= "0" then
- local start = string.find(str,',')
- local shit = string.sub(str,1,start-1)
- local shit2 = string.sub(str,start+1,string.len(str))
- return tonumber(shit),tonumber(shit2)
- else
- return 0,0
- end
- end
- --- questing Lua related---
- function GetQuestNameById(id)
- local code = string.format([[/run ret = tostring(C_QuestLog.GetQuestInfo(%i))]],id)
- api_Macro(code)
- local str = api_GetLua()
- return tostring(str)
- end
- function HaveQuestToDoById(id)
- local code = string.format([[/run ret = 0 if C_QuestLog.IsOnQuest(%i) then ret = 1 end ]],id)
- api_Macro(code)
- local str = api_GetLua()
- if tonumber(str) == 1 then
- return true
- else
- return false
- end
- end
- function QuestIsAbletoTurnInById(id)
- local code = string.format([[/run ret = tostring(C_QuestLog.ReadyForTurnIn(%i))]],id)
- api_Macro(code)
- str = api_GetLua()
- if str == "true" then
- return true
- else
- return false
- end
- end
- function QuestIsCompletedById(id)
- local code = string.format([[/run ret = tostring(IsQuestComplete(%i))]],id)
- api_Macro(code)
- str = api_GetLua()
- if str == "true" then
- return true
- else
- return false
- end
- end
- function QuestHadAlreadyBeenDoneById(id)
- local code = string.format([[/run ret = tostring(C_QuestLog.IsQuestFlaggedCompleted(%i))]],id)
- api_Macro(code)
- str = api_GetLua()
- if str == "true" then
- return true
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement