2、玩家的动作有可能通过下面列表中的函数执行)。保护界面ActionButtonDown(id)-按下指定动作按钮。保护界面ActionButtonUp(id)-释放指定动作按钮。ActionHasRange(slot)-检测指定动作按钮是否受距离限制(是则返回1,否则返回nil)。界面BonusActionButtonDown-触发指定额外动作按钮(宠物或仆从)。界面BonusActionButtonUp-释放指定额外动作按钮(宠物或仆从)。保护CameraOrSelectOrMoveStart()-在3D界面开始左键单击动作。(1.10-保护)保护Camera
3、OrSelectOrMoveStop(stickyFlag)-在3D界面结束左键单击动作。(1.10-保护)ChangeActionBarPage()-更改系统动作按钮页面为系统变量CURRENT_ACTIONBAR_PAGE指定页。GetActionBarToggles()-获取系统动作条显示状况。GetActionCooldown(slot)-获取指定动作按钮冷却状况。GetActionCount(slot)-获取动作按钮所需物品剩余量(绷带/毒药/等),无物品或不可用时返回0。GetActionText(slot)-获取动作按钮文本标签(宏,等),不存在
4、则返回nil。GetActionTexture(slot)-获取指定动作按钮材质路径。GetBonusBarOffset()-检测何种额外动作条已显示。HasAction(slot)-假如指定动作条按钮有技能执行,则返回1,其他情况返回nil。IsActionInRange(slot)-测试技能是否在施展距离内(1=是,0=否,nil=不可用)。IsAttackAction(slot)-技能为“攻击”动作则返回1(战斗中闪光),其他情况返回nil。IsAutoRepeatAction(slot)-技能可自动重复时返回1,其他情况返回nil。IsCurrentAct
5、ion(slot)-技能动作正在执行时返回1,其他情况返回nil。IsUsableAction(slot)-技能可立即执行时返回1,其他情况返回nil。IsConsumableAction(slot)-技能有施展次数时返回1(例如:施法物品),其他情况返回nil。IsEquippedAction(slot)-必须装备才能施展的技能返回1(例如:链接到必须装备的物品),其他情况返回nil。PetHasActionBar()-检测玩家宠物是否有动作条。PickupAction(slot)-将指定动作按钮的技能提取并放置于光标上。PickupPetAction(slot)
6、-将指定的宠物动作按钮的技能提取并放置于光标上。PlaceAction(slot)-将鼠标上的技能放置于指定动作按钮。SetActionBarToggles(show1,show2,show3,show4,alwaysShow)-设置指定系统动作条显示。-1.12版本添加alwaysShow。保护TurnOrActionStart()-在3D界面开始右键单击动作。(1.10-保护)保护TurnOrActionStop()-在3D界面结束右键单击动作。(1.10-保护)保护UseAction(slot,checkCursor,onSelf)-执行
7、绑定到指定ID的动作按钮技能,可定向玩家(与目标无关)。-行为函数(ActivityFunctions)这个部分的函数会引发玩家角色的动作(未在别处加以保护,非简单确认步骤)AcceptDuel()-玩家同意接受决斗挑战.保护AttackTarget()-攻击选定目标.CancelDuel()-拒绝决斗挑战.CancelLogout()CancelMeetingStoneRequest()-将角色从集合石队列中移除ClearTutorials()ConfirmSummon()保护DescendStop()-增加于2.1Dismount()-增加于2.0.3FlagTu
8、torial(tutotial)保护ForceLogout()ForceQuit()GetSummonConfirmAreaName()GetSummonConfirmSummoner()GetSummonConfirmTimeLeft()Logout-注销当前玩家角色.Quit-退出应用程序(游戏),而非LUA脚本.RandomRoll(low,high)-随机产生在两个(正整数)数值闭区间的整数.保护SitStandOrDescendStart()-切换玩家坐下/站立姿势.保护StartDuel(name)-向玩家发出决斗邀请(根据名字)TogglePVP()-
9、切换PVP状态ToggleSheath()-拔出/收起武器.UseSoulstone()-使用激活的灵魂石复活自己.-插件函数(AddOnFunctions)DisableAddOn(indexorAddOnName)-禁止某插件下次载入.DisableAllAddOns()-禁止所有插件下次被载入.EnableAddOn(indexorAddOnName)-在下次进程开启指定插件.EnableAllAddOns()-在下次进程开启全部插件.GetAddOnDependencies(indexorAddOnName)-取得插件依赖列表.GetAdd
11、)-竞技场函数(ArenaFunctions)ArenaTeamInviteByName(teamIndex,playerName)-Invitesthespecifiedplayertothespecifiedarenateam.ArenaTeamLeave(teamIndex)-Leavesthespecifiedarenateam.ArenaTeamRoster(teamIndex)-Sendsarequesttotheservertorequestthemostrecentinformationonaspecific
12、ArenaTeamthatyouarein.ArenaTeamUninviteByName(teamIndex,playerName)-Removesthespecifiedplayedfromthespecifiedarenateam.ArenaTeamDisband(teamIndex)-Disbandsthearenateamwithoutanywarning!Requiresyoutobetheleaderoftheteam.(Knowntobeimplementedasof2.1.3,butmay
13、haveexistedbefore).GetArenaCurrency()-Getstheamountofarenapointsaplayercurrentlyhastospend.GetArenaTeam(teamIndex)-Returnsinformationregardingtheplayersarenateam,niliftheplayerisnotinthepassedteamGetArenaTeamRosterInfo(teamIndex,playerIndex)-Returnsinformation
14、regardingaplayerfromthespecifiedteam,thisrequiresacalltoArenaTeamRosteryouonlyneedtodothiswhentheplayerloginsin,UIreloadswillnoteffectthereturn.GetNumArenaTeamMembers(teamIndex,showOffline)-Getsthenumberofarenateammembers,thisrequiresacalltoArenaTeamRoste
15、ryouonlyneedtodothiswhentheplayerloginsin,UIreloadswillnoteffectthereturn.GetBattlefieldTeamInfo(index)-GetsinfoaboutaregisteredArenaTeamattheendofanarenamatch.GetCurrentArenaSeason()-GetsthecurrentArenaseason.IsActiveBattlefieldArena()-Returnstrueifinan
16、ArenaMatch,alsoReturnstrueforthesecondargumentifitsaregisteredmatch.IsArenaTeamCaptain(teamIndex)-Returnsavaluebasedonwhethertheplayeristhearenateamcaptain.IsBattlefieldArena()-Returnstrueifthebattlemasteryouretalkingtocanqueueyouforarenas-拍卖函数(AuctionFuncti
18、culateAuctionDeposit).GetAuctionInvTypes(classIndex,subclassIndex)-返回物品的子类.GetAuctionItemClasses()-返回拍卖物品的主分类.GetAuctionItemInfo(type,index)-返回指定拍卖物品细节.GetAuctionItemLink(type,index)-返回指定拍卖物品的itemLink.GetAuctionItemSubClasses(classIndex)-返回拍卖物品种类次序的子类.GetAuctionItemTimeLeft(type,ind
20、时返回1,否则为nil.PlaceAuctionBid(type,index,bid)-对选择拍卖物品投标.QueryAuctionItems(name,minLevel,maxLevel,invTypeIndex,classIndex,subclassIndex,page,isUsable,qualityIndex)-(请求检索符合条件的物品).SetSelectedAuctionItem(type,index)-.SortAuctionItems(type,sort)-根据指定分栏对指定拍卖列表进行排序.StartAuction(minBid,
22、志.PurchaseSlot()-购买一个空余的银行包裹位置.-战场函数(BattlefieldFunctions)AcceptAreaSpiritHeal()-接受灵魂治疗.CancelAreaSpiritHeal()-取消灵魂治疗.CanJoinBattlefieldAsGroup()-玩家不能加入战场团队则返回nil.AcceptBattlefieldPort(index,acceptFlag)-接受或拒绝一个传送至战场的请求.CheckSpiritHealerDist()-死亡时如果你在精神医者复活的范围内,返回true.CloseBattlefie
26、fieldFlagPositions()-GetthenumberofflagpositionsavailablefromGetBattlefieldFlagPosition().GetNumBattlefieldPositions()-GetthenumberofpositionsavailablefromGetBattlefieldPosition().GetNumBattlefieldScores()-Returnsthenumberofscores(players)listedinthebattlefieldscoreboar
27、d.GetNumBattlefieldStats()-Getthenumberofbattlegroundspecificcolumns.GetNumBattlefields()-Getthenumberofrunningbattlefieldsforthelastbattlegroundqueuewindowyouopened.GetNumWorldStateUI()-获取世界状态的UI数量GetSelectedBattlefield()-Gettheselectedbattlefieldtojoinfirst.GetWor
28、ldStateUIInfo(i)-Getscoreandflagstatuswithinabattlefield.JoinBattlefield(index,joinAs)-加入战场队列.LeaveBattlefield()-离开战场.ReportPlayerIsPVPAFK(unit)-获取当前战场中的一玩家是否AFKRequestBattlefieldPositions()-RequestnewdataforGetBattlefieldPosition().RequestBattlefieldScoreData()-Requestnew
29、dataforGetBattlefieldScore().SetBattlefieldScoreFaction(faction)-Setthefactiontoshowonthebattlefieldscoreboard.SetSelectedBattlefield(index)-Selectthebattlefieldinstanceyouwanttojoinorthefirstonethatbecomesavailable.ShowBattlefieldList(index)-Displaysaqueuewindow
30、forthespecifiedbattlefield.Onlyworksifyouarealreadyinaqueueforthebattlefield.Indexcorrespondstolocationinqueuearray.-绑定函数(BindingFunctions)移除GetActionSelfCastKey()-移除GetAutoLootToggleKey()-GetBinding(index)-获取索引的动作和快捷键.GetBindingAction(KEY,checkOverride)-获取绑定该键的动作.GetBi
31、ndingKey(command)-获取该动作绑定的键.界面GetBindingText(key,prefix,returnAbbr)-获取键值字串.GetCurrentBindingSet()-查询当前快捷键设置是否为指定帐号/角色.GetNumBindings()-获取总快捷键数与标题.LoadBindings(which)-读取默认/帐号/角色的特定快捷键配置.RunBinding(command,up)-运行名为command的快捷键移除SetActionSelfCastKey(SHIFTorCTRLorALT)-移除SetAutoLootTo
32、ggleKey(SHIFTorCTRLorALT)-SaveBindings(which)-保存帐号或角色键配置.SetBinding(key,command)-设置或取消键绑定.(2.0-不能在战斗中使用.)SetBindingSpell(KEY,SpellName)-设置绑定键到技能,与/cast使用技能一样.SetBindingClick(KEY,ButtonName,mouseButton)-设置绑定键到按钮对象.绑定鼠标时,按键按下时发生鼠标点击事件,释放时发生鼠标up.SetBindingItem(KEY,itemname)
33、-SetBindingMacro(KEY,macroname|macroid)-SetConsoleKey(key)-设置控制台键(通常).SetOverrideBinding(owner,isPriority,KEY,COMMAND)-设置/清除重复绑定键.SetOverrideBindingSpell(owner,isPriority,KEY,spellname)-SetOverrideBindingClick(owner,isPriority,KEY,ButtoName,mouseButton)-SetOverrideBindingItem(own
34、er,isPriority,KEY,itemname)-SetOverrideBindingMacro(owner,isPriority,KEY,macroname|macroid)-ClearOverrideBindings(owner)-重置全部重复值.SetMouselookOverrideBinding(KEY,COMMAND)-IsModifierKeyDown()-等价于(IsShiftKeyDown()或IsControlKeyDown()或IsAltKeyDown().IsModifiedClick(action)-绑定该动作按钮按下返回
35、1,否则nil.IsMouseButtonDown(buttonorbutton)-增减益函数(Buff/DebuffFunctions)请勿混淆buffId和buffIndex,这是不同概念!CancelPlayerBuff(buffIndex)-从玩家身上移除特定增益.CancelTrackingBuff()-取消当前追踪增益(追踪矿物等.)GetPlayerBuff(buffId,buffFilter)-获取特定效果信息(有益,有害或被动)GetPlayerBuffApplications(buffIndex)-获取特定增益/减益的叠加数.GetPl
37、CameraFunctions)下列API仅对鼠标观察模式提供的按下右键和控制移动方向功能.不支持按下鼠标左键切换视角.保护CameraOrSelectOrMoveStart()-BeginLeftclickinthe3Dworld.(1.10-保护)保护CameraOrSelectOrMoveStop(stickyFlag)-EndLeftclickinthe3Dworld.(1.10-Protected)CameraZoomIn(increment)-Zoomsthecameraintotheviewplanebyincr
38、ement.CameraZoomOut(increment)-Zoomsthecameraoutoftheviewplanebyincrement.FlipCameraYaw(degrees)-在Z轴旋转指定角度.IsMouselooking()-鼠标观察激活时返回1,否则为nil.MouselookStart()MouselookStop()MoveViewDownStart()-镜头向下旋转.MoveViewDownStop()-停止调用MoveViewDownStart()旋转的镜头.MoveViewInStart()-Beginszo
39、omingthecamerain.MoveViewInStop()-StopszoomingthecamerainafterMoveViewInStart()iscalled.MoveViewLeftStart()-BeginsrotatingthecameratotheLeft.MoveViewLeftStop()-StopsrotatingthecameraafterMoveViewLeftStart()iscalled.MoveViewOutStart()-Beginszoomingthecameraout.Mo
40、veViewOutStop()-StopszoomingthecameraoutafterMoveViewOutStart()iscalled.MoveViewRightStart()-BeginsrotatingthecameratotheRight.MoveViewRightStop()-StopsrotatingthecameraafterMoveViewRightStart()iscalled.MoveViewUpStart()-镜头向上旋转.MoveViewUpStop()-停止调用MoveViewUpStart()
41、旋转的镜头.保护PitchDownStart()-BeginspitchingthecameraDownward.保护PitchDownStop()-StopspitchingthecameraafterPitchDownStart()iscalled.保护PitchUpStart()-BeginspitchingthecameraUpward.保护PitchUpStop()-StopspitchingthecameraafterPitchUpStart()iscalled.NextView()-Cyclesforwardth
42、roughthefivepredefinedcamerapositions.PrevView()-Cyclesbackwardthroughthefivepredefinedcamerapositions.ResetView(index)-Resetsthespecified(1-5)predefinedcamerapositiontoitsdefaultifitwaschangedusingSaveView(index).SaveView(index)-Replacesthespecified(1-5)predefin
43、edcamerapositionswiththecurrentcameraposition.SetView(index)-Setscamerapositiontoaspecified(1-5)predefinedcameraposition.-频道函数(ChannelFunctions)这些是针对聊天频道的函数.同时参看聊天窗口函数(ChatWindowFunctions)和通信函数(CommunicationFunctions)部分.AddChatWindowChannel(chatFrameIndex,channel)-在指定窗口打开
44、频道.ChannelBan(channel,name)-在指定频道屏蔽一名玩家.ChannelInvite(channel,name)-邀请指定玩家到频道中.ChannelKick(channel,name)-从频道中剔除指定玩家.ChannelModerate(channel)-开启频道管理指令,如ChannelKick/Ban等.ChannelModerator(channel,name)-设置指定玩家为频道管理员.ChannelMute(channel,name)-禁止指定玩家在频道中发言.ChannelToggleAnnouncements(ch
45、annel)-切换频道显示/隐藏叫喊.ChannelUnban(channel,name)-解除屏蔽玩家.ChannelUnmoderator(channel,name)-解除频道管理员.ChannelUnmute(channel,name)-允许指定玩家发言.DisplayChannelOwner(channel)-在默认聊天中显示特殊频道主人.EnumerateServerChannels()-获取全部有效的服务频道(区域依赖).GetChannelList()-获取已加入的频道列表.GetChannelName(channelorindex)-
46、获取指定频道名称.GetChatWindowChannels(index)-获取聊天窗口的频道名称列表.JoinChannelByName(channel,password,frameId)-加入指定频道(可选密码和框架标识)(更新于1.9)LeaveChannelByName(channel)-离开指定频道.ListChannelByName(channelMatch)-在聊天窗口显示指定频道的成员.ListChannels()-在聊天窗口中列出全部频道.RemoveChatWindowChannel(chatFrameIndex,channel)-创建隐藏频
47、道(不可见).SendChatMessage(text,type,language,targetPlayer,.)-发送聊天信息.SetChannelOwner(channel,name)-设置频道主人.SetChannelPassword(channel,password)-更改当前频道密码.-角色函数(CharacterFunctions)AbandonSkill(index)-玩家忘却技能.AcceptResurrect()-接受他人复活.AcceptSkillUps()AcceptXPLoss()-接受灵魂使者复活时的损失.AddSkillUp
48、(index)BuySkillTier(index)CancelSkillUps()CheckBinderDist()-检测玩家是否在炉石绑定指令距离.ConfirmBinder()-确认炉石绑定请求.DeclineResurrect()-拒绝他人复活.GetBindLocation()-获取炉石绑定区域名称.GetBlockChance()-获取玩家格挡几率.GetCombatRating()-获取玩家战斗频度.TBC新增GetCombatRatingBonus()-获取玩家战斗奖励频度.TBC新增GetComboPoints()-获取当前连击点.Ge
50、ation()-GetRestState()-获取休息状态.GetSpellBonusDamage(spellTreeID)-GetSpellBonusHealing()-GetSpellCritChance(school)-GetTimeToWellRested()-Defunct.GetTitleName(index)-获取玩家当前标题名称.GetXPExhaustion()-获取角色当前休息经验奖励,没有奖励返回nil.HasFullControl()HasSoulstone()-(获取是否灵魂绑定.)IsFlying()-IsIndoors-返回1为在
51、室内.返回nil值则在室内,你可以使用坐骑.IsMounted-坐骑状态返回1否则为nil值.IsOutdoors-返回1为室外,否则为nil.返回1为室内可以使用坐骑IsResting()-(获取是否处在休息状态.)IsStealthed()-如果为潜行或影遁返回1,否则为nilIsSwimming()-IsTitleKnown(index)-若玩家的称为是有效值返回1,否则为nil值NotWhileDeadError()-生成一个内容为“你已死亡,无法这样进行这项动作”的错误信息.RemoveSkillUp(index)ResurrectHasSickness
53、owFunctions)下列是聊天窗口管理函数.情同时参考频道函数(ChannelFunctions)和通信函数(CommunicationFunctions)部分.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)-获取聊天窗口的设置信息.GetC