其他分享
首页 > 其他分享> > 魔兽世界API魔兽世界全局函数

魔兽世界API魔兽世界全局函数

作者:互联网

魔兽世界API
魔兽世界全局函数

帐号游戏时间范围函数 (Account PlayTime Limit Functions)此类API函数是专门为防沉迷系统而设计的,能计算出当前玩家游戏时间等内容,当前只在亚洲地区有效。

GetBillingTimeRested() - 返回当前帐户已登陆时间。

PartialPlayTime() - 如果用户状态为“疲劳(tired)”则返回1:降低经验及掉落。

NoPlayTime() - 如果用户状态为“不健康的(unhealthy)”则返回1:无经验及掉落。


动作函数 (Action Functions)这些函数对动作按钮进行操作(通常玩家的动作有可能通过下面列表中的函数执行)。

保护 界面 ActionButtonDown(id) - 按下指定动作按钮。
保护 界面 ActionButtonUp(id) - 释放指定动作按钮。
ActionHasRange(slot) - 检测指定动作按钮是否受距离限制 (是则返回 1,否则返回 nil) 。
界面 BonusActionButtonDown - 触发指定额外动作按钮 (宠物或仆从)。
界面 BonusActionButtonUp - 释放指定额外动作按钮 (宠物或仆从)。
保护 CameraOrSelectOrMoveStart() - 在 3D 界面开始 “左键单击” 动作。 (1.10 - 保护)
保护 CameraOrSelectOrMoveStop([stickyFlag]) - 在 3D 界面结束 “左键单击” 动作。 (1.10 - 保护)
ChangeActionBarPage() - 更改系统动作按钮页面为系统变量 CURRENT_ACTIONBAR_PAGE 指定页。
GetActionBarToggles() - 获取系统动作条显示状况。
GetActionCooldown(slot) - 获取指定动作按钮冷却状况。
GetActionCount(slot) - 获取动作按钮所需物品剩余量 (绷带/毒药/等),无物品或不可用时返回 0。
GetActionText(slot) - 获取动作按钮文本标签 (宏, 等),不存在则返回 nil。
GetActionTexture(slot) - 获取指定动作按钮材质路径。
GetBonusBarOffset() - 检测何种额外动作条已显示。
HasAction(slot) - 假如指定动作条按钮有技能执行,则返回 1,其他情况返回 nil。
IsActionInRange(slot) - 测试技能是否在施展距离内 (1=是, 0=否, nil=不可用)。
IsAttackAction(slot) - 技能为“攻击”动作则返回 1 (战斗中闪光), 其他情况返回 nil。
IsAutoRepeatAction(slot) - 技能可自动重复时返回 1,其他情况返回 nil。
IsCurrentAction(slot) - 技能动作正在执行时返回 1,其他情况返回 nil。
IsUsableAction(slot) - 技能可立即执行时返回 1,其他情况返回 nil。
IsConsumableAction(slot) - 技能有施展次数时返回 1 (例如:施法物品),其他情况返回 nil。
IsEquippedAction(slot) - 必须装备才能施展的技能返回 1 (例如:链接到必须装备的物品),其他情况返回 nil。
PetHasActionBar() - 检测玩家宠物是否有动作条。
PickupAction(slot) - 将指定动作按钮的技能提取并放置于光标上。
PickupPetAction(slot) - 将指定的宠物动作按钮的
技能提取并放置于光标上。
PlaceAction(slot) - 将鼠标上的技能放置于指定动作按钮。
SetActionBarToggles(show1,show2,show3,show4[, alwaysShow]) - 设置指定系统动作条显示。 - 1.12 版本添加 ‘alwaysShow’。
保护 TurnOrActionStart() - 在 3D 界面开始 “右键单击” 动作。(1.10 - 保护)
保护 TurnOrActionStop() - 在 3D 界面结束 “右键单击” 动作。 (1.10 - 保护)
保护 UseAction(slot[, checkCursor[, onSelf]]) - 执行绑定到指定 ID 的动作按钮技能,可定向玩家 (与目标无关)。


行为函数 (Activity Functions)这个部分的函数会引发玩家角色的动作(未在别处加以保护, 非简单确认步骤)

AcceptDuel() - 玩家同意接受决斗挑战.
保护 AttackTarget() - 攻击选定目标.
CancelDuel() - 拒绝决斗挑战.
CancelLogout()
CancelMeetingStoneRequest() - 将角色从集合石队列中移除
ClearTutorials()
ConfirmSummon()
保护 DescendStop() --增加于2.1
Dismount() --增加于2.0.3
FlagTutorial(“tutotial”)
保护 ForceLogout()
ForceQuit()
GetSummonConfirmAreaName()
GetSummonConfirmSummoner()
GetSummonConfirmTimeLeft()
Logout - 注销当前玩家角色.
Quit - 退出应用程序(游戏), 而非 LUA 脚本.
RandomRoll(low, high) - 随机产生在两个(正整数)数值闭区间的整数.
保护 SitStandOrDescendStart() - 切换玩家坐下/站立姿势.
保护 StartDuel(“name”) - 向玩家发出决斗邀请(根据名字)
TogglePVP() - 切换 PVP 状态
ToggleSheath() - 拔出/收起武器.
UseSoulstone() - 使用激活的灵魂石复活自己.


插件函数 (AddOn Functions)DisableAddOn(index or “AddOnName”) - 禁止某插件下次载入.
DisableAllAddOns() - 禁止所有插件下次被载入…
EnableAddOn(index or “AddOnName”) - 在下次进程开启指定插件.
EnableAllAddOns() - 在下次进程开启全部插件.
GetAddOnDependencies(index or “AddOnName”) - 取得插件依赖列表.
GetAddOnInfo(index or “AddOnName”) - 取得插件相关信息.
GetAddOnMetadata(index or “name”, “variable”) - 从插件的TOC文件中获取标签内容(值)。
GetNumAddOns() - 取得用户插件数量.
IsAddOnLoaded(index or “AddOnName”) - 指定插件已读取则返回 true.
IsAddOnLoadOnDemand(index or “AddOnName”) - 测试插件是否可动态载入.
LoadAddOn(index or “AddOnName”) - 发出动态载入插件读取请求.
ResetDisabledAddOns() -


竞技场函数(Arena Functions)ArenaTeamInviteByName(teamIndex, playerName) - Invites the specified player to the specified arena team.
ArenaTeamLeave(teamIndex) - Leaves the specified arena team.
ArenaTeamRoster(teamIndex) - Sends a request to the server to request the most recen
t information on a specific Arena Team that you are in.
ArenaTeamUninviteByName(teamIndex, playerName) - Removes the specified played from the specified arena team.
ArenaTeamDisband(teamIndex) - Disbands the arena team without any warning! Requires you to be the leader of the team. (Known to be implemented as of 2.1.3, but may have existed before).
GetArenaCurrency() - Gets the amount of arena points a player currently has to spend.
GetArenaTeam(teamIndex) - Returns information regarding the players arena team, nil if the player is not in the passed team
GetArenaTeamRosterInfo(teamIndex, playerIndex) - Returns information regarding a player from the specified team, this requires a call to ArenaTeamRoster you only need to do this when the player logins in, UI reloads will not effect the return.
GetNumArenaTeamMembers(teamIndex[, showOffline]) - Gets the number of arena team members, this requires a call to ArenaTeamRoster you only need to do this when the player logins in, UI reloads will not effect the return.
GetBattlefieldTeamInfo(index) - Gets info about a registered Arena Team at the end of an arena match.
GetCurrentArenaSeason() - Gets the current Arena season.
IsActiveBattlefieldArena() - Returns true if in an Arena Match, also Returns true for the second argument if it’s a registered match.
IsArenaTeamCaptain(teamIndex) - Returns a value based on whether the player is the arena team captain.
IsBattlefieldArena() - Returns true if the battlemaster you’re talking to can queue you for arenas


拍卖函数 (Auction Functions)CalculateAuctionDeposit(runTime) - 返回当前指定持续时间拍卖物品的堆放信息 (单位:分钟).
CanSendAuctionQuery() - 拍卖行搜索按钮可用时返回 1, 否则为 nil.
CancelAuction(index) - 取消指定拍卖 (在物主列表).
ClickAuctionSellItemButton() - 将当前 ‘拣起’ 的物品放到 ‘拍卖’ 栏.
CloseAuctionHouse() - 关闭 (打开的) 拍卖窗口.
GetAuctionHouseDepositRate() - 返回当前开启的拍卖窗口内物品 [含未显示] 存放比例 (百分率) (可能根据 CalculateAuctionDeposit).
GetAuctionInvTypes(classIndex, subclassIndex) - 返回物品的子类.
GetAuctionItemClasses() - 返回拍卖物品的主分类.
GetAuctionItemInfo(“type”, index) - 返回指定拍卖物品细节.
GetAuctionItemLink(“type”, index) - 返回指定拍卖物品的 itemLink.
GetAuctionItemSubClasses(classIndex) - 返回拍卖物品种类次序的子类.
GetAuctionItemTimeLeft(“type”, index) - 返回指定拍卖物品剩余时间状态.
GetAuctionSellItemInfo() - 返回当前拍卖物品相关信息 (未选择为 nil).
GetBidderAuctionItems([page]) - (取得竞标人信息).
GetNumAuctionItems(“type”) - 返回指定拍卖物品列表大小.
GetOwnerAuctionItems([page]) - (取得拍卖人信息).
GetSelectedAuctionItem(“type”) - 返回选择的拍卖物品索引 (1-
50), 未选择返回 0.
IsAuctionSortReversed(“type”, “sort”) - 指定拍卖物品的排列类型逆序排列时返回 1, 否则为 nil.
PlaceAuctionBid(“type”, index, bid) - 对选择拍卖物品投标.
QueryAuctionItems(“name”, minLevel, maxLevel, invTypeIndex, classIndex, subclassIndex, page, isUsable, qualityIndex) - (请求检索符合条件的物品).
SetSelectedAuctionItem(“type”, index) - ?.
SortAuctionItems(“type”, “sort”) - 根据指定分栏对指定拍卖列表进行排序.
StartAuction(minBid, buyoutPrice, runTime) - 开始拍卖 ‘创建拍卖’ 面板内物品.
界面 AuctionFrameAuctions.duration - 设置拍卖持续总计时间.


银行函数 (Bank Functions)BankButtonIDToInvSlotID(buttonID) - 以背包位置 ID 方式返回银行包裹位置 ID.
CloseBankFrame() - 关闭 (打开的) 银行窗口. --Ramble
GetBankSlotCost(numSlots) - 返回购买下个银行包裹位置的价格. --Ramble
GetNumBankSlots() - 返回已购买银行包裹位置数量, 如果已购完返回特定标志.
PurchaseSlot() - 购买一个空余的银行包裹位置.


战场函数 (Battlefield Functions)AcceptAreaSpiritHeal() - 接受灵魂治疗.
CancelAreaSpiritHeal() - 取消灵魂治疗.
CanJoinBattlefieldAsGroup() - 玩家不能加入战场团队则返回 nil.
AcceptBattlefieldPort(index[, acceptFlag]) - 接受或拒绝一个传送至战场的请求.
CheckSpiritHealerDist() - 死亡时如果你在精神医者复活的范围内,返回true.
CloseBattlefield() - 关闭候列战场窗口.
GetHonorCurrency() - 获取当前荣誉值
GetAreaSpiritHealerTime() - 返回距精神医者下一次释放复活的时间.
GetBattlefieldEstimatedWaitTime(index) - 返回战场队列估算的排队时间.
GetBattlefieldFlagPosition(index) - 获得战场旗帜的位置.
GetBattlefieldInfo(index) - 返回你最近打开队列窗口的战场的详细信息.
GetBattlefieldInstanceExpiration() - 获取战场即将关闭的时间.
GetBattlefieldInstanceInfo(index) - 获得战场的副本ID.
GetBattlefieldInstanceRunTime() - 单位:毫秒, 返回本次战场已运行的时间. (似乎是从服务器上获取数据,因为它和time()函数并不同步)
GetBattlefieldMapIconScale() - 调整在战场小地图上标记图标的比例.
GetBattlefieldPortExpiration(index) - 获得对应战场传送的剩余时间.
GetBattlefieldPosition(index) - 获取战场中与你不在同一小队或团队的玩家姓名与位置 .
GetBattlefieldScore(index) - 获得一个玩家的战场分数.
GetBattlefieldStatData(playerIndex, slotIndex) - 获取战场中某一个玩家某一分栏的详细信息 . (例如战歌峡谷的夺旗数)
GetBattlefieldStatInfo(index) - 从战场记分板的指定分栏获取信息 .
GetBattlefieldStatus(index) - 返回玩家所在或正
在队列中的战场的状态 .
GetBattlefieldTimeWaited(index) - 获取玩家在战场队列中的时间 .
GetBattlefieldWinner() - 获得战场中获胜者 .
GetNumBattlefieldFlagPositions() - Get the number of flag positions available from GetBattlefieldFlagPosition().
GetNumBattlefieldPositions() - Get the number of positions available from GetBattlefieldPosition().
GetNumBattlefieldScores() - Returns the number of scores(players) listed in the battlefield scoreboard.
GetNumBattlefieldStats() - Get the number of battleground specific columns.
GetNumBattlefields() - Get the number of running battlefields for the last battleground queue window you opened.
GetNumWorldStateUI() - 获取世界状态的UI数量
GetSelectedBattlefield() - Get the selected battlefield to join first.
GetWorldStateUIInfo(i) - Get score and flag status within a battlefield.
JoinBattlefield(index[, joinAs]) - 加入战场队列 .
LeaveBattlefield() - 离开战场.
ReportPlayerIsPVPAFK(“unit”) - 获取当前战场中的一玩家是否AFK
RequestBattlefieldPositions() - Request new data for GetBattlefieldPosition().
RequestBattlefieldScoreData() - Request new data for GetBattlefieldScore().
SetBattlefieldScoreFaction([faction]) - Set the faction to show on the battlefield scoreboard.
SetSelectedBattlefield(index) - Select the battlefield instance you want to join or the first one that becomes available.
ShowBattlefieldList(index) - Displays a queue window for the specified battlefield. Only works if you are already in a queue for the battlefield. Index corresponds to location in queue array.


