Re: Ostrich Nurse
Posted: Sun Dec 02, 2012 1:32 pm
nevermind
Well of course not. As was previously stated we still haven't got the right event to monitor for the messages.grande wrote:Still not working.
I wrote the code. I believe Lisa was looking for the event but I think she's given up for now.rock5 wrote:Of course, from what Lisa says, the monitored event is still wrong.
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)
Code: Select all
SYS_QUEST_TEST (Str1 %s Val1 %d Str2 %s)
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>
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.grande wrote:Regardless, I still cannot find how to monitor the "ostrich wish" string.
Code: Select all
The ostrich tells you its wish:-##-#--##-#-#-
doesn't this part of the xml call the function for every single event?rock5 wrote: So that code wont work until the correct event is found.
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>
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 message
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
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>
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
time to post it in userfunction section now it actually works ?rock5 wrote:Working script 2 posts up.
awww come on don't belittle the event, I mean max score gets you 3 vouchers that is like a party in your pants lmaorock5 wrote:Hardly seems worth it.
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)
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.lisa wrote:awww come on don't belittle the event, I mean max score gets you 3 vouchers that is like a party in your pants lmaorock5 wrote:Hardly seems worth it.