(编者注:魔兽世界的API接口函数库相当庞大,本类的整理将是一个长期的编辑过程,逐步汉化,同时欢迎对魔兽世界宏与UI有兴趣的各路高手加入本项百科计划!)
编译自:WOWWIKI
魔兽世界API
魔兽世界API是一整套由暴雪提供的,允许玩家通过插件与宏改善魔兽世界游戏用户界面的函数接口功能.
以下是几近完整的函数接口列表,由暴雪开放提供,您可以使用它们创建你自己的插件或者宏.
我们欢迎您将自己了解的更多知识与我们共享,将自己的心得发布上来.
Global Function Groups(全局函数组)
This is an incomplete list. It may never be fully completed or, depending on its nature, it may be that it can never be complete. However, new and revised entries in the list are always welcome.
Here is a complete list of all global functions: Global Function List. If a function on that list is missing from this page, it’s because no-one has added it yet. If you add a new entry, please base it on the Empty Template.
The old World of Warcraft API doc is currently at http://www.cosmosui.org/texts/BlizzardCommands.xml (http://www.cosmosui.org/texts/BlizzardCommands.xml) (outdated).
发现不支持的代码:Action Functions (动作条函数)
These functions are those which operate with the action buttons (General player actions are likely in the Activity Functions section below).
- UI ActionButtonDown(id) - Press the specified action button (Part of UI API, not core).
- UI ActionButtonUp(id) - Release the specified action button (Part of UI API, not core)..
- UI BonusActionButtonDown - Trigger the specified bonus(pet or minion) action button. (Part of UI API, not core).
- UI BonusActionButtonUp - Release the specified bonus(pet or minion) action button. (Part of UI API, not core).
- CameraOrSelectOrMoveStart - ?.
- CameraOrSelectOrMoveStop - ?.
- ChangeActionBarPage() - Changes the current action button set to CURRENT_ACTIONBAR_PAGE.
- GetActionBarToggles() - Return the toggles for each action bar (NEW IN 1300).
- GetActionCooldown(slot) - This returns the cooldown values of the specified action..
- GetActionCount(slot) - Get the count (bandage/potion/etc) for an action, returns 0 if none or not applicable.
- GetActionText(slot) - Get the text label (macros, etc) for an action, returns nil if none.
- GetActionTexture(slot) - Gets the texture path for the specified action.
- GetBonusBarOffset()
- HasAction(slot) - Returns 1 if the player has an action in the specified slot, nil otherwise.
- IsActionInRange(slot) - Test if an action is in range (1=yes, 0=no, nil=not applicable).
- IsAttackAction(slot) - Return 1 if an action is an ’attack’ action (flashes during combat), nil otherwise.
- IsAutoRepeatAction(slot) - Return 1 if an action is auto-repeating, nil otherwise.
- IsCurrentAction(slot) - Return 1 if an action is the one currently underway, nil otherwise.
- IsUsableAction(slot) - Return 1 if an action can be used at present, nil otherwise.
- PetHasActionBar() - ?.
- PickupAction(slot) - Drags an action out of the specified quickbar slot and holds it on the cursor.
- PickupPetAction(index) - ?.
- PlaceAction(slot) - Drops an action from the cursor into the specified quickbar slot.
- SetActionBarToggles(show1,show2,show3,show4) - Set show toggle for each action bar (NEW IN 1300)
- TurnOrActionStart - ?.
- TurnOrActionStop - ?.
- UseAction(slot, {checkCursor {,onSelf} } - This instructs the interface to use the action associated with the specified ID, optionally on the player (regardless of target).
Activity Functions (玩家操作函数)
This section is for functions which make the player do something (and which aren’t covered elsewhere, and which aren’t simply confirmation steps)
- AcceptDuel() - The player accepts the challenge to duel.
- AttackTarget() - Attacks the targetted unit.
- CancelDuel() - Refuse the invitation to fight a duel.
- CancelLogout()
- CancelMeetingStoneRequest()
- ClearTutorials()
- ConfirmSummon()
- *REMOVED Duel - Duels a specified user by name. (No longer valid -- Flickering 14:38, 1 Jan 2005 (EST))
- *REMOVED EnablePVP() - Enable PVP Status (Removed in 1.4.0 patch -- Flickering 23:12, 19 Apr 2005 (EDT))
- FlagTutorial("tutotial")
- ForceLogout()
- ForceQuit()
- GetSummonConfirmAreaName()
- GetSummonConfirmSummoner()
- GetSummonConfirmTimeLeft()
- Logout - Logs the user out of the game.
- Quit - Quits the application, NOT the LUA script.
- RandomRoll - Does a random roll between the two values.
- SitOrStand() - The player sits or stands.
- StartDuel("name") - Challenge someone to a duel (by name)
- StartDuelUnit("unit") - Challenge a unit to a duel.
- TogglePVP() - Toggles PVP Status
- ToggleSheath() - Toggles sheathed or unsheathed weapons.
- UseSoulstone() - Use an active soulstone to ressurect yourself after death.