Page 1 of 1

Veiled Encampment Waypoint

Posted: Fri Oct 05, 2012 9:41 am
by Cindy
Placeholder, testing now.

Re: Veiled Encampment Waypoint

Posted: Fri Oct 05, 2012 1:10 pm
by Cindy

Code: Select all

   function waitForEventStart()
      repeat
         yrest(3000) -- check every second
         local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
		 if (ScorePE == nil) then
		 printf("Score is nil, oh no!");
		<!-- #  2 --><waypoint x="-2804" z="-18154" y="836">	</waypoint>
		<!-- #  3 --><waypoint x="-2926" z="-18034" y="836">	</waypoint>
		<!-- #  4 --><waypoint x="-2813" z="-18155" y="836">	</waypoint>
		<!-- #  5 --><waypoint x="-2666" z="-17962" y="837">	</waypoint>		 
		 end
		 
         if Count == 2 and YourTargetScore > ScorePE then break end
      until false
   end
What am I doing wrong? i get the message printed, but it doesnt move to regain the counter....

Re: Veiled Encampment Waypoint

Posted: Fri Oct 05, 2012 7:16 pm
by vegasmike

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onload>
               
        YourTargetScore = 1776

   function waitForEventStart()
      repeat
         yrest(1000) -- check every second
         local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
         if Count == 2 and YourTargetScore > ScorePE then break end
      until false
   end

   function isEventFinished()
       local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
       if Count ~= 2 or ScorePE >= YourTargetScore then
         __WPL:setForcedWaypointType("RUN")
         __WPL:setWaypointIndex(__WPL:findWaypointTag("WP1"));
      end
   end

</onload>
	<!-- #  2 --><waypoint x="-2651" z="-17953" y="812">	
	inventory:useItem("Magic Circle Charge Rune");
	if (isEventFinished()) then
               __WPL:setWaypointIndex(__WPL:findWaypointTag("WP1"));
              end;
	player:target_NPC("Forem Mone");
	RoMScript("OnClick_QuestListButton(1, 1);");yrest(100)
	RoMScript("OnClick_QuestListButton(3, 1);");yrest(100)
		RoMScript("CompleteQuest();");yrest(500)
		player:target_NPC("Forem Mone");
	RoMScript("OnClick_QuestListButton(1, 1);");yrest(100)
						RoMScript("OnClick_QuestListButton(1, 1);");
				  		__WPL:setDirection(WPT_FORWARD);
							inventory:useItem("Magic Circle Charge Rune");
	</waypoint>
	<!-- #  3 --><waypoint x="-2812" z="-18150" y="811">		
	inventory:useItem("Magic Circle Charge Rune");
	</waypoint>
	<!-- #  4 --><waypoint x="-2936" z="-18020" y="811">	
	inventory:useItem("Magic Circle Charge Rune");
			  		__WPL:setDirection(WPT_BACKWARD);

	</waypoint>
		<!-- #  3 --><waypoint x="-2651" z="-17953" y="812" tag="WP1">        waitForEventStart(); 	</waypoint>
</waypoints>
This works but it doesn't always seem to reinitialize on event restart. The timer check is the same one that is floating around the forums, btw. I have completely forgotten who I got it from but thanks for it to whomever it belongs.

Re: Veiled Encampment Waypoint

Posted: Fri Oct 05, 2012 9:56 pm
by Cindy
I'd get a nil compare error when the timer goes away though(ScorePE is nil, and causes the script to abort).

Re: Veiled Encampment Waypoint

Posted: Fri Oct 12, 2012 11:41 am
by Hidden
Waypoints need to be boxed eg.
<waypoints>
<!-- # 2 --><waypoint x="-2804" z="-18154" y="836"> </waypoint>
<!-- # 3 --><waypoint x="-2926" z="-18034" y="836"> </waypoint>
</waypoints>

Not sure if that will work inside the <onload> </onload> but the idea is good.

Maybe a function that overrides the waitForStart function eg.. timerisnil = start script (the timer should theoretically pop up then.)

Code: Select all

 
      if (ScorePE == nil) then
                printf("Score is nil, oh no!");
                __WPL:setWaypointIndex(__WPL:findWaypointTag("WP1"));
end
not 100% sure that will work just an idea.