绑定函数(Binding Functions)移除 GetActionSelfCastKey() -
移除 GetAutoLootToggleKey() -
GetBinding(index) - 获取索引的动作和快捷键.
GetBindingAction(“KEY” [,checkOverride]) - 获取绑定该键的动作.
GetBindingKey(“command”) - 获取该动作绑定的键.
界面 GetBindingText(“key”, “prefix”, returnAbbr) - 获取键值字串.
GetCurrentBindingSet() - 查询当前快捷键设置是否为指定帐号/角色.
GetNumBindings() - 获取总快捷键数与标题.
LoadBindings(which) - 读取默认/帐号/角色的特定快捷键配置.
RunBinding(“command”[, “up”]) - 运行名为 “command” 的快捷键
移除 SetActionSelfCastKey(“SHIFT” or “CTRL” or “ALT”) -
移除 SetAutoLootToggleKey(“SHIFT” or “CTRL” or “ALT”) -
SaveBindings(which) - 保存帐号或角色键配置.
SetBinding(“key”[, “command”]) - 设置或取消键绑定. (2.0 - 不能在战斗中使用.)
SetBindingSpell(“KEY”, “Spell Name”) - 设置绑定键到技能, 与 /cast 使用技能一样.
SetBindingClick(“KEY”, “ButtonName” [,“mouseButton”]) - 设置绑定键到按钮对象. 绑定鼠标时, 按键按下时发生鼠标点击事件, 释放时发生鼠标 up.
SetBindingItem(“KEY”, “itemname”) -
SetBindingMacro(“KEY”, “macroname”|macroid) -
SetConsoleKey(“key”
) - 设置控制台键 (通常 “`”).
SetOverrideBinding(owner, isPriority, “KEY” [,“COMMAND”]) - 设置/清除重复绑定键.
SetOverrideBindingSpell(owner, isPriority, “KEY”, “spellname”) -
SetOverrideBindingClick(owner, isPriority, “KEY”, “ButtoName”[,“mouseButton”]) -
SetOverrideBindingItem(owner, isPriority, “KEY”, “itemname”) -
SetOverrideBindingMacro(owner, isPriority, “KEY”, “macroname”|macroid) -
ClearOverrideBindings(owner) - 重置全部重复值.
SetMouselookOverrideBinding(“KEY” [,“COMMAND”]) -
IsModifierKeyDown() - 等价于 (IsShiftKeyDown() 或 IsControlKeyDown() 或 IsAltKeyDown()).
IsModifiedClick(“action”) - 绑定该动作按钮按下返回 1, 否则 nil.
IsMouseButtonDown([button or “button”]) -


增减益函数 (Buff/Debuff Functions)请勿混淆 buffId 和 buffIndex, 这是不同概念!

CancelPlayerBuff(buffIndex) - 从玩家身上移除特定增益.
CancelTrackingBuff() - 取消当前追踪增益 (追踪矿物等.)
GetPlayerBuff(buffId, buffFilter) - 获取特定效果信息 (有益, 有害或被动)
GetPlayerBuffApplications(buffIndex) - 获取特定增益/减益的叠加数.
GetPlayerBuffDispelType(buffIndex) - 获取玩家身上指定减益类型 (“魔法”, “诅咒”, “疾病”, 或 “毒药”)
GetPlayerBuffTexture(buffIndex) - 获取特定增益图标标识
GetPlayerBuffTimeLeft(buffIndex) - 获取增益持续剩余时间
GetWeaponEnchantInfo() - 返回主手和副手武器附魔信息.
UnitBuff(“unit”, index[, showCastable]) - 获取特定单位的增益信息.
UnitDebuff(“unit”, index[, showDispellable]) - 获取特定单位的减益信息.


视角函数 (Camera Functions)下列 API 仅对鼠标观察模式提供的按下右键和控制移动方向功能. 不支持按下鼠标左键切换视角.

保护 CameraOrSelectOrMoveStart() - Begin “Left click” in the 3D world. (1.10 - 保护)
保护 CameraOrSelectOrMoveStop([stickyFlag]) - End “Left click” in the 3D world. (1.10 - Protected)
CameraZoomIn(increment) - Zooms the camera into the viewplane by increment.
CameraZoomOut(increment) - Zooms the camera out of the viewplane by increment.
FlipCameraYaw(degrees) - 在 Z 轴旋转指定角度.
IsMouselooking() - 鼠标观察激活时返回 1, 否则为 nil.
MouselookStart()
MouselookStop()
MoveViewDownStart() - 镜头向下旋转.
MoveViewDownStop() - 停止调用 MoveViewDownStart() 旋转的镜头.
MoveViewInStart() - Begins zooming the camera in.
MoveViewInStop() - Stops zooming the camera in after MoveViewInStart() is called.
MoveViewLeftStart() - Begins rotating the camera to the Left.
MoveViewLeftStop() - Stops rotating the camera after MoveViewLeftStart() is called.
MoveViewOutStart() - Begins zooming the camera out.
MoveViewOutStop() - Stops zooming the camera out after Mov
eViewOutStart() is called.
MoveViewRightStart() - Begins rotating the camera to the Right.
MoveViewRightStop() - Stops rotating the camera after MoveViewRightStart() is called.
MoveViewUpStart() - 镜头向上旋转.
MoveViewUpStop() - 停止调用 MoveViewUpStart() 旋转的镜头.
保护 PitchDownStart() - Begins pitching the camera Downward.
保护 PitchDownStop() - Stops pitching the camera after PitchDownStart() is called.
保护 PitchUpStart() - Begins pitching the camera Upward.
保护 PitchUpStop() - Stops pitching the camera after PitchUpStart() is called.
NextView() - Cycles forward through the five predefined camera positions.
PrevView() - Cycles backward through the five predefined camera positions.
ResetView(index) - Resets the specified (1-5) predefined camera position to it’s default if it was changed using SaveView(index).
SaveView(index) - Replaces the specified (1-5) predefined camera positions with the current camera position.
SetView(index) - Sets camera position to a specified (1-5) predefined camera position.


频道函数 (Channel Functions)这些是针对聊天频道的函数. 同时参看聊天窗口函数 (Chat Window Functions) 和通信函数 (Communication Functions) 部分.

AddChatWindowChannel(chatFrameIndex, “channel”) - 在指定窗口打开频道.
ChannelBan(“channel”, “name”) - 在指定频道屏蔽一名玩家.
ChannelInvite(“channel”, “name”) - 邀请指定玩家到频道中.
ChannelKick(“channel”, “name”) - 从频道中剔除指定玩家.
ChannelModerate(“channel”) - 开启频道管理指令, 如 ChannelKick/Ban 等.
ChannelModerator(“channel”, “name”) - 设置指定玩家为频道管理员.
ChannelMute(“channel”, “name”) - 禁止指定玩家在频道中发言.
ChannelToggleAnnouncements(“channel”) - 切换频道显示/隐藏叫喊.
ChannelUnban(“channel”, “name”) - 解除屏蔽玩家.
ChannelUnmoderator(“channel”, “name”) - 解除频道管理员.
ChannelUnmute(“channel”, “name”) - 允许指定玩家发言.
DisplayChannelOwner(“channel”) - 在默认聊天中显示特殊频道主人.
EnumerateServerChannels() - 获取全部有效的服务频道 (区域依赖).
GetChannelList() - 获取已加入的频道列表.
GetChannelName(“channel” or index) - 获取指定频道名称.
GetChatWindowChannels(index) - 获取聊天窗口的频道名称列表.
JoinChannelByName(“channel”[, “password”[, frameId]]) - 加入指定频道 (可选密码和框架标识) (更新于 1.9)
LeaveChannelByName(“channel”) - 离开指定频道.
ListChannelByName(channelMatch) - 在聊天窗口显示指定频道的成员.
ListChannels() - 在聊天窗口中列出全部频道.
RemoveChatWindowChannel(chatFrameIndex, “channel”) - 创建隐藏频道 (不可见).
SendChatMessage(“text”[, “type”[, language[, targetPlayer, …]]]) - 发送聊天信息.
SetChannelOwner(“channel”, “name”) - 设置频道主人.
SetC
hannelPassword(“channel”, “password”) - 更改当前频道密码.


角色函数 (Character Functions)AbandonSkill(index) - 玩家忘却技能.
AcceptResurrect() - 接受他人复活.
AcceptSkillUps()
AcceptXPLoss() - 接受灵魂使者复活时的损失.
AddSkillUp(index)
BuySkillTier(index)
CancelSkillUps()
CheckBinderDist() - 检测玩家是否在炉石绑定指令距离.
ConfirmBinder() - 确认炉石绑定请求.
DeclineResurrect() - 拒绝他人复活.
GetBindLocation() - 获取炉石绑定区域名称.
GetBlockChance() - 获取玩家格挡几率.
GetCombatRating() - 获取玩家战斗频度. TBC 新增
GetCombatRatingBonus() - 获取玩家战斗奖励频度. TBC 新增
GetComboPoints() - 获取当前连击点.
GetCorpseRecoveryDelay() - 玩家接受复活剩余时间.
GetCritChance() - 获取爆击率()
GetCurrentTitle() - 获取玩家当前头衔 ID.
GetDamageBonusStat() - 获取额外伤害奖励状态索引.
GetDodgeChance() - 获取玩家躲闪几率.
GetMoney() - 获取拥有的金钱额度 (铜币).
GetParryChance() - 获取玩家招架几率.
GetRangedCritChance() - 获取远程爆击率
GetReleaseTimeRemaining() - 获取玩家灵魂释放剩余时间.
GetResSicknessDuration() -
GetRestState() - 获取休息状态.
GetSpellBonusDamage(spellTreeID) -
GetSpellBonusHealing() -
GetSpellCritChance(school)-
GetTimeToWellRested() - Defunct.
GetTitleName(index) - 获取玩家当前标题名称.
GetXPExhaustion() - 获取角色当前休息经验奖励, 没有奖励返回 nil.
HasFullControl()
HasSoulstone() - (获取是否灵魂绑定.)
IsFlying() -
IsIndoors - 返回1为在室内.返回nil值则在室内,你可以使用坐骑.
IsMounted - 坐骑状态返回1 否则为nil值.
IsOutdoors - 返回1为室外,否则为nil.返回1为室内可以使用坐骑
IsResting() - (获取是否处在休息状态.)
IsStealthed() - 如果为潜行或影遁返回1,否则为nil
IsSwimming() -
IsTitleKnown(index) - 若玩家的称为是有效值返回1,否则为nil值
NotWhileDeadError() - 生成一个内容为“你已死亡,无法这样进行这项动作”的错误信息.
RemoveSkillUp(index)
ResurrectHasSickness() - Appears to be used when accepting a resurrection will give you resurrection sickessness.
ResurrectHasTimer() - 返回玩家要接受复活是否要等待一段时间
RetrieveCorpse() - 在尸体附近时复活. e.g., 当玩家跑回自己尸体附近时显示的“接受复活”按钮.
SetCurrentTitle(index) - 设置玩家当前的称号ID
SetSelectedSkill(index)
GetPVPDesired() - 获取玩家当前是否为PVP标志


聊天窗口函数 (Chat Window Functions)下列是聊天窗口管理函数. 情同时参考频道函数 (Channel Functions) 和 通信函数(Communication Functions) 部分.

AddChatWindowChannel(chatFrameIndex, “channel”) - 在指定聊天页面显示频道.
AddChatWindowMessages - 在指定聊天窗口添加信息群.
ChangeChatColor(chatType,r,g,b) - 更换信息种类显示颜色.
界面 ChatFrame_AddChannel(chatFrame, “channelName”) - 在聊天页面激活频道.
界面 ChatFrame_OnHyperlinkShow(reference, link, button) - 在点击聊天链接时呼叫.
GetChatTypeIndex(type) - 获取聊天信息类型的数字 ID.
GetChatWindowChannels(index) - 获取聊天窗口收到的聊天频道.
GetChatWindowInfo(index) - 获取聊天窗口的设置信息.
GetChatWindowMessages(index) - 获取聊天窗口收到的信息类型.
JoinChannelByName(“channel”[, “password”[, frameId]]) - 加入指定频道 (可选密码和注册的指定框架) (更新于 1.9)
LoggingChat(newState) - 启用/禁用将聊天记录保存为\WoWChatLog.txt.
LoggingCombat(newState) - 启用/禁用将站点记录保存为\WoWCombatLog.txt
RemoveChatWindowChannel(chatFrameIndex, “channel”) - 在指定聊天窗口关闭频道.
RemoveChatWindowMessages(chatFrameIndex,“messageGroup”) - 在聊天窗口移除聊天信息.
SetChatWindowAlpha(index,alpha) - 设置聊天窗口透明度
SetChatWindowColor(index,r,g,b) - 设置一个聊天框背景的颜色.
SetChatWindowDocked(index,docked) - 设置聊天窗口停泊状态.
SetChatWindowLocked(index,locked) - 设置聊天窗口锁定状态.
SetChatWindowName(index,“name”) - 设置聊天窗口名称.
SetChatWindowShown(index,shown) - 显示/隐藏聊天窗口.
SetChatWindowSize(index,size) - 设置聊天框体的字体大小.


评论函数 (Commentator Functions)此类别的函数都是被保护的.据推测这些函数是用来观看竞技场比赛的

CommentatorAddPlayer()
CommentatorEnterInstance()
CommentatorExitInstance()
CommentatorFollowPlayer()
CommentatorGetCamera()
CommentatorGetCurrentMapID()
CommentatorGetInstanceInfo()
CommentatorGetMapInfo()
CommentatorGetMode()
CommentatorGetNumMaps()
CommentatorGetNumPlayers()
CommentatorGetPlayerInfo()
CommentatorLookatPlayer()
CommentatorRemovePlayer()
CommentatorSetBattlemaster()
CommentatorSetCamera()
CommentatorSetMapAndInstanceIndex()
CommentatorSetMode()
CommentatorSetMoveSpeed()
CommentatorSetPlayerIndex()
CommentatorStartInstance()
CommentatorToggleMode()
CommentatorUpdateMapInfo()
CommentatorUpdatePlayerInfo()
CommentatorZoomIn()
CommentatorZoomOut()


交流函数 (Communication Functions)主要与其他玩家进行交流设置的函数.另外你可以参考频道函数和聊天窗口函数.

DoEmote(“emote”[, “target”]) - 做出表情, 对目标做出表情.
GetDefaultLanguage(“unit”) - 返回目标单位登陆后默认的语言.
GetLanguageByIndex(index) - Returns the language sp
ecified by the index.
GetNumLaguages() - 返回你的角色能够说的语言数量(怀疑打错了).
RandomRoll(low, high) - 在low和high之间产生一个随机数.
SendAddonMessage(“prefix”, “text”, “type”) - 在隐藏的频道中发送信息. - (添加于 1.12)
SendChatMessage(“text”[, “type”[, language[, targetPlayer]]]) - 发送信息.


包裹函数 (Container/Bag Functions)此类别的函数主要管理你的背包 (背包, 物品袋).你也可以参考背包函数和银行函数.

ContainerIDToInventoryID(BagId) GetBagName(BagId) - 获取对应 ID 包裹名称.
GetContainerItemCooldown(BagId, slot)
GetContainerItemInfo(BagId, slot) - 获取包裹中物品信息.
GetContainerItemLink(BagId, slot) - 返回包裹中物品链接 (itemLink).
GetContainerNumSlots(BagId) - 返回对应 ID 包裹的容量格数.
HasKey() - 玩家拥有钥匙扣时返回 1, 否则返回 nil.
界面 OpenAllBags() - 打开/关闭所有背包.
界面 CloseAllBags() - 关闭全部包裹.
PickupBagFromSlot(slot) - 拾取指定位的背囊并置于鼠标指针. 假如已经拾起物品, 将把此物品放到指定包位, 并在需要时置换.
PickupContainerItem(BagId,slot)
PutItemInBackpack() - 尝试放置物品到背囊 (包裹 0).
PutItemInBag(inventoryId) - 尝试放置物品到指定背包.
界面 PutKeyInKeyRing() - 尝试放置物品到钥匙扣.
SetBagPortaitTexture(texture,slot)
SplitContainerItem(BagId,slot,amount)
界面 ToggleBackpack() - 切换背囊打开/关闭.
界面 ToggleBag(BagId) - 打开或关闭指定背包.
保护 UseContainerItem(BagId, slot[, onSelf]) - 使用包裹中指定位置物品. (警告: 假如商人窗口开启, 使用包裹物品则为出售!) - 1.12 添加 ‘onSelf’


手艺函数 (Crafting Functions)此类函数代替老的制作物品类函数,除此之外还有附魔和猎人宠物窗口 (你可以参考商业技能函数)。 附魔在界面打开的情况这些函数只有在使用时才能生效。你可以使用GetCraftSkillLine()来获取当前打开的商业技能面板中的技能。

CloseCraft()
CollapseCraftSkillLine(index)
CraftIsPetTraining() -
DoCraft(index)
ExpandCraftSkillLine(index)
GetCraftButtonToken()
GetCraftDescription(index)
GetCraftDisplaySkillLine()
GetCraftIcon(index)
GetCraftInfo(index)
GetCraftItemLink(index) - 返回可制造物品的物品链接。
GetCraftName()
GetCraftNumReagents(index)
GetCraftReagentInfo(index,reagentIndex)
GetCraftReagentItemLink(index,reagentIndex) - 返回制造物品所需的试剂之一的物品链接
GetCraftSelectionIndex()
GetCraftSkillLine()
GetCraftSpellFocus(index) - ?.
GetNumCrafts()
SelectCraft(index)


光标函
数 (Cursor Functions)AutoEquipCursorItem() - Causes the equipment on the cursor to be equipped.
ClearCursor() - Clears whatever item the cursor is dragging from the cursor. - (添加于 1.12)
CursorCanGoInSlot(invSlot) - Return true if the item currently held by the cursor can go into the given inventory (equipment) slot
CursorHasItem() - 假如当前光标放置物品则返回 true.
CursorHasMoney() - true/false
CursorHasSpell() - true/false
DeleteCursorItem()
DropCursorMoney - Drops the amount of money held by the cursor.
DropItemOnUnit(“unit”) - Drops an item from the cursor onto a unit.
EquipCursorItem(invSlot)
GetCursorMoney - Returns the amount of money held by the cursor.
GetCursorPosition() - Returns the cursor’s position on the screen.
HideRepairCursor()
InRepairMode() - Returns true if your cursor is in repair mode
PickupAction(slot) - Drags an action out of the specified quickbar slot and holds it on the cursor.
PickupBagFromSlot(slot) - Picks up the bag from the specified slot, placing it in the cursor. If an item is already picked up, this places the item into the specified slot, swapping the items if needed.
PickupContainerItem(bagID,slot)
PickupInventoryItem(invSlot) - “Picks up” an item from the player’s worn inventory.
PickupMacro(index) - Pickup a macro button icon.
PickupMerchantItem(index) - Places the item on the cursor.
PickupPetAction(slot) - Drags an action from the specified pet action bar slot into the cursor.
PickupPlayerMoney - Picks up an amount of money from the player.
PickupSpell(spellID, “bookType”) - Loads an action button onto the cursor to be dropped into a quickbar slot.
PickupStablePet(index) - ?.
PickupTradeMoney(amount)
PlaceAction(slot) - Drops an action from the cursor into the specified quickbar slot.
PutItemInBackpack() - attempts to place item in backpack (bag slot 0).
PutItemInBag(inventoryId) - attempts to place item in a specific bag.
ResetCursor()
SetCursor(“cursor” or nil)
ShowContainerSellCursor(index,slot)
ShowInspectCursor() - Change the cursor to the magnifying glass inventory inspection cursor
ShowInventorySellCursor() - ?.
ShowMerchantSellCursor(index) - Changes the cursor to the merchant sell cursor.
ShowRepairCursor()


调试函数 (Debugging Functions)debugprofilestart() - starts a timer for profiling during debugging.
debugprofilestop() - return the time in milliseconds since the last call to debugprofilestart()
FrameXML_Debug(flag) - Sets FrameXML logging state which is output to /WoW Folder/Logs/FrameXML.log
GetDebugStats()
debugstack(start, count1, count2) - Returns a string representation of the current calling stack (as of 1.9)


禁用函数 (Disabled Functions)这些函数存在, 但被完全禁用了.

AppendToFile - ?.
DeleteFile() - ?
ReadFil
e() - ?.


试衣间函数 (Dressing Room Functions)控制试衣间界面的函数. 新增于版本1.7.

界面 DressUpItem(ItemId) - 将在试衣间界面中显示穿着相应 ItemId 物品效果.
界面 DressUpItemLink(“ItemString” or “ItemLink”) - 将在试衣间界面中显示穿着指定物品效果.
界面 SetDressUpBackground(isAuctionFrame) - 设置物品试穿效果是否显示于拍卖行窗口.


附魔函数 (Enchanting Functions)GetWeaponEnchantInfo() - Return information about main and offhand weapon enchantments.
ReplaceEnchant()
ReplaceTradeEnchant() - Confirm the replacement of an enchantment via trade.
BindEnchant() - Confirm the binding of the item when enchanting.


声望函数 (Faction Functions)CollapseFactionHeader(index) - Collapse a faction header row.
ExpandFactionHeader(index) - Expand a faction header row.
FactionToggleAtWar(index) - Toggle the At War flag for a faction.
GetFactionInfo(index) - Gets details for a specific faction/faction header.
GetNumFactions() - Returns the number of lines in the faction display.
GetSelectedFaction() - Returns the row index of the currently selected faction in reputation window. (New in 1.10)
GetWatchedFactionInfo() - Returns information about the currently watched faction. (New in 1.10)
IsFactionInactive(index) - Returns true if the faction is marked inactive. (New in 1.10)
SetFactionActive(index) - Remove a faction from inactive group. (New in 1.10)
SetFactionInactive(index) - Move a faction to inactive group. (New in 1.10)
SetSelectedFaction(index) - Sets the currently selected faction in reputation window. (New in 1.10)
SetWatchedFactionIndex(index) - Sets which faction should be watched in Blizzard reputation bar. (New in 1.10)
UnitFactionGroup(“unit”) - Returns the faction group id and name of the specified unit. (eg. “Alliance”) - string returned is localization-independent (used in filepath)


框架管理 (Frame Management)CreateFrame(“frameType”[ ,“name”][, parent][, “inheritFrame”]) - Create a new frame of the specified type
CreateFont(“name”) - Dynamically create a font object
GetFramesRegisteredForEvent(event) - Returns a list of frames that are registered for the given event. - 新增于2.3
GetNumFrames() - Get the current number of Frame (and derivative) objects
EnumerateFrames(currentFrame) - Get the Frame which follows currentFrame
GetMouseFocus() - Returns the frame that currently has the mouse focus.
界面 MouseIsOver - Determines whether or not the mouse is over the specified frame.
PetActionBarFrame:Show(), :Hide() - Shows or hides the Pet Actionbar
Frame for players with pets. (Workaround for the petbar issue)
界面 ToggleDropDownMenu(level, value, dropDownFrame, anchorName, xOffset, yOffset)
界面 UIFrameFadeIn(frame, fadeTime, startAlpha, endAlpha)
界面 UIFrameFlash(…)


好友函数 (Friend Functions)AddFriend(“playerName”) - 添加一位玩家到好友列表.
GetFriendInfo(index) - 返回对应好友的名字,等级,职业,位置和在线状态.
GetNumFriends() - 返回你的好友数.
GetSelectedFriend() - 返回你当前选中好友的索引号.
RemoveFriend(“name” or index) - 从好友列表中移除一位好友
SetSelectedFriend(index) - Update the current selected friend.
ShowFriends() - Request updated friends information from server.
界面 ToggleFriendsFrame([tabNumber]) - Opens/closes the friends pane (possibly on a specific tab).


GM 函数 (GM Functions)保护 DeleteGMTicket()
GMRequestPlayerInfo() - access denied (darn)
GetGMStatus()
GetGMTicket()
GetGMTicketCategories() - Return all available ticket categories (not as a table)
GMSurveyAnswerSubmit(question, rank, comment) - ?
GMSurveyCommentSubmit(comment) - ?
GMSurveyQuestion ?
GMSurveySubmit ?
保护 NewGMTicket(type,“text”)
保护 Stuck() - Informs the game engine that the player is Stuck.
保护 UpdateGMTicket(type,“text”)


闲聊函数 (Gossip Functions)CloseGossip() - Dismiss the gossip window.
GetGossipActiveQuests() - Retrieves a list of the active (?) quests on the NPC you are talking to.
GetGossipAvailableQuests() - Retrieves a list of the available quests on the NPC you are talking to.
GetGossipOptions() - Retrieves a list of the available gossip items on the NPC you are talking to.
GetGossipText() - Retrieves the gossip text.
SelectGossipActiveQuest(index) - Selects an active quest.
SelectGossipAvailableQuest(index) - Selects an available quest.
SelectGossipOption(index) - Selects on a gossip item.


队伍函数 (Group Functions)同样可以查看: 团队函数

AcceptGroup() - 接受组队邀请.
CheckReadyCheckTime() - 未知, called from UIParent’s OnUpdate!
ConfirmReadyCheck(isReady) - 报告你是否已经就位.
ConvertToRaid() - 转化为团队.
DeclineGroup() - 拒绝组队邀请.
DoReadyCheck() - 进行一次就位检查.
GetLookingForGroup()
GetLootMethod() - 返回当前的物品分配模式
GetLootThreshold() - 返回当前物品分配模式下的物品质量下限(仅在队伍分配或队长分配时有效)
GetMasterLootCandidate(index) - Return the name of a player who is eligible to receive loot in master mode
GetNumPartyMembers() - 返回小队成员数
GetPar
tyLeaderIndex() - 当玩家不是队长时,返回队长的索引号(1-4).
GetPartyMember(index) - Returns the unit id of the party member at the given index if that party slot is filled, otherwise nil.
InviteUnit(“name” or “unit”) - Invites the specified player to the group you are currently in (new for WoW 2.0)
IsPartyLeader() - 当玩家是队长时返回true.
LeaveParty() - 退出队伍
PromoteByName(“name”) - Promotes by name the target.
PromoteToPartyLeader(“unit”) - 将对应玩家提升为队长.
SetLootMethod(“lootMethod”[, “masterPlayer” or threshold]) - 设置物品分配模式
SetLootThreshold(itemQuality) - 在队伍分配或队长分配时设置物品质量下限
UninviteUnit(“unit” or “name”) - Kick a unit from the party if player is group leader.
UnitInParty(“unit”) - 当对应玩家是玩家所在队伍的成员时返回true.
UnitIsPartyLeader(“unit”) - 当对应玩家是队长是返回true.


公会函数 (Guild Functions)AcceptGuild() - 接受加入公会的邀请.
BuyGuildCharter(“guildName”) - 买一个对应公会的公会徽章.
CanEditGuildInfo() - 如果你可以编辑公会信息时返回true
CanEditMOTD() - Returns true if you are allowed to edit the guild motd.
CanEditOfficerNote() - Returns true if you are allowed to edit a guild member’s officer note.
CanEditPublicNote() - Returns true if you are allowed to edit a guild member’s public note.
CanGuildDemote() - Returns true if you are allowed to demote a guild member.
CanGuildInvite() - Returns true if you are allowed to invite a new member to the guild.
CanGuildPromote() - ?.
CanGuildRemove() - ?.
CanViewOfficerNote() - ?.
CloseGuildRegistrar() - ?.
CloseGuildRoster() - ?.
CloseTabardCreation()
DeclineGuild() - ?.
GetGuildCharterCost() - 返回购买公会徽章的花费.
GetGuildInfo(“unit”) - 返回对应玩家所属的公会名称.
GetGuildInfoText() - Returns the persistant Guild Information data. (new in 1.9)
GetGuildRosterInfo(index) - This function is used to get info on members in the guild.
GetGuildRosterLastOnline(index) - Returns time since last online for indexth member in current sort order.
GetGuildRosterMOTD() - Returns guild’s MOTD.
GetGuildRosterSelection() - Returns the index of the current selected guild member.
GetGuildRosterShowOffline() - Returns true if showing offline members of the guild.
GetNumGuildMembers(offline) - Returns the number of guild members total.
GetTabardCreationCost() - Returns cost in coppers.
GetTabardInfo() -?.
GuildControlAddRank(“name”) - Add another rank called “name”. Only Guildmaster?
GuildControlDelRank - 删除等级? 仅会长有效?
GuildControlGetNumRanks() - Returns number of ranks after guild frame open. Any guild member can use this.
GuildControlGetRankFlags() - Returns list of values for each permission for your rank.
GuildControlGetRankName(index) - Returns name of the ra
nk. Any guild member can use this.
GuildControlSaveRank(“name”) - Only Guildmaster?
GuildControlSetRank(rank) - ?.
GuildControlSetRankFlag(index, enabled) - Enable/disable permission for some action.
GuildDemote(“name”) - ?.
GuildDisband() - ?.
GuildInfo() - Displays information about the guild you are a member of.
GuildInvite(“name”) - ?.
GuildLeave() - 退出公会.
GuildPromote(“name”) - ?.
GuildRoster() - Fetches the guild list and fires a GUILD_ROSTER_UPDATE event.
GuildRosterSetOfficerNote(index, “note”) - ?.
GuildRosterSetPublicNote(index, “note”) - ?.
GuildSetLeaderByName(“name”) - ?.
GuildSetMOTD(“note”) - ?.
GuildUninviteByName(“name”) - ?.
GuildUninvite() - kicks the member by number?
IsGuildLeader() - ?.
IsInGuild() - Lets you know whether you are in a guild.
SetGuildInfoText() - Sets the persistant Guild Information data. Limit is 500 letters (GuildInfoEditBox is limited to this number). Longer texts are possible, but will be reseted during the day. (new in 1.9)
SetGuildRosterSelection(index) - Selects/deselects a guild member according current sorting order.
SetGuildRosterShowOffline(enabled) - Sets/Resets the show offline members flag.
SortGuildRoster(“sort”) - Sorts guildroster according “sort”. Any unknown values sort on “name”.
TurnInGuildCharter() - ?.


公会银行函数(Guild Bank Function)所有函数新增于版本2.3

BuyGuildBankTab() - Buys a guild bank tab
CanWithdrawGuildBankMoney() - Boolean, true if player is permitted to withdraw funds. No bank proximity required.
CloseGuildBankFrame() - Closes the guild bank frame
DepositGuildBankMoney(money) - Deposits “money” amount in copper.
GetCurrentGuildBankTab() - Integer of selected tab, >= 1
GetGuildBankItemInfo(tab, slot) - Returns texture, amount and integer 1 or nil depending on locked state
GetGuildBankItemLink(tab, slot) - Returns itemLink
GetGuildBankMoney() - Integer, funds available in copper.
GetGuildBankMoneyTransaction(index) - No bank proximity required, however QueryGuildBankLog function requires proximity.
GetGuildBankTabCost() - Integer OR nil - cost in copper OR no tabs available to buy
GetGuildBankTabInfo(tab) - Returns the name and icon of the guild bank tab queried.
GetGuildBankTabPermissions(tab) - Gets display / player’s access info. Limited data available without bank proximity.
GetGuildBankTransaction(tab, index)
GetGuildBankWithdrawLimit() - Returns withdraw limit for currently selected rank in guild control
GetGuildTabardFileNames()
GetNumGuildBankMoneyTransactions() - Returns number of money log entries
GetNumGuildBankTabs() - Integer count of bought tabs, >= 0. No bank proximity required.
GetNumGuildBankTransactions(tab) - Returns number of log transactions for tab “tab”
IsTabViewable(tab) - Returns true if specified tab is viewable by player, false otherwise
PickupGuildBankItem(tab,
slot) - Picks up an item from the guild bank
PickupGuildBankMoney(money) - Picks up “money” copper from the guild bank
QueryGuildBankLog(tab) - Updates bank log data from the server, called before all transaction functions. “Money tab” is MAX_GUILDBANK_TABS+1
QueryGuildBankTab(tab) - Updates bank tab data from the server, called before all item functions.
SetCurrentGuildBankTab(tab) - Select different bank tab in the UI
SetGuildBankTabInfo(tab, name, iconIndex) - Modifies name and icon for tab
SplitGuildBankItem(tab, slot, amount) - Picks up part of a stack
WithdrawGuildBankMoney(money) - Withdraws “money” copper from the guild bank


荣誉函数 (Honor Functions)GetHonorCurrency() - Return the amount of honor the player has available to purchase items.
GetInspectHonorData() - Return honor info for the inspected unit (if available).
GetInspectPVPRankProgress() - Return rank progress for the inspected unit (if available). Ranges from 0 to 1.
GetPVPLastWeekStats() - Get your PvP/Honor statistics for last week.
GetPVPLifetimeStats() - Get your PvP/Honor statistics for your lifetime.
GetPVPRankInfo(rank[, unit]) - Get information about a specific PvP rank.
GetPVPRankProgress() - Get information about the PvP rank progress.
GetPVPSessionStats() - Get your PvP/Honor statistics for this session.
GetPVPThisWeekStats() - Get your PvP/Honor statistics for this week.
GetPVPYesterdayStats() - Get your PvP/Honor statistics for yesterday.
HasInspectHonorData() - Determine if the inspected unit’s honor data is available.
RequestInspectHonorData() - Request honor data for inspected unit.
UnitIsCivilian(“unit”) - Returns true if the unit is a civilian NPC.
UnitPVPName(“unit”) - Returns unit’s name with PvP rank prefix (e.g., “Corporal Allianceguy”).
UnitPVPRank(“unit”) - Get PvP rank information for requested unit.


屏蔽函数 (Ignore Functions)AddIgnore(“name”) - Add a player to your ignore list.
AddOrDelIgnore(“name”) - Toggles the ignore state of the specified name.
DelIgnore(“name”) - Delete a player from your ignore list.
GetIgnoreName(index) - Get the name of the player on your ignore list at index.
GetNumIgnores() - Get the number of players on your ignore list.
GetSelectedIgnore()
SetSelectedIgnore(index)


检测函数 (Inspection Functions)CheckInteractDistance(“unit”,distIndex)
ClearInspectPlayer() - Reset inspect data once finished with it (Called on inspect window hide)
GetInspectHonorData() - Return honor info for the inspected unit (if available).
GetInspectPVPRankProgress() - Return rank progress for the inspected unit (if available). Ranges from 0 to 1.
HasInspectHonorData() - Determine if the inspected unit’s hon
or data is available.
界面 InspectUnit(“unit”) - Inspects the specified / selected “unit”.
NotifyInspect(“unit”)
RequestInspectHonorData() - Request honor data for inspected unit.


副本函数(Instance Functions)CanShowResetInstances() - 返回玩家当前是否能够进行重置副本的操作 .
GetBattlefieldInstanceExpiration() - 获取战场即将关闭的时间 .
GetBattlefieldInstanceInfo(index) - Get the instance ID for a battlefield.
GetBattlefieldInstanceRunTime() - In milliseconds, the time since battleground started. (seems to be queried from server because it is not in sync with time())
GetInstanceBootTimeRemaining() - ?.
GetNumSavedInstances() - Gets the number of instances that the player is saved to.
GetSavedInstanceInfo(index) - 返回用户的副本进度.
IsInInstance() - Returns 1 if the player is in an instance.
ResetInstances() - Confirm reset of instances.
GetCurrentDungeonDifficulty() - Returns the player’s current Dungeon Difficulty setting (1-3).
SetDungeonDifficulty(difficulty) - Sets the player’s Dungeon Difficulty setting (for the 5-man instances).
GetInstanceDifficulty() - 返回当前副本的难度(1-3, 玩家不在副本则返回1).


背包函数 (Inventory Functions)这些函数主要管理你的"背包",已装备的物品.同样可以查看包裹函数和银行函数.

AutoEquipCursorItem() - Causes the equipment on the cursor to be equipped.
BankButtonIDToInvSlotID(buttonID) - Returns the ID number of a bank button in terms of inventory slot ID.
CancelPendingEquip(index) - This function is used to cancel a pending equip.
ConfirmBindOnUse()
ContainerIDToInventoryID(bagID)
CursorCanGoInSlot(invSlot) - Return true if the item currently held by the cursor can go into the given inventory (equipment) slot
EquipCursorItem(invSlot)
EquipPendingItem(invSlot) - Equips the currently pending Bind-on-Equip or Bind-on-Pickup item from the specified inventory slot. (Internal - do not use)
GetInventoryAlertStatus(index) - Returns one of several codes describing the “status” of an equipped item.
GetInventoryItemBroken(“unit”,invSlot) - Determine if an inventory item is broken (no durability).
GetInventoryItemCooldown(“unit”,invSlot) - Get cooldown information for an inventory item.
GetInventoryItemCount(“unit”,invSlot) - Determine the quantity of an item in an inventory slot.
GetInventoryItemLink(“unit”,invSlot) - Returns an itemLink for an inventory (equipped) item.
GetInventoryItemQuality(“unit”,invSlot) - Return the quality of an inventory item.
GetInventoryItemTexture(“unit”,invSlot) - Return the texture for an inventory item.
GetInventorySlotInfo(invSlotName) - Get the info for a named inventory slot (slot ID and texture)
GetWeaponEnchantInfo() - Return information about main and offhand w
eapon enchantments.
HasWandEquipped() - Returns 1 if a wand is equipped, false otherwise.
IsInventoryItemLocked(id) - Returns whether an inventory item is locked, usually as it awaits pending action.
KeyRingButtonIDToInvSlotID(buttonID) - Map a keyring button to an inventory slot button for use in inventory functions.
PickupBagFromSlot(slot) - Picks up the bag from the specified slot, placing it in the cursor. If an item is already picked up, this places the item into the specified slot, swapping the items if needed.
PickupInventoryItem(invSlot) - “Picks up” an item from the player’s worn inventory.
SetInventoryPortaitTexture - ?.
UpdateInventoryAlertStatus()
保护 UseInventoryItem(invSlot) - Use an item in a specific inventory slot.


物品函数 (Item Functions)这些函数主要利用物品链接或者是物品信息进行各种操作.同时还可以参考包裹函数以及背包函数.

EquipItemByName(“name” [,slot]) - Equips an item by its name, optionally into a specified slot. GetAuctionItemLink(“type”, index) - Returns an itemLink for the specified auction item.
GetContainerItemLink(bagID, slot) - Returns the itemLink of the item located in bag#, slot#.
GetCraftItemLink(index) - Returns an itemLink for the specified craftable item.
GetCraftReagentItemLink(index,reagentIndex) - Returns an itemLink for one of the reagents needed to craft the given item
GetItemCooldown(itemid or “name” or itemLink) - 返回开始时间,冷却时间,启用.
GetItemCount(itemID, “itemName”, or “itemLink”, [includeBank]) - 返回当前制定的物品在你背包中的数量 GetItemInfo(itemId or “itemString”) - Returns information about an item.
GetItemQualityColor(quality) - Returns the RGB color codes for a quality.
GetItemSpell(item) - 返回名称,等级
GetMerchantItemLink(index) - Returns an itemLink for the given purchasable item
GetQuestItemLink - Returns an itemLink for a quest reward item.
GetQuestLogItemLink - ?.
GetTradePlayerItemLink(id) - Returns an itemLink for the given item in your side of the trade window (if open)
GetTradeSkillItemLink(index) - Returns the itemLink for a trade skill item.
GetTradeSkillReagentItemLink(index, reagentId) - Returns the itemLink for one of the reagents needed to craft the given item
GetTradeTargetItemLink(id) - Returns an itemLink for the given item in the other player’s side of the trade window (if open)
IsUsableItem(item) - Returns usable, noMana.
IsConsumableItem(item) -
IsCurrentItem(item) -
IsEquippedItem(item) -
IsEquippableItem(itemid or “name” or itemLink) - 返回1或nil
IsEquippedItemType(“type”) - Where “type” is any valid inventory type, item class, or item subclass.
IsItemInRange(item, [unit]) - Nil for no valid target, 0 for out of range, 1 for in range.
ItemHasRange(item) -
OffhandHasWeapon() - Determine if your offhand carries a weapon.
SplitContainerItem(bag
ID,slot,amount) - Picks up part of a stack.
界面 SetItemRef(link, text, button) - Handles item link tooltips in chat.


物品描述函数 (Item Text Functions)描述物品信息

CloseItemText() - 关闭一个物品信息窗口(书, 面板, 等).
ItemTextGetCreator() - 获取当前物品的创建者(如果是玩家制造的).
ItemTextGetItem() - 获取文本名称.
ItemTextGetMaterial() - Get the material on which the text is printed.
ItemTextGetPage() - Get the page number of the currently viewed page.
ItemTextGetText() - Get the page contents of the currently viewed page.
ItemTextHasNextPage() - Determine if there is another page after the current one.
ItemTextNextPage() - Request the next page of the text.
ItemTextPrevPage() - Request the previous page of the text.


按键绑定函数 (Key Binding Functions)GetBinding(index) - Get action and key bindings for that index.
GetBindingAction(“key”) - Get the action bound to that key.
GetBindingKey(“command”) - Get the key(s) bound to that action.
界面 GetBindingText(“key”, “prefix”) - Gets the string value for the key.
GetCurrentBindingSet() - Queries if current set of key bindings is character or account specific
GetNumBindings() - Get total number key bindings and headers.
LoadBindings(which) - Loads default, account or character specific key binding set into memory from disk.
RunBinding(“command”[, “up”]) - Executes the key binding named “command”
SaveBindings(which) - Saves account or character specific key bindings from memory to disk.
SetBinding(“key”[, “command”]) - Sets or unsets key bindings.
SetConsoleKey(“key”) - Sets the console key (normally “`”).


