WoW:API SetCurrentTitle: Difference between revisions
Jump to navigation
Jump to search
(Grammar) |
(boilerplate) |
||
Line 1: | Line 1: | ||
{{wowapi}} __NOTOC__ | {{wowapi}} __NOTOC__ | ||
Changes your character's displayed title. | |||
SetCurrentTitlte(titleId); | |||
== Arguments == | == Arguments == | ||
; titleId : Number - ID of the title you want to set. The identifiers are global and therefore do not depend on which titles you have learned. Invalid or unlearned values clear your title. See [[TitleId]] for a list. | |||
: Number - | |||
== Example == | == Example == | ||
Line 15: | Line 11: | ||
This sets the title "Chef" if your character had earned the title, otherwise it removes any active title. | This sets the title "Chef" if your character had earned the title, otherwise it removes any active title. | ||
/script i= | /script repeat i = random(GetNumTitles()) until IsTitleKnown(i) == 1; SetCurrentTitle(i) | ||
This will set a random title. (Warning: quick'n'dirty: may hang WoW if no title available. May cause lag if only few titles are available.) | This will set a random title. (Warning: quick'n'dirty: may hang WoW if no title available. May cause lag if only few titles are available.) | ||
== Details == | == Details == | ||
*The last indexed value (currently 143) returns nil and removes the player's name completely (not available to players). | * The last indexed value (currently 143) returns nil and removes the player's name completely (not available to players). | ||
* [[API GetTitleName|GetTitleName]] can be used to find the name associated with the [[TitleId]]. | |||
*[[API GetTitleName|GetTitleName]] can be used to find the name associated with the [[TitleId]]. |
Revision as of 21:50, 10 December 2009
Changes your character's displayed title.
SetCurrentTitlte(titleId);
Arguments
- titleId
- Number - ID of the title you want to set. The identifiers are global and therefore do not depend on which titles you have learned. Invalid or unlearned values clear your title. See TitleId for a list.
Example
SetCurrentTitle(43);
This sets the title "Chef" if your character had earned the title, otherwise it removes any active title.
/script repeat i = random(GetNumTitles()) until IsTitleKnown(i) == 1; SetCurrentTitle(i)
This will set a random title. (Warning: quick'n'dirty: may hang WoW if no title available. May cause lag if only few titles are available.)
Details
- The last indexed value (currently 143) returns nil and removes the player's name completely (not available to players).
- GetTitleName can be used to find the name associated with the TitleId.