Page 1 of 1

Elven TQ misstake

Posted: Tue Jul 21, 2015 6:08 pm
by Miworax
Does anyone see the misstake that happend in this script ? it says that there is a fail in the onload part....

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>	
cprintf(cli.lightgreen,"\n character-WP von ***** \n")

function checkDQCount()
    local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()")
      cprintf(cli.lightblue,"%s quests completed.\n",tostring(dailyQuestCount));
      	if (dailyQuestCount == 10) then
         	cprintf(cli.lightblue,"Completed max number of daily quests, trying to log in next chara.\n");
		SetCharList({
   		{account=21 , chars= {}},
   		{account=22 , chars= {}},
		{account=23 , chars= {}},
		{account=24 , chars= {}},
		{account=25 , chars= {}},
		{account=26 , chars= {}},
		{account=27 , chars= {}},
		)}
		LoginNextChar()
	end
end

function relog()
        SetCharList({
   		{account=21 , chars= {}},
   		{account=22 , chars= {}},
		{account=23 , chars= {}},
		{account=24 , chars= {}},
		{account=25 , chars= {}},
		{account=26 , chars= {}},
		{account=27 , chars= {}},
   		)}

   	if IsLastChar() then 
		player:logout();	
      	else
		LoginNextChar()
        end

SetRestartClientSettings(7, "rom4u")

end

function checkCondition()
	inventory:useItem(201488)
	inventory:useItem(201489)
	inventory:useItem(201482)
	inventory:useItem(201490)
	inventory:useItem(200876)
	inventory:useItem(200877)
	inventory:useItem(200878)
	inventory:useItem(200879)
	yrest(8000);
end;

</onLoad>

	<!-- #  1 --><waypoint x="31853" z="4617" y="11">		player:target_NPC("Blinsik");
	CompleteQuestByName("Wachstumshilfe");
	AcceptQuestByName("Wachstumshilfe");
	checkDQCount()
	</waypoint>
	<!-- #  2 --><waypoint x="31847" z="4661" y="9" type="RUN"> 	</waypoint>
	<!-- #  3 --><waypoint x="31827" z="4792" y="0" type="RUN">	</waypoint>
	<!-- #  4 --><waypoint x="31808" z="4907" y="-3" type="RUN">	</waypoint>
	<!-- #  5 --><waypoint x="31783" z="4983" y="-12" type="RUN"> </waypoint>
	<!-- #  6 --><waypoint x="31746" z="5097" y="-12" type="RUN"> </waypoint>
	<!-- #  7 --><waypoint x="31684" z="5216" y="-24" type="RUN"> </waypoint>
	<!-- #  8 --><waypoint x="31609" z="5356" y="-33" ttype="RUN">
	<!-- #  9 --><waypoint x="31417" z="5714"	tag = "Item">
         queststate = getQuestStatus("Wachstumshilfe")
         if queststate == "incomplete" then
            player:target_Object(112976,500);
            yrest(3000);
            __WPL:setWaypointIndex(__WPL:findWaypointTag("Item"));
         end
	</waypoint>
	<!-- # 10 --><waypoint x="31417" z="5714" y="-33" type="RUN">	</waypoint>
	<!-- # 11 --><waypoint x="31455" z="5654" y="-33" type="RUN">	</waypoint>
	<!-- # 12 --><waypoint x="31554" z="5496" y="-33" type="RUN">	</waypoint>
	<!-- # 13 --><waypoint x="31744" z="5192" y="-16" type="RUN">	</waypoint>
	<!-- # 14 --><waypoint x="31878" z="4979" y="-14" type="RUN">	</waypoint>
	<!-- # 15 --><waypoint x="31875" z="4823" y="-5" type="RUN">	</waypoint>
	<!-- # 16 --><waypoint x="31864" z="4685" y="0"	type="RUN">	</waypoint>			
	player:target_NPC("Blinsik");</waypoint>
</waypoints>
its for the elven TQ


Would be nice if someone can help me :/
Thanks!!!

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 2:53 am
by rock5
Here is a tip for finding errors in waypoint onloads youtself, move the whole thing into an lua file. Then when you get an error it will tell you what line it is. Once it's working you can move it back into the onload.

Before:
File: mywaypoint.xml

Code: Select all

<waypoints
<onload>
    some code 
    in the onload
</onload
</waypoints>
After:
File: mywaypoint.xml

Code: Select all

<waypoints
<onload>
    include("tmponload.lua")