基础知识函数 (Knowledge Base Functions)KBArticle_BeginLoading()
KBArticle_GetData()
KBArticle_IsLoaded()
KBQuery_BeginLoading()
KBQuery_GetArticleHeaderCount()
KBQuery_GetArticleHeaderData()
KBQuery_GetTotalArticleCount()
KBQuery_IsLoaded()
KBSetup_BeginLoading()
KBSetup_GetArticleHeaderCount()
KBSetup_GetArticleHeaderData()
KBSetup_GetCategoryCount()
KBSetup_GetCategoryData()
KBSetup_GetLanguageCount()
KBSetup_GetLanguageData()
KBSetup_GetSubCategoryCount()
KBSetup_GetSubCategoryData()
KBSetup_GetTotalArticleCount()
KBSetup_IsLoaded()
KBSystem_GetMOTD()
KBSystem_GetServerNotice()
KBSystem_GetServerStatus()


寻求组队函数(Looking For Group Functions)用于寻求组队

AcceptLFGMatch()
CanSendLFGQuery(typeID, lfgNdx)
CancelPendingLFG()
ClearLFGAutojoin()
ClearLFMAutofill()
ClearLookingForGroup()
ClearLookingForMore()
DeclineLFGMatch()
GetLFGPartyResults(typ
e, lfgNdx, index, partyIndex)
GetLFGResults(type, lfgNdx, index)
GetLFGStatusText()
GetLFGTypeEntries(type)
GetLFGTypes() {“None”, “Dungeon”, “Raid”, “Quest (Group)”, “Zone”, “Heroic Dungeon”}
GetNumLFGResults(type, lfgNdx)
IsInLFGQueue()
LFGQuery(typeID, lfgNdx [, class])
SetLFGAutojoin()
SetLFGComment()
SetLFGType(slot, type)
SetLFMAutofill()
SetLFMType()
SetLookingForGroup(slot, type, index)
SetLookingForMore()
SortLFG(“type”)


