Page 3 of 4

Re: Ostrich Nurse

Posted: Sun Dec 02, 2012 1:32 pm
by grande
nevermind

Re: Ostrich Nurse

Posted: Sun Dec 02, 2012 2:04 pm
by rock5
grande wrote:Still not working.
Well of course not. As was previously stated we still haven't got the right event to monitor for the messages.
rock5 wrote:Of course, from what Lisa says, the monitored event is still wrong.
I wrote the code. I believe Lisa was looking for the event but I think she's given up for now.

So that code wont work until the correct event is found.

Re: Ostrich Nurse

Posted: Sun Dec 02, 2012 3:43 pm
by grande
Anyone able to test these? I don't think I'm testing it correctly:

Code: Select all

QUEST_MSG_GET_ITEM    (%s: %s %d/%d)
QUEST_MSG_KILL_MONSTER  (%s: %s %d/%d)
QUEST_MSG_REQUEST_ITEM  (%s%s %d/%d%s)
QUEST_MSG_REQUEST_KEYITEM  (%s%s)
QUEST_MSG_REQUEST_KILL  (%s%s %d/%d%s)
or

Code: Select all

SYS_QUEST_TEST    (Str1 %s Val1 %d Str2 %s)

Re: Ostrich Nurse

Posted: Sun Dec 02, 2012 8:04 pm
by grande
Was another error a few posts back. Basically, the eventstartmonitor didn't match the string.match part. Regardless, I still cannot find how to monitor the "ostrich wish" string.

Tried with just "14" and also 06-10:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onload>
   function respondto(ostrichcmd)
      if     ostrichcmd == "-#" then RoMScript("UseExtraAction(1)")
      elseif ostrichcmd == "#-" then RoMScript("UseExtraAction(2)")
      elseif ostrichcmd == "*!" then RoMScript("UseExtraAction(3)")
      elseif ostrichcmd == "**" then RoMScript("UseExtraAction(4)")
      elseif ostrichcmd == "'*" then RoMScript("UseExtraAction(5)")
      else
         printf("You gave me garbage : "..ostrichcmd)
      end
   end
</onload>
   <!-- #  1 --><waypoint x="2437" z="1065" y="51"> 
      player:target_NPC("Ostrich Nurse")
      sendMacro("ChoiceOption(1);"); yrest(500) -- Ok, I would like to know...
      sendMacro("ChoiceOption(1);"); yrest(500) -- I got it.
      player:target_NPC(GetIdName(121470)) -- "Ostrich waiting to be looked after"
      sendMacro("ChoiceOption(1);"); -- I will fulfill your wish.
      
      repeat
      EventMonitorStart("Test", "SC_2012THANKS_NPC_121493_SYSTEM_06");
      EventMonitorStart("Test", "SC_2012THANKS_NPC_121493_SYSTEM_07");
      EventMonitorStart("Test", "SC_2012THANKS_NPC_121493_SYSTEM_08");
      EventMonitorStart("Test", "SC_2012THANKS_NPC_121493_SYSTEM_09");
      EventMonitorStart("Test", "SC_2012THANKS_NPC_121493_SYSTEM_10");

         local time, moreToCome, msg = EventMonitorCheck("Test") 
         if msg and string.match(msg, RoMScript("TEXT(\"SC_2012THANKS_NPC_121493_SYSTEM_06\")")) then -- "The ostrich tells you its wish:"
            local wish = string.match(msg,"['#!%*%-]+")
            -- Iterate through every 2 characters
            for cmd in string.gmatch(wish,"..") do
               respondto(cmd)
               yrest(100)
            end
         end
         yrest(100)

         local time, moreToCome, msg = EventMonitorCheck("Test") 
         if msg and string.match(msg, RoMScript("TEXT(\"SC_2012THANKS_NPC_121493_SYSTEM_07\")")) then -- "The ostrich tells you its wish:"
            local wish = string.match(msg,"['#!%*%-]+")
            -- Iterate through every 2 characters
            for cmd in string.gmatch(wish,"..") do
               respondto(cmd)
               yrest(100)
            end
         end
         yrest(100)

         local time, moreToCome, msg = EventMonitorCheck("Test") 
         if msg and string.match(msg, RoMScript("TEXT(\"SC_2012THANKS_NPC_121493_SYSTEM_08\")")) then -- "The ostrich tells you its wish:"
            local wish = string.match(msg,"['#!%*%-]+")
            -- Iterate through every 2 characters
            for cmd in string.gmatch(wish,"..") do
               respondto(cmd)
               yrest(100)
            end
         end
         yrest(100)

         local time, moreToCome, msg = EventMonitorCheck("Test") 
         if msg and string.match(msg, RoMScript("TEXT(\"SC_2012THANKS_NPC_121493_SYSTEM_09\")")) then -- "The ostrich tells you its wish:"
            local wish = string.match(msg,"['#!%*%-]+")
            -- Iterate through every 2 characters
            for cmd in string.gmatch(wish,"..") do
               respondto(cmd)
               yrest(100)
            end
         end
         yrest(100)

         local time, moreToCome, msg = EventMonitorCheck("Test") 
         if msg and string.match(msg, RoMScript("TEXT(\"SC_2012THANKS_NPC_121493_SYSTEM_10\")")) then -- "The ostrich tells you its wish:"
            local wish = string.match(msg,"['#!%*%-]+")
            -- Iterate through every 2 characters
            for cmd in string.gmatch(wish,"..") do
               respondto(cmd)
               yrest(100)
            end
         end
         yrest(100)

      until msg and string.match(msg,RoMScript("TEXT(\"SC_2012THANKS_NPC_121493_SYSTEM_05\")")) -- The time is up. Please get your reward from Ostrich Nurse
      EventMonitorStop("Test");
      printf("Game over.")
      player:sleep()
   </waypoint>
