WoW:API GetRestState: Difference between revisions

No edit summary
 
m (Move page script moved page API GetRestState to API GetRestState without leaving a redirect)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Returns 1 if rested.
{{wowapi}} __NOTOC__
Returns whether the player is in a [[Rest|rested]] (earning double XP for kills) or normal state.
id, name, mult = GetRestState()


Dont know if its 0 or nil for not rested.
== Returns ==
; id : Number - Rest state index; observed values are '''1''' if the player is "Rested", '''2''' if the player is in a normal state.
; name : String - Name of the current rest state; observed: "Rested" or "Normal".
; mult : Number - XP multiplier applied to experience gain from killing monsters in the current rest state.


RestState is the state where your toon gets added XP for killing mobs.
==Example==
rested = GetRestState();
if rested == 1 then
  print("You're rested. Now's the time to maximize experience gain!");
elseif rested == 2 then
  print("You're not rested. Find an inn and camp for the night?");
else
  print("You've discovered a hitherto unknown rest state. Would you like some coffee?")
end

Latest revision as of 04:46, 15 August 2023

WoW API < GetRestState

Returns whether the player is in a rested (earning double XP for kills) or normal state.

id, name, mult = GetRestState()

Returns

id
Number - Rest state index; observed values are 1 if the player is "Rested", 2 if the player is in a normal state.
name
String - Name of the current rest state; observed: "Rested" or "Normal".
mult
Number - XP multiplier applied to experience gain from killing monsters in the current rest state.

Example

rested = GetRestState();
if rested == 1 then
 print("You're rested. Now's the time to maximize experience gain!");
elseif rested == 2 then
 print("You're not rested. Find an inn and camp for the night?");
else
 print("You've discovered a hitherto unknown rest state. Would you like some coffee?")
end