地区函数 (Location Functions)返回当前玩家所在区域信息

GetMinimapZoneText() - 返回显示于小地图上的区域文本.
GetRealZoneText() - 返回副本或区域名称.
GetSubZoneText() - 返回子区域文本 (例如: “运河”).
GetZonePVPInfo() - 返回当前区域的 PVP 信息.
GetZoneText() - 返回区域文本 (例如: “暴风城”).


拾取函数 (Loot Functions)CloseLoot([uiFailedFlag])
保护 ConfirmBindOnUse()
ConfirmLootRoll(slot) - Confirm a loot roll (NEW IN 1300)
ConfirmLootSlot(slot) - Confirm looting of a BoP item.
GetAutoLootDefault() - Returns 1 if Auto Loot is enabled (checked), nil if disabled (unchecked).
GetLootMethod() - Return the currently active lootMethod
GetLootRollItemInfo(rollId)
GetLootRollItemLink(rollId)
GetLootRollTimeLeft(rollid)
GetLootSlotInfo(slot) - Returns icon path, item name, and item quantity for the item in the given loot window slot
GetLootSlotLink(slot) - Returns an itemLink for the item in the given loot window slot
GetLootThreshold() - Return the current loot threshold (for group/master loot)
GetMasterLootCandidate(index) - Return the name of a player who is eligible to receive loot in master mode
GetNumLootItems() - Returns amount of objects to loot (number)
GiveMasterLoot(slot,index)
移除 IsAutoLootKeyDown() - Replaced by IsModifiedClick(“AUTOLOOTTOGGLE”) IsFishingLoot()
LootSlot(slot) - Used to confirm the looting of a BOP item
LootSlotIsCoin(slot)
LootSlotIsItem(slot)
RollOnLoot(rollId[, roll]) - Roll or pass on a loot event started by the game engine.
SetAutoLootDefault(true/false) -
SetLootMethod(“lootMethod”[, “masterPlayer” or threshold]) - Set the current loot method
SetLootPortrait()
SetLootThreshold(itemQuality) - Set the threshold for group/master loot