</onload
</waypoints>
File: tmponload.lua

Code: Select all

    some code 
    in the onload
I hope that's clear enough. Then just put tmponload in the same folder as the waypoint file.

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 7:21 am
by Celesteria

Code: Select all

      SetCharList({
         {account=21 , chars= {}},
         {account=22 , chars= {}},
      {account=23 , chars= {}},
      {account=24 , chars= {}},
      {account=25 , chars= {}},
      {account=26 , chars= {}},
      {account=27 , chars= {}},
      )}   <------- should be })
two times :)

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 8:02 am
by Miworax
Thanks Celesteria, now there is no error :)

but i have a new misstake :/

He just continue the Wp and dont do this :

Code: Select all

         queststate = getQuestStatus("Wachstumshilfe")
         if queststate == "incomplete" then
            player:target_Object(112976,500);
            yrest(3000);
Someone an idea how i can write that he stay at the object and try to get it and only continue the wp if he has complete the TQ ?

or if someone has a working script for this TQ...

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 12:28 pm
by Bill D Cat
This is how I would do it.

Code: Select all

repeat
  player:target_Object(112976)
  yrest(3000)
until getQuestStatus("Wachstumshilfe") == "complete" 

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 12:48 pm
by Miworax
it dont work.... he continue the wp..... he dont stop there.... Dont know why ....

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 12:56 pm
by Bill D Cat
It might be better to use the quest ID rather than the quest name. I'm at work right now, so I can't look it up. I'll find it when I get home unless someone else posts it first. Try changing the ~= "incomplete" to == "complete" and see if that helps.

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 1:00 pm
by Miworax
the problem is not,,, that he dont accept or complete the quest.... the problem is the part between the WP´s

Code: Select all

	<!-- #  8 --><waypoint x="31609" z="5356" y="-33" type="RUN"> 	</waypoint>
	<!-- #  9 --><waypoint x="31411" z="5716" y="-33" type="RUN"> 	</waypoint>	
	repeat
  	 player:target_Object(112976)
  	 yrest(3000)
	until getQuestStatus("Wachstumshilfe") == "complete"
	<!-- # 10 --><waypoint x="31417" z="5714" y="-33" type="RUN">	</waypoint>
	<!-- # 11 --><waypoint x="31455" z="5654" y="-33" type="RUN">	</waypoint>
he dont care the lines between the Waypoints

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 1:07 pm
by Bill D Cat
Oh, well that explains it. Anything that is not inside a <waypoint> and </waypoint> doesn't get run. Move the code up into the previous waypoint and it should work.

Code: Select all

   <!-- #  8 --><waypoint x="31609" z="5356" y="-33" type="RUN">    </waypoint>
   <!-- #  9 --><waypoint x="31411" z="5716" y="-33" type="RUN">    
   repeat
      player:target_Object(112976)
      yrest(3000)
   until getQuestStatus("Wachstumshilfe") == "complete"
   </waypoint>   
   <!-- # 10 --><waypoint x="31417" z="5714" y="-33" type="RUN">   </waypoint>
   <!-- # 11 --><waypoint x="31455" z="5654" y="-33" type="RUN">   </waypoint>

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 1:12 pm
by Miworax
Iam so stupid.... thanks mate it work now ! :)

Sorrry for that amateur misstake :D

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 2:27 pm
by Miworax
if he change the Character.... he start on WP 2.... all time... is there any reason for that ?

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 2:42 pm
by noobbotter
you can try adding

Code: Select all

__WPL:setWaypointIndex(1)
to the bottom part of the onLoad section. That should make it always start at 1. Without that, it will start at whichever waypoint it thinks is closer to the player location.

Re: Elven TQ misstake

Posted: Wed Jul 22, 2015 2:47 pm
by Miworax
Dont work.... after he changed first t ime the Character.... he start at Wp 2....

Re: Elven TQ misstake

Posted: Thu Jul 23, 2015 3:15 am
by rock5
It's probably because you don't reload the waypoint. When you change character at waypoint 1 then it will go to waypoint 2. You can reload the waypoint file after changing character, which is what is usually done so that any code in the onload gets run for each character, or if you don't want to reload the file for whatever reason then try adding the "__WPL:setWaypointIndex(1)" just after changing character, ie. after LoginNextChar().

Re: Elven TQ misstake

Posted: Thu Jul 23, 2015 9:53 am
by Miworax
now it work perfectly :) thanks all for this awsome help !