I would like to use following codes to check if the "Event is starting" if not the char should just rest until the event start. For that purpose I want to use the functions getLastWarning or getLastAlert. It would be rather helpful, if it works, so MM can run independent without the clock.
I tried 4 different codes in order to work it out:
Code: Select all
Solution A
function EventStart()
local strmsg = "|cffffff80"..getTEXT("Regional event now restarting!").."|r"
print("strmsg is ".. strmsg)
local msgtime = getLastWarning(strmsg) or 0
print("msgtime is "..msgtime)
repeat
yrest(1500)
local newstrtime = getLastWarning(strmsg) or 0
print("newstrtimes is "..newstrtime)
until newstrtime > msgtime
print("strmsg detected")
Solution B
function EventStart()
local strmsg = "|cffffff80"..getTEXT("Regional event now restarting!").."|r"
print("strmsg is ".. strmsg)
local msgtime = getLastAlert(strmsg) or 0
print("msgtime is "..msgtime)
repeat
yrest(1500)
local newstrtime = getLastAlert(strmsg) or 0
print("newstrtimes is "..newstrtime)
until newstrtime > msgtime
print("strmsg detected")
Solution C
function EventStart()
local strmsg = getTEXT("Regional event now restarting!")
print("strmsg is ".. strmsg)
local msgtime = getLastAlert(strmsg) or 0
print("msgtime is "..msgtime)
repeat
yrest(1500)
local newstrtime = getLastAlert(strmsg) or 0
print("newstrtimes is "..newstrtime)
until newstrtime > msgtime
print("strmsg detected")
Soution D
function EventStart()
local strmsg = getTEXT("Regional event now restarting!")
print("strmsg is ".. strmsg)
local msgtime = getLastWarning(strmsg) or 0
print("msgtime is "..msgtime)
repeat
yrest(1500)
local newstrtime = getLastWarning(strmsg) or 0
print("newstrtimes is "..newstrtime)
until newstrtime > msgtime
print("strmsg detected")
The Question is , how can I make it work? Are the functions "getLastWarning" / getLastAlert the only options I can use? Or are there any other codes to check for Messages in the Zone chat?newstrtimes is 0
newstrtimes is 0
newstrtimes is 0
newstrtimes is 0