彩票函数(Lottery Functions)BuyRandomPicks - ? - (添加于 1.12)
CloseLottery - ? - (添加于 1.12)
GetJackpotAmount - ? - (添加于 1.12)
GetLastLotteryNumbers - ? - (添加于 1.12)
GetLotteryPrizeInfo - ? - (添加于 1.12)
GetMoneyPrizes - ? - (添加于 1.12)
GetNextDrawTime - ? - (添加于 1.12)
GetNumLotteryPrizes - ? - (添加于 1.12)
GetNumPastDrawResults - ? - (添加于 1.12)
GetPastDrawResult - ? - (添加于 1.1
2)
SubmitNumbers - ? - (添加于 1.12)


宏函数 (Macro Functions)CreateMacro(“name”, icon, “body”, local) - 创建一个新的宏(2.0 - 无法在战斗中创建).
CursorHasMacro() - 返回1或nil (新增于 2.0.3) DeleteMacro(id|“name”) - 删除1个宏.
EditMacro(index, “name”, iconIndex, “body”, local) - 编辑/保存宏.
GetMacroIconInfo(index) - 返回 Blizzard 指定的图标.
GetMacroIndexByName(“name”) - 返回宏索引.
GetMacroInfo(index) - 返回宏的 “name”, iconTextureID, “body”, local.
GetNumMacroIcons() - 返回 Blizzard 使用宏图标数.
GetNumMacros() - 返回玩家宏数量.
PickupMacro(index) - 拾取宏按钮上的图标.
保护 RunMacro(id|“name”) - 运行宏
保护 RunMacroText(“macro”) - 运行宏
SecureCmdOptionParse(“command”) - 宏中使用条件选择时, 返回合适的选择.


邮件函数 (Mail Functions)邮件相关事件.


CheckInbox() - 从服务器接收数据放置到客户端的收件箱中.
ClearSendMail() - 清除发送邮件表格并将附件放回包裹. --Bug 15:52, 6 Feb 2005 (EST)
ClickSendMailItemButton() - This seems to just simulate a click on the send item mail slot (will pickup the item there). --Bug 18:59, 4 Feb 2005 (EST)
CloseMail() - 关闭邮件窗口. --Bug 19:04, 4 Feb 2005 (EST)
DeleteInboxItem(index) - Deletes the inbox item at index. It returns immediately, it does not seem to wait for the deletion to go through, giving the normal problems with rapid mail removal attempts.
DropCursorMoney - Drops the amount of money held by the cursor.
GetCoinIcon(amount)
GetInboxHeaderInfo(index) - 返回收件箱标题信息.
GetInboxItem(index) - Returns description of the attachment attached to message at (index).
GetInboxNumItems() - 返回收件箱中邮件数.
GetInboxText(index) - Returns the message text of message at (index). It also reads the inbox item, thus reducing its timeout to <= 3 days.
GetInboxInvoiceInfo(index) - Returns informations about an auction house invoice. It also reads the inbox item, thus reducing its timeout to <= 3 days.
GetNumPackages() - Not yet fully implemented. Currently it always returns 1. --Bug 16:28, 6 Feb 2005 (EST)
GetNumStationeries() - Not yet fully implemented. Currently it always returns 1. --Mikk 17:03, 17 May 2006 (EDT)
GetPackageInfo(index) - Not yet fully implemented. Currently an index of 1 returns “Test Package”. --Bug 16:28, 6 Feb 2005 (EST)
GetSelectedStationeryTexture() - Not yet fully implemented. Currently it returns “STATIONERYTEST” when the mailbox is open. --Bug 16:28, 6 Feb 2005 (EST)
GetSendMailCOD() - ?.
GetSendMailItem() - ?.
GetSendMailMoney() - ?.
GetSendMailPrice() - ?.
GetStationeryInfo(index) - Not yet fully impleme
nted. Currently an index of 1 returns “Default Stationery”. --Mikk 17:03, 17 May 2006 (EDT)
HasNewMail() - Returns nil if there is no new mail. --Bug 19:14, 4 Feb 2005 (EST)
InboxItemCanDelete(index) - ?.
ReturnInboxItem(index) - Returns to the sender the attached item in the mail message at the specified index.
SelectPackage(index) - Not yet fully implemented. It does nothing visible. --Bug 16:28, 6 Feb 2005 (EST)
SelectStationery(index) - Not yet fully implemented. It does nothing visible. --Bug 16:28, 6 Feb 2005 (EST)
SendMail(“target”, “subject”, “body”) - If the mailbox is open, this sends mail. --Buttahcup 4 Feb 2005
保护 SetSendMailCOD(amount) - Make next mail sent using SendMail() COD target for amount. --Drundia 21:30, 25 April 2006 (EDT)
保护 SetSendMailMoney(amount) - Add money to next mail sent using SendMail(). --Drundia 21:30, 25 April 2006 (EDT)
TakeInboxItem(index) - 收取收件箱中的附件.
TakeInboxMoney(index) - 收取收件箱中的金钱. --Drundia 21:30, 25 April 2006 (EDT)
TakeInboxTextItem(index) - Creates a permanent copy of letter (readable “Plain Letter”) --Drundia 21:30, 25 April 2006 (EDT).


地图函数 (Mapping Functions)下列是世界地图显示相关函数.


GetCorpseMapPosition() - 返回当前世界地图中尸体位置.
GetCurrentMapContinent() - 返回当前世界地图显示的大陆号码.
GetCurrentMapZone() - 返回当前世界地图显示的区域号码.
GetMapContinents() - 返回大陆名称.
GetMapInfo() - 返回当前世界地图名称和尺寸.
GetMapLandmarkInfo(landmarkIndex) - 返回当前世界地图标记信息.
GetMapOverlayInfo(overlayIndex) - 返回当前世界地图覆盖信息.
GetMapZones(continentIndex) - 返回大陆区域名称.
GetNumMapLandmarks() - 返回当前世界地图标记号码.
GetNumMapOverlays() - 返回当前世界地图覆盖号码…
GetPlayerMapPosition(“unit”) - 返回对象在当前世界地图位置.
GetWorldLocMapPosition(continent, x, y)
ProcessMapClick(x,y) - Passes a click to the client, which then calculates if the zone has to be changed.
RequestBattlefieldPositions() - 为 GetBattlefieldPosition() 请求新数据.
SetMapToCurrentZone() - 设置地图显示当前玩家所在区域.
SetMapZoom(continentIndex[, zoneIndex]) - 设置地图显示区域.
SetupFullscreenScale() - 设置全屏显示比例, 如世界地图, 最佳为全屏.
界面 ToggleMinimap - 切换小地图显示状态.
界面 ToggleWorldMap - 切换世界地图显示状态…
UpdateMapHighlight(x,y) - 提供地图高亮信息.
CreateWorldMapArrowFrame(“frame”) - 为玩家方位创建指示方向光标.
UpdateWorldMapArrowFrames() - 更新玩家方位指示方向光标.
ShowWorldMapArrowFrame(bool) - 切换玩家方位指示.
PositionWorldMapArrowFrame(x,y) - 设置玩家
方位指示光标位置.


集合石函数 (Meeting Stone Functions)


CancelMeetingStoneRequest() - 将玩家从集合石列表移除.
GetMeetingStoneStatusText()
IsInMeetingStoneQueue()


商人函数 (Merchant Functions)


BuyMerchantItem(index[, qty]) - 从商人处购买物品.
BuybackItem(index) - 购回售出的物品.
CanMerchantRepair() - 商人提供修理时返回 true.
CloseMerchant() - 关闭交易窗口.
GetBuybackItemInfo(index) - 返回售出物品的信息.
GetMerchantItemInfo(index) - 返回指定商品相关信息.
GetMerchantItemLink(index) - 返回指定商品的 itemLink.
GetMerchantItemMaxStack(index) - 返回商人出售物品堆叠最大数量.
GetMerchantNumItems() - 返回商人出售物品种类数量.
GetRepairAllCost()
HideRepairCursor()
InRepairMode() - 光标为修理模式时返回 true.
IsVendorActive - ? - (添加于 1.12)
PickupMerchantItem(index) - 拾取物品到光标上.
RepairAllItems() - 修理全部装备和背包里的物品.
ShowMerchantSellCursor(index) - 切换光标到出售状态.
ShowRepairCursor() - 切换光标到修理状态.


