So the event to be monitored ended up being WARNING_MESSAGE but why didn't Lisa's post below work to test it? Matter of timing or stopping too soon? Something to do with, "...stop all monitoring and print the event type and message"?
would it go better to just delete the following and then manually pause/end the bot?
Code: Select all
local function stoptest()
unregisterTimer("EVENTtest");
for i = 1,#events do
EventMonitorStop("EVENT"..i)
end
end
if _stop then stoptest() return end
Edit again... ahhh, so it calls the monitor every milisecond which is good to monitor frequently but if the stop is triggered once an event is monitored wouldn't it miss some things? errr I'm probably the one missing things right now lol
Code: Select all
registerTimer("EVENTtest", secondsToTimer(1), testevent);
Code: Select all
for i = 1,30 do
Thanks again
lisa wrote:looks like thislisa wrote:If not then I guess the easiest way would be to make a function that starts up a seperate monitor for all the usual chat/message events and then get it to match a string to the messages and if found then stop all monitoring and print the event type and messagewith a WP like thisCode: Select all
function scanevent(_msg,_stop) local events = { "WARNING_MESSAGE","SCROLL_BANNER_MESSAGE","SHOW_MESSAGE_DIALOG", "SYSTEM_MESSAGE","MESSAGE_NORMAL","CHAT_MSG_EMOTE", "CHAT_MSG_GM_TALK","CHAT_MSG_GM","CHAT_MSG_SAY", "CHAT_MSG_SYSTEM_GET","CHAT_MSG_SYSTEM_VALUE", "CHAT_MSG_SYSTEM","CHAT_MSG_WHISPER_INFORM", "CHAT_MSG_WHISPER_OFFLINE","CHAT_MSG_WHISPER", "CHAT_MSG_YELL","SYSTEM_MESSAGE"} local function stoptest() unregisterTimer("EVENTtest"); for i = 1,#events do EventMonitorStop("EVENT"..i) end end if _stop then stoptest() return end for k,v in ipairs(events) do EventMonitorStart("EVENT"..k, v) end local function testevent() for k,v in ipairs(events) do local time, moreToCome, name, msg = EventMonitorCheck("EVENT"..k, "4,1") if msg and string.find(msg, _msg) then print(v.." "..msg) end end end registerTimer("EVENTtest", secondsToTimer(1), testevent); end
which works but the event we want isn't any of those in the table.Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints> <onLoad> scanevent("ostrich") for i = 1,30 do yrest(1000) end scanevent(nil,true) player:sleep() </onLoad> </waypoints>
it prints this when doing the eventCode: Select all
CHAT_MSG_SYSTEM |cfffff266The ostrich glares at you.|r CHAT_MSG_SYSTEM |cfffff266The ostrich glares at you.|r CHAT_MSG_SYSTEM |cfffff266The ostrich glares at you.|r CHAT_MSG_SYSTEM |cfffff266The ostrich glares at you.|r CHAT_MSG_SYSTEM |cfffff266The ostrich glares at you.|r CHAT_MSG_SYSTEM |cfffff266The ostrich winks at you happily.|r CHAT_MSG_SYSTEM |cfffff266The ostrich winks at you happily.|r CHAT_MSG_SYSTEM |cfffff266The ostrich winks at you happily.|r CHAT_MSG_SYSTEM |cfffff266The ostrich winks at you happily.|r CHAT_MSG_SYSTEM |cfffff266The ostrich winks at you happily.|r CHAT_MSG_SYSTEM |cfffff266The ostrich glares at you.|r