Page 4 of 4

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 6:12 pm
by grande
I'll put my message up top:

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: okay, explains it here but I'm still digesting it(http://www.solarstrike.net/wiki/index.p ... isterTimer) ..And what does the secondsToTimer(1) do in this? If it only monitors for a second or if the monitor is limited too far by time then it seems that could also be a problem.

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);
edit again... and what does the below code do? Looks like it would monitor 30 events? And there's something like 14 events so it would only cycle through roughly 2 of each and then stop or does it run through the event list 30 times?

Code: Select all

for i = 1,30 do

Thanks again :-)
lisa wrote:
lisa 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 message
looks like this

Code: 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
with a WP like this

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>
which works but the event we want isn't any of those in the table.
it prints this when doing the event

Code: 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

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 7:03 pm
by kkulesza
Hi
I have other solution for this quest.
It is very easy to do manually if you translate the ostrich talk.
So i've written an addon that translates ostrich talk to numbers of extra buttons.
It prints into system chat numbers of extra buttons to click.
This is an ingame addon (not a rombot addon).
Feel free to download it and modify if you want.

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 8:07 pm
by lisa
grande wrote:registerTimer("EVENTtest", secondsToTimer(1), testevent);
this registers a timer named, EVENTtest
the timer calls the function named, testevent
it will call that function every 1 second, secondsToTimer(1)
grande wrote:for i = 1,30 do
that will just repeat the code 30 times, so it repeated the yrest(1000) 30 times to be a pause of 30 seconds, as such. The "i" was never actually used in anything in that code.
grande wrote: So the event to be monitored ended up being WARNING_MESSAGE but why didn't Lisa's post below work to test it?
I have absolutely no idea why it didn't work. It worked fine for the CHAT_MSG_SYSTEM.

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 10:50 pm
by grande
Thanks Lisa.

Re: Ostrich Nurse

Posted: Tue Dec 04, 2012 12:26 am
by lisa
had it a few times now where the bot has tried to cast to soon, so I am thinking a bigger yrest before the loop for castingbar or a bigger yrest inside the loop itself. I'll test it out and see how it goes.

Re: Ostrich Nurse

Posted: Tue Dec 04, 2012 1:17 am
by rock5
We ended up finding the event name "WARNING_MESSAGE" using the addon I wrote. I'm thinking of polishing it up and making it a tool that can be used in the future. I might add an ingame frame to enter text to search for as well.

Re: Ostrich Nurse

Posted: Tue Dec 04, 2012 12:43 pm
by runehemma
i only get this phirius pot hi don cast any ting only stand
still

Re: Ostrich Nurse

Posted: Tue Dec 04, 2012 7:33 pm
by lisa
you should test your event monitoring is working.

look for this around the middle of first post.
A WP purely for testing that you have event monitoring funtional.
Can be any character even brand new and you don't need any extra code in profile for it to work, just run bot with this waypoint file.
http://www.solarstrike.net/phpBB3/viewt ... =27&t=2516