移动函数 (Movement Functions)Use with caution - movement started by a script must be stopped by script. Keys/Mouse will not stop movement. These functions no longer work (fail silently) in patch 1.6 if NOT triggered from a hardware event (just like spell casts). As of patch 1.10 many of these functions were protected for use of only Blizzard signed code.


保护 CameraOrSelectOrMoveStart() - Begin “Left click” in the 3D world. (1.10 - 保护)
保护 CameraOrSelectOrMoveStop([stickyFlag]) - End “Left click” in the 3D world. (1.10 - Protected)
FollowByName(“name”[, exactMatch]) - Follow a player with the specified player name
FollowUnit(“unit”) - Follow an ally with the specified UnitID
保护 Jump() - The player jumps.
保护 MoveBackwardStart - The player begins moving backward at the specified time.
保护 MoveBackwardStop - The player stops moving backward at the specified time.
保护 MoveForwardStart - The player begins moving forward at the specified time.
保护 MoveForwardStop - The player stops moving forward at the specified time.
保护 StrafeLeftStart - The player begins strafing left at the specified time.
保护 StrafeLeftStop - The player stops strafing left at the specified time.
保护 StrafeRightStart - The player begins strafing right at the specified time.
保护 Strafe
RightStop - The player stops strafing right at the specified time.
保护 ToggleAutoRun - Turns auto-run on or off
ToggleMouseMove()
保护 ToggleRun - Toggle between running and walking.
保护 TurnLeftStart - The player starts turning left at the specified time.
保护 TurnLeftStop - The player stops turning left at the specified time.
保护 TurnOrActionStart() - Begin “Right Click” in the 3D world. (1.10 - 保护)
保护 TurnOrActionStop() - End “Right Click” in the 3D world. (1.10 - 保护)
保护 TurnRightStart - The player starts turning right at the specified time.
保护 TurnRightStop - The player stops turning right at the specified time.


音乐播放器 (Music Player Functions)下列指令仅作用于 Mac 的 iTunes


保护 MusicPlayer_BackTrack() - Go back a track (Mac iTunes only) - (添加于 1.12)
保护 MusicPlayer_NextTrack() - Go forward a track (Mac iTunes only) - (添加于 1.12)
保护 MusicPlayer_PlayPause() - Toggle play/paulse (Mac iTunes only) - (添加于 1.12)
保护 MusicPlayer_VolumeDown() - Reduce music volume (Mac iTunes only) - (添加于 1.12)
保护 MusicPlayer_VolumeUp() - Increase music volume (Mac iTunes only) - (添加于 1.12)


宠物函数 (Pet Functions)


BuyStableSlot()
CastPetAction(index) - 施放相应的宠物技能.
CheckPetUntrainerDist() - Check wether the player is close enough to the pet untrainer.
ClickStablePet(index) - ?.
ClosePetStables() - 关闭兽栏界面.
ConfirmPetUnlearn() - 确认宠物忘却技能请求.
DropItemOnUnit(“unit”) - 对目标使用光标上物品.
GetNextStableSlotCost()
GetNumStablePets() - 返回兽栏中宠物数量.
GetNumStableSlots() - 返回拥有的兽栏数量.
GetPetActionCooldown(index) - 返回指定宠物动作条技能冷却信息.
GetPetActionInfo(index) - 返回指定宠物动作条技能信息.
GetPetActionsUsable() - 假如当前玩家宠物技能可使用则返回特征值.
GetPetExperience() - 返回宠物当前经验和升级经验总需求.
GetPetFoodTypes() - 返回宠物喜欢的食物种类列表.
GetPetHappiness() - 返回宠物快乐度, 伤害加成, 以及忠诚度增长率.
GetPetIcon() - 返回玩家宠物图标材质引用字串.
GetPetLoyalty() - 返回宠物当前忠诚度等级.
GetPetTimeRemaining() - Returns in milliseconds about some timeout for the player’s pet.
GetPetTrainingPoints() - 返回宠物当前训练点数总量和用量.
GetSelectedStablePet() - ?.
GetStablePetFoodTypes(index) - 返回兽栏中指定宠物喜欢的食物种类列表.
GetStablePetInfo(index) - 返回兽栏中指定宠物信息.
HasPetSpells() - 玩
家有宠物技能则返回 true.
HasPetUI() - 玩家有宠物界面则返回 true.
PetAbandon() - 永久遗弃宠物.
PetAggressiveMode() - 设置宠物为攻击模式.
PetAttack() - 命令宠物攻击目标.
IsPetAttackActive() - 宠物正在进行攻击时返回 true.
PetStopAttack() - 宠物停止攻击.
PetCanBeAbandoned() - 宠物可遗弃则返回 true.
PetCanBeRenamed() - 宠物可重命名返回 true.
PetDefensiveMode() - 设置宠物为防御模式.
PetDismiss() - 解散宠物.
PetFollow() - 命令宠物跟随.
PetHasActionBar() - 检测玩家宠物是否有技能条.
PetPassiveMode() - 设置宠物为被动模式.
PetRename(“name”) - 给宠物起名.
PetWait() - 命令宠物停止跟随.
PickupPetAction(slot) - 在宠物技能条中拾取技能.
PickupStablePet(index) - (召唤指定兽栏中宠物).
SetPetStablePaperdoll(modelObject) - ?.
StablePet(index) - ?.
TogglePetAutocast(index) - 切换指定宠物自动施放状态.
ToggleSpellAutocast(index, bookIndex) - 切换指定宠物技能自动施放状态.(技能书).
GetSpellAutocast(index, bookIndex) - 获取指定宠物技能自动施放状态.
UnstablePet(index) - ?


Petition Functions


CanSignPetition() - ?.
ClosePetition() - ?.
GetNumPetitionNames() - ?.
GetPetitionInfo() - ?.
GetPetitionNameInfo(index) - ?.
OfferPetition() - ?.
RenamePetition(“name”) - ? - (NEW IN 1300)
SignPetition() - ?.


任务函数 (Quest Functions)同时参考闲聊函数 (Gossip Functions)


AbandonQuest - 放弃指定任务.
AcceptQuest - 接受指定任务.
AddQuestWatch(x) - 添加任务到监视列表.
CloseQuest - ?.
CollapseQuestHeader - Collapses a quest header.
CompleteQuest - 结束指定任务.
ConfirmAcceptQuest - 接受任务.
DeclineQuest - Declines the currently offered quest.
ExpandQuestHeader - 展开任务标题.
GetAbandonQuestName - 获取放弃任务的名称.
GetActiveLevel(index) - 获取激活任务的等级 (仅当 QUEST_GREETING 事件后有效).
GetActiveTitle(index) - 获取激活的任务标题 (仅当 QUEST_GREETING 事件后有效).
GetAvailableLevel(index) - 获取有效任务的等级 (仅当 QUEST_GREETING 事件后有效).
GetAvailableTitle(index) - 获取有效任务的标题 (仅当 QUEST_GREETING 事件后有效).
GetGreetingText()
GetNumActiveQuests - 获取 NPC 对话激活任务数量 (仅当 QUEST_GREETING 事件后有效).
GetNumAvailableQuests - 获取 NPC 对话中有效任务数量 (仅当 QUEST_GREETING 事件后有效).
GetNumQuestChoices - Returns the number of rewards for a completed quest.
GetNumQuestItems - Returns the number of items ness
ecary to complete a particular quest.
GetNumQuestLeaderBoards([questIndex]) - Returns the number of available quest objectives.
GetNumQuestLogChoices - Returns the number of options someone has when getting a quest item.
GetNumQuestLogEntries - 返回任务日志条目数.
GetNumQuestLogRewards - 返回指定任务的回报.
GetNumQuestRewards - ?.
GetNumQuestWatches() - 返回激活的监视任务数量.
GetObjectiveText() - 获取当前任务对象文本.
GetProgressText()
GetQuestBackgroundMaterial - Returns the material string associated with the particular quest.
GetQuestGreenRange() - Return for how many levels below you quests and mobs remain “green” (例如: 经验数)
GetQuestIndexForTimer - ?.
GetQuestIndexForWatch(watchIndx) - 返回指定监视的任务索引
GetQuestItemInfo - 返回任务物品基础信息.
GetQuestItemLink - 返回任务获取物品链接.
GetQuestLogChoiceInfo - Returns a bunch of data about a quest reward choice from the quest log.
GetQuestLogItemLink - ?.
GetQuestLogLeaderBoard(ldrIndex[, questIndex]) - Gets information about the objectives for a quest.
GetQuestLogPushable - 任务窗口中加载的任务可共享则返回 true.
GetQuestLogQuestText - Returns the description and objectives required for the specified quest.
GetQuestLogRequiredMoney - ?.
GetQuestLogRewardInfo - Returns a pile of reward item info.
GetQuestLogRewardMoney - Returns a number representing the amount of copper returned by a particular quest.
GetQuestLogRewardSpell - ?.
GetQuestLogSelection - Returns a number associated with the QuestLogSelection index.
GetQuestLogTimeLeft - ?.
GetQuestLogTitle - Returns the string which is associated with the specific QuestLog Title in the game.
GetQuestMoneyToGet - ?
GetQuestReward - Gets the quest reward specified.
GetQuestText - 获取当前任务描述.
GetQuestTimers - Returns all of the quest timers currently in progress.
GetRewardMoney - 返回任务获取金钱数.
GetRewardSpell - ?.
GetRewardText - ?.
GetTitleText - Retrieves the title of the quest while talking to the NPC about it.
IsCurrentQuestFailed - ?.
IsQuestCompletable - 任务可完成则返回 true.
IsQuestWatched(questIndex) - 确认指定任务是否被监视.
IsUnitOnQuest(questIndex, “unit”) - 确认指定对象是否在制定任务中.
QuestChooseRewardError - Throws an error when the quest choose reward method doesn’t work.
QuestLogPushQuest - 初始化当前任务日志中选中任务的共享.
RemoveQuestWatch(index) - 移除一个任务监视 (任务索引还是监视索引?).
SelectActiveQuest - 在 NPC 对话中选择一个激活的任务 (仅当 QUEST_GREETING 事件后有效).
SelectAvailableQuest - 在 NPC 对话中选择一个可用的任务 (仅当 QUEST_GREETING 事件后有效).
SelectQuestLogEntry - Sets the selected quest, required for most GetQuest functions.
SetAbandonQuest - 在 AbandonQuest 前调用.
界面 ToggleQuestLog - 打开/关闭任务日志.


团队函数 (Raid Functions)See also: Group Functions


ConvertToRaid() - Converts party to raid.
DemoteAssistant(“name”) - Demotes player from assistant status. Requires raid leadership.
GetNumRaidMembers() - Returns the number of raid members.
GetRaidRosterInfo(index) - Returns information about the members of your raid .
GetRaidRosterSelection - ?.
GetRaidTargetIndex(“unit”) - Get the raid target index assigned to a unit.
IsRaidLeader() - Returns a value based on whether the player is a raid leader
IsRaidOfficer() - Returns a value based on whether the player is a raid officer (assistant (?)).
PromoteToAssistant(“name”) - Promotes player to assistant status. Requires raid leadership.
RequestRaidInfo() - Returns information about which instances you are saved to
SetRaidRosterSelection(index) - ?.
SetRaidSubgroup(index, subgroup) - Move a raid member from his current subgroup into a different (non-full) subgroup.
SwapRaidSubgroup(index1, index2) - Swaps raid members into different groups
SetRaidTarget(“unit”, index) - Set the raid target index for a unit.
UninviteFromRaid(index) - Boots someone from a raid
UnitInRaid(“unit”) - Returns 1 if unit is in your raid, nil if not.


Security and Protection Functionsissecure() - Determine if the current environment is secure.
issecurevariable([table] ,name) - Determine if the specified variable is secure.
securecall(function or functionName, …) - Call a function from a secure environment without risking secure status.
hooksecurefunc([table], functionName, hookfunc) - Creates a secure ‘post hook’ for the named function. The hookfunc is invoked after the original function, and receives the same parameters. Return values from hookfunc are discarded. This is the only safe way to hook functions that execute protected functionality.
InCombatLockdown() - Returns true if the in-combat AddOn restrictions are active.


设置函数 (Settings Functions)


GetBaseMip() - Get the world appearance Texture Detail.
GetCVar(“varname”) - Get the current (active) setting for a variable in config.wtf
GetCVarDefault(“varname”)
GetCurrentMultisampleFormat() - Get the current in-use multi-sample (antialias) format.
GetCurrentResolution() - Get the index of the current screen resolution.
GetDoodadAnim() - ???
GetFarclip() - Get the world appearance Terrain Distance.
GetGamma()
GetMultisampleFormats() - Get the available multi-sample (antialias) formats…
GetRefreshRates(x)
GetScreenResolutions()
GetTerrainMip() - Get the world appearance Terrai
n Texture.
GetTexLodBias()
GetVideoCaps()
GetWaterDetail()
GetWorldDetail() - Get the world appearance Environment Detail.
HideFriendNameplates() - Turn off display of nameplates above friendly units. - (添加于 1.12)
HideNameplates() - Turn off display of nameplates.
RegisterCVar(“varname”[, value]) - Registers a variable for use with the GetCVar and SetCVar functions.
ResetPerformanceValues()
ResetTutorials()
SetBaseMip(value) - Set the world appearance Texture Detail (0,1).
SetCVar(“cvar”, value[, “scriptCVar”]) - Set the value of a variable in config.wtf
SetDoodadAnim() - ?.
SetEuropeanNumbers(flag) - Sets the decimal separator to a comma instead of a dot
SetFarclip(value) - Set the world appearance Terrain Distance (177-777).
SetGamma(value)
SetLayoutMode()
SetMultisampleFormat(index) - Set the multi-sample (antialias) format to use.
SetScreenResolution(x)
SetTerrainMip(value) - Set the world appearance Terrain Texture (0,1).
SetTexLodBias()
SetWaterDetail()
SetWorldDetail(value) - Set the world appearance Environment Detail (0,1,2).
ShowCloak(flag) - Set whether player’s cloak is displayed.
ShowFriendNameplates() - Turn on display of nameplates above friendly units. - (添加于 1.12)
ShowHelm(flag) - Set whether player’s helm is displayed.
ShowNameplates() - Turn on display of nameplates.
ShowingCloak() - Return 1 if player’s cloak is displayed, 否则为 nil.
ShowingHelm() - Return 1 if player’s helm is displayed, 否则为 nil.
ToggleCollision()
ToggleCollisionDisplay()
TogglePerformanceDisplay()
TogglePerformanceValues()
TogglePlayerBounds()
TogglePortals()
ToggleTris()
TutorialsEnabled()


