I'll clarify the command for you.
Code: Select all
time, moreToCome, arg1, arg2 = EventMonitorCheck("monitorname", argfilter)
time and
moreToCome are values returned from the function. All values after the first 2 values are the values returned from the event being monitored as defined by the
argfilter.
For example we typically get chat messages like so
Code: Select all
time, moreToCome, name, msg = EventMonitorCheck("chatmonitor","4,1")
So that's the "time" and "moreToCome" values plus the 4th and 1st values returned from the event which are the "message" and "sender" respectively (different events return different values).
This returns 3 values; time, moreToCome and the 1st argument from the event which should be the message so there is no point in using 4 variables as the last varaible will always be nil. So all you need is
Code: Select all
time, moreToCome, name = EventMonitorCheck("eventchat",1)
Although "name" is a confusing name for the message. Maybe you should use this instead
Code: Select all
time, moreToCome, msg = EventMonitorCheck("eventchat",1)
Note: You have been using the number
1. I don't see any problem using a number as long as only want one returned value, because it will be converted to a string, but if you want to return more than one then make sure to make it a string like in the "chat" example above.
Now, after all that is said, I'm not sure why you always got nil. You do realize that you will only get returned values when the event is actually triggered, don't you?