Page 1 of 1

yrest system message?

Posted: Sun Jul 20, 2014 8:20 am
by Lamkefyned
RAScrnShot_20140720_151026.jpg
I can put it as a break till I make what I circled in red?

Re: yrest system message?

Posted: Sun Jul 20, 2014 9:02 pm
by Administrator
You mean wait for 10 seconds and print a message every one second? Sure. Something like this:

Code: Select all

for i = 1,10 do
  local startTime = getNow();
  while( deltaTime(getNow(), startTime) < 1 ) do
    yrest(10);
  end
  printf("%d seconds passed.\n", i);
end
Instead of using the print, you could use RoMScript() to send it to the game.

Re: yrest system message?

Posted: Wed Jul 23, 2014 5:41 pm
by Lamkefyned
no, not that

when I set the system message of the event follow the script

Re: yrest system message?

Posted: Wed Jul 23, 2014 10:32 pm
by rock5
Are you saying you want to wait until "Etapa 10" appears in chat? You can do that with the EventMonitor commands. Example.

Code: Select all

EventMonitorStart("MyMonitor","CHAT_MSG_SYSTEM")
repeat
	yrest(100)
	local time, moreToCome, msg = EventMonitorCheck("MyMonitor", "1")
until string.find(msg, "Etapa 10")
EventMonitorStop("MyMonitor")
I think that should work. I think the correct event to monitor is "CHAT_MSG_SYSTEM" but I could be wrong.

Re: yrest system message?

Posted: Sat Jul 26, 2014 4:10 pm
by Lamkefyned
Error

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<waypoints>
	<!-- Updated>26/07/2014 5:00 AM PST<-->
	
	<!-- Enter Guild --> 
	<!-- #  1 --><waypoint x="-22152" z="6469" y="-179">
			player:target_NPC(111731)
			sendMacro("ChoiceOption(2);");
			waitForLoadingScreen()
	</waypoint>
	<!-- #  2 --><waypoint x="177" z="-487" y="6">	</waypoint>
	<!-- #  3 --><waypoint x="180" z="-408" y="8">	
			player:target_NPC(112896)
			sendMacro("ChoiceOption(1);");
			waitForLoadingScreen()
	</waypoint>

	<!-- Drill Ground --> 
	<!-- #  3 --><waypoint x="5121" z="2519" y="13">
		if (getCurrency("honor") >= 25000) then
			player:sleep()
		end
		
        player:updateBuffs();
	 	if not player:hasBuff(506684) then
        	 	inventory:useItem(207200);
	 	end
		
   		fly()
	</waypoint>
	<!-- #  4 --><waypoint x="5136" z="2566" y="130">	</waypoint>
	<!-- #  5 --><waypoint x="4625" z="3049" y="292">	</waypoint>
	<!-- #  6 --><waypoint x="2470" z="4243" y="292">	</waypoint>
	<!-- #  8 --><waypoint x="2088" z="4632" y="13">
		if RoMScript("StaticPopup1:IsVisible()") then
			sendMacro('StaticPopup_OnClick(StaticPopup1, 1);')
		end
	</waypoint>
	<!-- #  1 --><waypoint x="2419" z="4324" y="335">	</waypoint>
	<!-- #  2 --><waypoint x="3632" z="3941" y="337">
	EventMonitorStart("MyMonitor","CHAT_MSG_SYSTEM")
	  repeat
		yrest(100)
		local time, moreToCome, msg = EventMonitorCheck("MyMonitor", "1")
	  until string.find(msg, "Etapa 10")
	EventMonitorStop("MyMonitor")
	</waypoint>

</waypoints>
Sin título.jpg

Re: yrest system message?

Posted: Sat Jul 26, 2014 7:49 pm
by lisa
change

Code: Select all

until string.find(msg, "Etapa 10")
to

Code: Select all

until msg and string.find(msg, "Etapa 10")