技能函数 (Skill Functions)


CollapseSkillHeader(index)
ExpandSkillHeader(index)
GetAdjustedSkillPoints()
GetNumSkillLines() - get the number of lines in the skill window, including headers
GetSelectedSkill()
GetSkillLineInfo(index) - get the information for a selected skill


施法函数 (Spell Functions)spellID is the index of a spell in a spellbook. The indices increase from top to bottom, then left to right, then between categories (e.g.: General -> Discipline). spellIDs will change as players learn new spells and professions.


CastShapeshiftForm(index)
CastSpell(spellID, “bookType”) - Cast the specified spell by ID. spellbookTab is “spell” or “pet”.
CastSpellByName(“name”[, onSelf]) - Cast the specified spell by display name.
GetCraftSpellFocus(index) - ?.
GetNumShapeshiftForms()
GetNumSpellTabs() - Returns the total number of tabs in the user’s spellbook.
GetQuestLogRewardSpell - ?.
GetRewardSpell - ?.
GetShapeshiftFormCoo
ldown(index)
GetShapeshiftFormInfo(index) - Retrieves information about an available ShapeshiftForm or Stance.
GetSpellCooldown(spellID, “bookType”) - Retrieves data on the cooldown of a specific spell within your spellbook…
GetSpellName(spellID, “bookType”) - Returns the spell name and spell rank for a spell in the player’s spellbook.
GetSpellTabInfo(spellbookTabNum) - Returns information about the specified spellbook tab.
GetSpellTexture(spellID, “bookType”) - ?.
GetTrackingTexture() - Return the texture of the current tracking buff, if one is active.
IsCurrentCast(id, “bookType”)
IsSpellPassive(spellID, “bookType”) - Returns whether the icon in your spellbook is a Passive ability.
IsTrainerServiceLearnSpell(index)
PickupSpell(spellID, “bookType”) - Loads an action button onto the cursor to be dropped into a quickbar slot.
PlayerHasSpells() - ?.
SpellCanTargetUnit(“unit”) - Returns true if the spell awaiting target selection can be cast on the specified unit.
SpellIsTargeting() - Returns true if a spell has been cast and is awaiting target selection.
SpellStopCasting() - Stops the current spellcast. (As of 1.10 PTR, this function must be used in direct response to a hardware input event, such as a mouse click or key press.)
SpellStopTargeting() - Cancels the spell awaiting target selection.
SpellTargetUnit(“unit”) - Casts the spell awaiting target selection on the specified unit.
界面 ToggleSpellBook(“bookType”) - Shows the spellbook. Can show your spells or your pet’s.
UpdateSpells() - ?.


系统函数 (System Functions)


ConsoleExec(“command”) - Execute a console command.
GetBuildInfo() - Returns information about current client build.
界面 geterrorhandler()
GetFramerate() - Returns the current framerate (full precision)
GetGameTime - Returns the time in-game.
GetLocale() - 返回客户端的地区标识符,如 ‘enUS’ 。
GetCursorPosition() - Returns the cursor’s position on the screen.
GetNetStats() - Get bandwidth and latency network information.
GetRealmName() - returns the name of the server a user is logged in to
GetScreenHeight() - Returns the height of the window in pixels.
GetScreenWidth() - Returns the width of the window in pixels.
界面 GetText() - Used to localize some client text.
GetTime() - Returns the system uptime in seconds (millisecond precision).
InCinematic()
IsAltKeyDown() - Returns true if the alt key is currently depressed.
IsControlKeyDown() - Returns true if the control key is currently depressed.
IsLinuxClient() - Boolean - Returns true if WoW is being run on Linux
IsMacClient() - Checks client system
IsShiftKeyDown() - Returns true if the shift key is currently depressed.
IsWindowsClient() - Returns true if WoW is being run on Windows.
OpeningCinematic() - shows the opening movie for a
player’s race
PlayMusic() - Plays the specified mp3.
PlaySound() - Plays the specified built-in sound effect.
PlaySoundFile() - Plays the specified sound file.
ReloadUI() - Reloads the UI from source files
RepopMe() - The “Release Spirit” button. Sends you to the graveyard when dead. -Moof
RequestTimePlayed() - Request a summary of time played from the server.
RestartGx() - Restarts the graphical engine. Needed for things such as resolution changes to take effect.
RunScript(“script”) - Execute “script” as a block of LUA code.
Screenshot() - Takes a screenshot.
界面 SecondsToTime - Converts a number of seconds into a readable days / hours / etc. formatted string.
界面 seterrorhandler(function)
StopCinematic()
StopMusic() - Stops the currently playing mp3.
界面 UIParentLoadAddOn(“AddOnName”) - Loads or Reloads the specified AddOn, and pops up an error message if it fails to load for any reason.
界面 TakeScreenshot() - Takes a screenshot.
界面 _ERRORMESSAGE(value) - Displays the script error dialog with optional text
debuginfo() - Output win32 debug text. Freeware debug message viewer: DebugView (Has no effect on live server)
getglobal(“object”) - Given an object name will return the object itself.
界面 message(“text”) - Displays a message box with your text message and an “Okay” button.
setglobal(“object”, value) - set the global “object” to the given value.


天赋函数 (Talent Functions)


BuyTrainerService(index) - Used for buying new/upgrading professions, profession items and class skills.
CheckTalentMasterDist()
ConfirmTalentWipe()
GetNumTalentTabs() - return number of talent trees (usually 3)
GetNumTalents(tabIndex) - return number of talents in tree
GetTalentInfo(tabIndex,talentIndex) - return name, iconTexture, tier, column, rank, maxRank, isExceptional, meetsPrereq
GetTalentPrereqs(tabIndex,talentIndex) - return tier, column, isLearnable
GetTalentTabInfo(tabIndex) - return name, iconTexture, pointsSpent, background
IsTalentTrainer - ?.
LearnTalent(tabIndex,talentIndex)


目标函数 (Targetting Functions)


AssistByName(“playername”) - 协助指定名字玩家
AssistUnit(“unit”) - 协助指定的UnitId
AttackTarget() - - 攻击选中的目标
ClearTarget() - 清除已经选中的目标
ClickTargetTradeButton(index)
TargetByName(“name”[, exactMatch]) - 选中特定的单位为当前目标
TargetLastEnemy() - 选中上一次选中的敌人为当前目标
TargetLastTarget() - 选中上一次选中的目标为当前目标
TargetNearestEnemy([reverseFlag]) - 选中最近的敌人为当前目标
TargetNearestFriend() - 选中最
近的盟友为当前目标
TargetNearestPartyMember() - 选中最近的小队成员
TargetNearestRaidMember - 选中最近的团队成员
TargetUnit(“unit”) -选中指定的UnitId为当前目标

补充

这些目标函数都是 受保护的函数(PROTECTED)仅能在安全代码(secure code)中才能调用他们


Taxi Functions


CloseTaxiMap() - Closes the Flightpath Map.
DrawRouteLine(texture, canvas, startx, starty, endx, endy, width, relPoint) - Draws a line.
GetNumRoutes(slot) &nbsp - Gets the number of hops between current-slot and slot.
NumTaxiNodes() - Returns the number of nodes (flight paths) on an open taxi map.
SetTaxiMap(frame) - ?.
TakeTaxiNode(slot) - Takes the named taxi node.
TaxiNodeCost(slot) - Returns the cost in copper of a node.
TaxiNodeGetType(slot) - Returns the status of a node.
TaxiGetSrcX(slot, hop) - ?.
TaxiGetSrcY(slot, hop) - ?.
TaxiGetDestX(slot, hop) - ?.
TaxiGetDestY(slot, hop) - ?.
TaxiNodeSetCurrent(slot) - Renumbers slots based on new current slot.
TaxiNodeName(slot) - Returns the name of a node.
TaxiNodePosition(slot) - Returns position (x,y) of node on the map.
UnitOnTaxi(“unit”) - Returns 1 if unit is on a taxi.


系统界面函数 (Toggle Functions)


界面 ToggleBackpack() - Toggles your backpack open/closed.
界面 ToggleBag(bagID) - Opens or closes the specified bag.
界面 ToggleCharacter(index) - Toggles the character pane to the specified frame.
界面 ToggleCombatLog - Opens/closes the combat log.
界面 ToggleFramerate - Show/Hide the FPS.
界面 ToggleFriendsFrame([tabNumber]) - Opens/closes the friends pane (possibly on a specific tab).
界面 ToggleGameMenu - Opens/closes the game menu.
界面 ToggleHelpFrame - Opens the Help Request frame.
界面 ToggleKeyRing - Opens/closes the key ring.
界面 ToggleMinimap - Turns the minimap display on/off.
界面 ToggleQuestLog - Opens/closes the quest log.
界面 ToggleSpellBook(“bookType”) - Shows the spellbook. Can show your spells or your pet’s.
界面 ToggleTalentFrame - Opens the Talent frame.
界面 ToggleWorldMap - Turns the world map on/off.


商业技能函数 (TradeSkill Functions)


CloseTradeSkill() - 关闭商业技能窗口.
CollapseTradeSkillSubClass(index) - 折叠某可制造物品列表.
DoTradeSkill(index[, repeatTimes]) - 使用某号商业技能若干次.
ExpandTradeSkillSubClass(index) - 展开某可制造物品列表.
GetFirstTradeSkill() - 返
回第一商业技能.
GetNumTradeSkills() -返回商业技能的数量(含条目).
GetTradeSkillCooldown(index) - 取得某商业技能的cd时间.
GetTradeSkillIcon(index) - 取得某商业技能的图标信息.
GetTradeSkillInfo(index) - 取得某商业技能的详细信息.
GetTradeSkillInvSlotFilter(slotIndex) - Returns 1 if items corresponding to slotIndex are currently visible, otherwise nil.
GetTradeSkillInvSlots() - Returns a list of the available inventory slot types.
GetTradeSkillItemLink(index) - 取得某商业技能可以生产的物品连接.
GetTradeSkillItemStats(index) - Returns information about the item produced.
GetTradeSkillLine() - Returns information about the selected skill line.
GetTradeSkillNumMade(index) - 返回某商业技能可以制造的物品数量.
GetTradeSkillNumReagents(tradeSkillRecipeId) - 获得某号商业技能需要的原料种类.
GetTradeSkillReagentInfo(tradeSkillRecipeId, reagentId) - 返回某号商业技能的某个原料的数据信息(含玩家拥有该材料的数据)
GetTradeSkillReagentItemLink(index, reagentId) - Returns the itemLink for one of the reagents needed to craft the given item
GetTradeSkillSelectionIndex() - Returns the Id of the currently selected trade skill, 0 if none selected.
GetTradeSkillSubClassFilter(filterIndex) - Returns 1 if items corresponding to filterIndex are currently visible, otherwise nil.
GetTradeSkillSubClasses() - Returns a list of the valid subclasses.
GetTradeSkillTools(index) - Returns information about the tools needed for a tradeskill.
GetTradeskillRepeatCount() - ?.
IsTradeskillTrainer() - Returns 1 if trainer is for a tradeskill.
IsTrainerServiceTradeSkill() - ?.
SelectTradeSkill(index) - Select a specific trade skill in the list.
SetTradeSkillInvSlotFilter(slotIndex, onOff[, exclusive] ) - Set the inventory slot type filter.
SetTradeSkillSubClassFilter(slotIndex, onOff[,exclusive] ) - Set the subclass filter.


交易函数 (Trading Functions)


AcceptTrade() - A pending trade will be accepted.
AddTradeMoney() - Adds the money dropped into the player’s trade frame.
BeginTrade() - Begins the trade with the target.
CancelTrade() - Declines the offer to trade with the other player.
CancelTradeAccept - Cancels the trade attempt which required an accept.
ClickTargetTradeButton(index)
ClickTradeButton(index) - Equivalent of a mouseclick on the trade window buttons [1-7]
CloseTrade() - Closes the trade.
GetPlayerTradeMoney - Returns the amount of money the player has in the trade window.
GetTargetTradeMoney - Returns the amount of money in the trade frame of the target player.
GetTradePlayerItemInfo(id) - Returns information about a trade item.
GetTradePlayerItemLink(id) - Returns an itemLink for the given item in your side of the trade
window (if open)
GetTradeTargetItemInfo(id) - Returns information about a trade item.
GetTradeTargetItemLink(id) - Returns an itemLink for the given item in the other player’s side of the trade window (if open)
InitiateTrade(UnitId) - Asks the specified unit to trade.
PickupPlayerMoney - Picks up an amount of money from the player.
PickupTradeMoney(amount)
ReplaceTradeEnchant() - Confirm the replacement of an enchantment via trade.
SetTradeMoney(amount)


训练函数 (Training Functions)