</waypoints>

Re: Ostrich Nurse

Posted: Sun Dec 02, 2012 10:11 pm
by lisa
grande wrote:Regardless, I still cannot find how to monitor the "ostrich wish" string.
If and when we eventually get the message from the event monitor addon the actual string returned will have all of the message altogether in 1 string.
example:

Code: Select all

The ostrich tells you its wish:-##-#--##-#-#-
We are using the SC_2012THANKS_NPC_121493_SYSTEM_14 so identify the string as the message that contains the "wish" and we use that SC_2012THANKS_NPC_121493_SYSTEM_14 so that it will work for any and all language versions of the game.

So once we identify it as a "wish" message all we need to do is get the -#*! characters of that message because the rest means nothing to us. So with the code rock posted it will get just the -##-#--##-#-#- from the message example above. Which is all that we want. We then do a check for the patterns that correspond to the skills and bingo, job done.

The ONLY thing stopping this from working is identifying what event the message is being sent to, the rest is all done and worked out =)

Re: Ostrich Nurse

Posted: Sun Dec 02, 2012 10:22 pm
by lisa
rock5 wrote: So that code wont work until the correct event is found.
doesn't this part of the xml call the function for every single event?

Code: Select all

            <OnEvent>
                -- call the OnEvent method on our Addon (runs every time an event fires)
                igf_events:OnEvent(this, event, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
            </OnEvent>
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.

Re: Ostrich Nurse

Posted: Sun Dec 02, 2012 11:13 pm
by lisa
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 1:41 am
by rock5
Ok we found the event. I've tested it, added timing and casting checks and ran a few characters through it. It works perfectly.

The highest score you can get is 30 and this does it very easily.

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 1:58 am
by lisa
just scored max 30 manually
30 you get 3 vouchers + crappy phirius pot
28 you get 3 vouchers
24 you get 3 vouchers
22 you get 2 vouchers

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 2:55 am
by rock5
Working script 2 posts up.

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 3:01 am
by lisa
rock5 wrote:Working script 2 posts up.
time to post it in userfunction section now it actually works ?

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 3:38 am
by rock5
Hardly seems worth it.

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 3:48 am
by lisa
rock5 wrote:Hardly seems worth it.
awww come on don't belittle the event, I mean max score gets you 3 vouchers that is like a party in your pants lmao

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 3:52 am
by rock5
Well... there is a banquet event post in the userfunctions section. It could be posted there. I think that post is about all the events.

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 4:12 am
by rock5
I guess now the question is, what rewards do you get for the Banquet Vouchers?

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 11:37 am
by kkulesza
For 20 vouchers you get a guild donation package. There is 200 guild rubies in it and other mats. But You have to be in a guild castle to open it. That package is automaticly donated to the guild.

There are also other typical event rewards.

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 12:29 pm
by grande
Rock, Lisa, Cindy, solarstrike folks: many many thanks!

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 4:28 pm
by s018mes
Yes, thank you guys for working on this. It was very fun to read how you guys work together!

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 4:29 pm
by Cindy
Awesome work, was fun.

Here is code to add at the pause if you want to use the package:

Code: Select all

		<!-- Use the Ostrich Salvation Package Charges -->
		local item = inventory:findItem("Ostrich Salvation Package");
		repeat				
			if item ~= nil then		inventory:useItem("Ostrich Salvation Package");		end			
			inventory:update()
			item = inventory:findItem("Ostrich Salvation Package");				
		until (item == nil)
(Will get tested in a bit).

Scorpio pet crystal is one of the rewards, worth doing for those.

Re: Ostrich Nurse

Posted: Mon Dec 03, 2012 6:02 pm
by grande
lisa wrote:
rock5 wrote:Hardly seems worth it.
awww come on don't belittle the event, I mean max score gets you 3 vouchers that is like a party in your pants lmao
Hey now, those nickels and dimes add up! After ten transport portal rune trade-ins (gives TWO event repeat tickets each rune trade) that's 60 more vouchers or 3 more prizes.

But... I'm more interested in the message testing which I seem to be horrible at.