BuyTrainerService(index) - Used for buying new/upgrading professions, profession items and class skills.
CloseTrainer() - Closes the trainer window.
CollapseTrainerSkillLine(index) - Collapses a header, hiding all spells below it.
ExpandTrainerSkillLine(index) - Expands a header, showing all spells below it.
GetNumTrainerServices() - Get the number of the trainer services.
GetTrainerGreetingText() - Get the trainer’s greeting text.
GetTrainerSelectionIndex() - Get the index of the selected trainer service.
GetTrainerServiceAbilityReq(trainerIndex,reqIndex) - Used for displaying the requirements to learn a new profession, profession skill or class skill.
GetTrainerServiceCost(index) - Returns the cost of a specific trainer service.
GetTrainerServiceDescription(index) - Returns the description of a specific trainer service.
GetTrainerServiceIcon(index) - Returns icon texture for a trainer service.
GetTrainerServiceInfo(index) - Returns information about a trainer service.
GetTrainerServiceLevelReq(index) - Get the required level to learn the skill.
GetTrainerServiceNumAbilityReq - Get the maximum number of requirements that GetTrainerServiceAbilityReq() has.
GetTrainerServiceSkillLine - ?.
GetTrainerServiceSkillReq(index) - Returns a String and Variable for the requirements of a specific trainer service.
GetTrainerServiceStepIncrease() - ?.
GetTrainerServiceStepReq - ?.
GetTrainerServiceTypeFilter(“filter”) - Returns the status of a skill filter in the trainer window.
GetTrainerSkillLineFilter() - ?;
GetTrainerSkillLines() - ?;
IsTalentTrainer - ?.
IsTradeskillTrainer() - Returns 1 if trainer is for a tradeskill.
IsTrainerServiceLearnSpell(index)
IsTrainerServiceSkillStep() - ?.
IsTrainerServiceTradeSkill() - ?.
OpenTrainer() - ?.
SelectTrainerService - ?.
SetTrainerServiceTypeFilter(“filter”,state) - Sets the status of a skill filter in the trainer window.
SetTrainerSkillLineFilter() - ?.


Uncategorized FunctionsAdd functions whose group is not clear to this section, please remember to follow the Example Function template!


PartialPlayTime()
NoPlayTime()
GetBilli
ngTimeRested()
GetMinigameState()
GetMinigameType()


对象函数 (Unit Functions)These are functions which act on one or more units. Units are identified by UnitIds. 这些是某个或某些单位(对象)行为的函数.Unit跟UnitId是不同的.


AssistUnit(“unit”) - Instructs your character to assist the specified unit. --协助指定单位
CheckInteractDistance(“unit”,distIndex) --测试与指定单位的距离
DropItemOnUnit(“unit”) - Drops an item from the cursor onto a unit. --对指定单位使用选定物品
FollowUnit(“unit”) - Follow an ally with the specified UnitID --跟随指定单位
InviteToParty(“unit”) - Invite a unit to a party by its unit id (likely “target”) --邀请指定单位加入小队
IsUnitOnQuest(questIndex, “unit”) - Determine if the specified unit is on the given quest. --判断指定单位是否有此任务
SpellCanTargetUnit(“unit”) - Returns true if the spell awaiting target selection can be cast on the specified unit. --判断是否能对指定单位使用技能
SpellTargetUnit(“unit”) - Casts the spell awaiting target selection on the specified unit. --对指定单位使用选定技能
StartDuelUnit(“unit”) - Challenge a unit to a duel. --对指定单位发出决斗邀请
TargetUnit(“unit”) - Selects the specified unit as the current target. --选择指定单位作为当前目标
UnitAffectingCombat(“unit”) - Determine if the unit is in combat or has aggro. (returns nil if “false” and 1 if “true”) --判断指定单位是否在战斗状态
UnitArmor(“unit”) - Returns the armor statistics relevant to the specified unit. --返回指定单位的护甲值
UnitAttackBothHands(“unit”) - Returns information about the unit’s melee attacks. --返回指定单位的近战攻击技能等级
UnitAttackPower(“unit”) - Returns the unit’s melee attack power and modifiers. --返回指定单位的近战攻击强度
UnitAttackSpeed(“unit”) - Returns the unit’s melee attack speed for each hand. --返回指定单位主副手的近战攻击速度
UnitBuff(“unit”, index[, showCastable]) - Retrieves info about a buff of a certain unit. --返回指定单位身上指定编号的Buff信息( [, showCastable]可以不填,填0或者1.为1那么只返回玩家可以释放的Buff的信息)
UnitCanAssist(“unit”, “otherUnit”) - Returns true if the first unit can assist the second, false otherwise. --指定两个单位,判断第一单位能否协助第二单位
UnitCanAttack(“unit”, “otherUnit”) - Returns true if the first unit can attack the second, false otherwise. --指定两个单位,判断第一单位能否攻击第二单位
UnitCanCooperate(“unit”, “otherUnit”) - Returns true if the first unit can cooperate with the second, false otherwise. --指定两个单位,判断两个单位能否组队
UnitCharacterPoints(“unit”) - Returns the numbe
r of unspent talent points for the specified unit – usually 0. --返回指定单位的剩余天赋点数
UnitClass(“unit”) - Returns the class name of the specified unit (e.g., “Warrior” or “Shaman”). --返回指定单位的职业(例如:圣骑士,萨满祭祀)
UnitClassification(“unit”) - Returns the classification of the specified unit (e.g., “elite” or “worldboss”). --返回指定单位的厉害程度(例如:精英,世界BOSS)
UnitCreatureFamily(“unit”) - Returns the type of creature of the specified unit (e.g., “Crab”). --返回指定单位的物种(例如:螃蟹)
UnitCreatureType(“unit”) - Returns the classification type of creature of the specified unit (e.g., “Beast”). --返回指定单位的物种分类(例如:野兽)
UnitDamage(“unit”) - Returns the damage statistics relevant to the specified unit. --返回指定单位的伤害值
UnitDebuff(“unit”, index[, showDispellable]) - Retrieves info about a debuff of a certain unit. --返回指定单位身上指定编号的DeBuff信息( [, showDispellable]可以不填,填0或者1.为1则只返回玩家可以清除的DeBuff的信息)
UnitDefense(“unit”) - Returns the base defense skill of the specified unit. --返回指定单位的基础防御技能等级
UnitExists(“unit”) - Returns true if the specified unit exists, false otherwise. --判断指定单位是否在游戏中
UnitFactionGroup(“unit”) - Returns the faction group id and name of the specified unit. (eg. “Alliance”) - string returned is localization-independent (used in filepath) --返回指定单位的阵营(例如:联盟)
UnitHealth(“unit”) - Returns the current health, in points, of the specified unit. --返回指定单位的当前生命值
UnitHealthMax(“unit”) - Returns the maximum health, in points, of the specified unit. --返回指定单位的最大生命值
UnitInParty(“unit”) - Returns true if the unit is a member of your party. --判断指定单位是否在队伍中
UnitInRaid(“unit”) - Returns 1 if unit is in your raid, nil if not. --判断指定单位是否在团队中
UnitIsCharmed(“unit”) - Returns true if the specified unit is charmed, false otherwise. --判断指定单位是否同一个阵营
UnitIsCivilian(“unit”) - Returns true if the unit is a civilian NPC. --判断指定单位是否平民
UnitIsConnected(“unit”) - Returns 1 if the specified unit is connected or npc, nil if offline or not a valid unit. --判断指定单位是否在线
UnitIsCorpse(“unit”) - Returns true if the specified unit is a corpse, false otherwise. --判断指定单位是否尸体
UnitIsDead(“unit”) - Returns true if the specified unit is dead, nil if not. --判断指定单位是否死亡
UnitIsDeadOrGhost(“unit”) - Returns true if the specified unit is dead or a ghost, nil if not. --判断指定单位是否死亡或灵魂状态
UnitIsEnemy(“unit”, “otherUnit”) - Returns true if the specified units are enemies, false otherwise. --指定两个单位,判断两个单位是否敌对
UnitIsFriend(“unit”, “otherUnit”) - Returns
true if the specified units are friends (PC of same faction or friendly NPC), false otherwise. --指定两个单位,判断两个单位是否友好
UnitIsGhost(“unit”) - Returns true if the specified unit is a ghost, false otherwise. --判断指定单位是否灵魂状态
UnitIsPVP(“unit”) - Returns true if the specified unit is flagged for PVP, false otherwise. --判断指定单位是否PVP状态
UnitIsPVPFreeForAll(“unit”) - Returns true if the specified unit is flagged for free-for-all PVP, false otherwise. --判断指定单位是否自由PVP状态
UnitIsPartyLeader(“unit”) - Returns true if the unit is the leader of its party. --判断指定单位是否队长
UnitIsPlayer(“unit”) - Returns true if the specified unit is a player character, false otherwise. --判断指定单位是否玩家
UnitIsPlusMob(“unit”) - Returns true if the specified unit is a mob, more powerful than its nominal level, false otherwise (e.g., “elite” mobs) --判断指定单位是否比普通怪厉害(例如:精英)
UnitIsTapped(“unit”) - Returns true if the specified unit is tapped, false otherwise. --判断指定单位是否已被攻击
UnitIsTappedByPlayer(“unit”) - Returns true if the specified unit is tapped by the player himself, otherwise false. --判断指定单位是否已被其他玩家攻击
UnitIsTrivial(“unit”) - Returns true if the specified unit is trivial (Trivial means the unit is “grey” to the player. false otherwise. --判断指定单位是否无价值(灰色物品)
UnitIsUnit(“unit”, “otherUnit”) - Determine if two units are the same unit. --指定两个单位,判断两个单位是否相同单位
UnitIsVisible(“unit”) - 1 if visible, nil if not --判断指定单位是否能被看见(潜行,隐形)
UnitLevel(“unit”) - Returns the level of a unit. --返回指定单位等级
UnitMana(“unit”) - Returns the current mana (or energy,rage,etc), in points, of the specified unit. --返回指定单位能量值(包括魔法值,怒气值,能量值)
UnitManaMax(“unit”) - Returns the maximum mana (or energy,rage,etc), in points, of the specified unit. --返回指定单位最大能量值
UnitName(“unit”) - Returns the name (and realm name) of a unit. --返回指定单位名字
UnitOnTaxi(“unit”) - Returns 1 if unit is on a taxi. --判断指定单位是否骑乘状态
UnitPlayerControlled(“unit”) - Returns true if the specified unit is controlled by a player, false otherwise. --判断指定单位是否被玩家控制中
UnitPlayerOrPetInParty(“unit”) - Returns 1 if the specified unit/pet is a member of the player’s party, nil if not (returns 1 for “player” and “pet”) - Added in 1.12 --判断指定单位是否同一队伍中的玩家或玩家宠物
UnitPlayerOrPetInRaid(“unit”) - Returns 1 if the specified unit/pet is a member of the player’s raid, nil if not (returns 1 for “player” and “pet”) - Added in 1.12 --判断指定单位是否同一团队中的玩家或玩家宠物
UnitPVPName(“unit”) - Returns unit’s name with PvP rank prefix (e.g., “Corpor
al Allianceguy”). --返回指定单位军衔(例如:联盟元帅)
UnitPVPRank(“unit”) - Get PvP rank information for requested unit. --返回指定单位军衔等级
UnitPowerType(“unit”) - Returns a number corresponding to the power type (e.g., mana, rage or energy) of the specified unit. --返回指定单位的能量类别(例如:魔法,怒气,能量)
UnitRace(“unit”) - Returns the race name of the specified unit (e.g., “Human” or “Troll”). --返回指定单位的种族(例如:人类,巨魔)
UnitRangedAttack(“unit”) - Returns the ranged attack number of the unit. --返回指定单位的远程攻击技能等级
UnitRangedAttackPower(“unit”) - Returns the ranged attack power of the unit. --返回指定单位的远程攻击强度
UnitRangedDamage(“unit”) - Returns the ranged attack speed and damage of the unit. --返回指定单位的远程伤害值
UnitReaction(“unit”, “otherUnit”) - Returns a number corresponding to the reaction (aggressive, neutral or friendly) of the first unit towards the second unit. --指定两个单位,判断两个单位的关系(例如:中立,友好,敌对)
UnitResistance(“unit”, “resistanceIndex”) - Returns the resistance statistics relevant to the specified unit and resistance type. --返回指定单位指定魔法抗性的抗性值
UnitSex(“unit”) - Returns a code indicating the gender of the specified unit, if known. (1=unknown, 2=male, 3=female) ← changed in 1.11! --返回指定单位的性别
UnitStat(“unit”, statIndex) - Returns the statistics relevant to the specified unit and basic attribute (e.g., strength or intellect). --返回指定单位指定基础属性的属性值
UnitXP(“unit”) - Returns the number of experience points the specified unit has in their current level. (only works on your player) --返回指定单位的当前经验值(只能作用于你自己)
UnitXPMax(“unit”) - Returns the number of experience points the specified unit needs to reach their next level. (only works on your player) --返回指定单位到下个等级需要的经验值(只能作用于你自己)
SetPortraitTexture(texture,“unit”) - Paint a Texture object with the specified unit’s portrait. --为指定单位设置一个纹理
SetPortraitToTexture(“texture”, icon) - Paint a Texture object with the given Texture ? --为指定纹理设置一个纹理?


查询函数 (Who Functions)


GetNumWhoResults() - Return the number of entries resulting from your most recent /who query.
GetWhoInfo(index)
SendWho(“filter”) - Send a who request to the server.
SetWhoToUI(toUIFlag) - Indicate that who request results should be delivered as WHO_LIST_UPDATE instead of to chat.
SortWho(sortType) - Sorts an existing /who list; displays the Who List frame if not visible.

标签:返回,index,魔兽,--,世界,Returns,API,specified,unit
来源: https://blog.csdn.net/qq_18882253/article/details/117822181