Page 1 of 1

Quest problem

Posted: Sat Dec 04, 2010 5:23 am
by wizzyslo
I'm working on new waypoint but have problem with this code:

Code: Select all

	
<!-- # 15 --><waypoint x="3984" z="42544">		
	if getQuestStatus(423674) == "complete" then
			__WPL:setWaypointIndex(__WPL:findWaypointTag("finish"))						
	elseif getQuestStatus(423172) == "complete" then
					__WPL:setWaypointIndex(__WPL:findWaypointTag("finish"))					
	elseif getQuestStatus(423171) == "complete" then
				__WPL:setWaypointIndex(__WPL:findWaypointTag("finish"))
				end;	

	</waypoint>	
I want that is one of those quests is complite and than run to __WPL:setWaypointIndex(__WPL:findWaypointTag("finish"))
What did i do wrong?

Re: Quest problem

Posted: Sat Dec 04, 2010 7:37 am
by rock5
I don't see any errors.

Re: Quest problem

Posted: Sat Dec 04, 2010 10:36 am
by wizzyslo
fixed :D

Code: Select all

     if getQuestStatus("A Lesson") == "complete" then
         __WPL:setWaypointIndex(__WPL:findWaypointTag("finish"))                  
   elseif getQuestStatus("Water Saving Method") == "complete" then
               __WPL:setWaypointIndex(__WPL:findWaypointTag("finish"))               
   elseif getQuestStatus("Too Hungry to Move") == "complete" then
            __WPL:setWaypointIndex(__WPL:findWaypointTag("finish"))
		       else
		__WPL:setWaypointIndex(__WPL:findWaypointTag("farming"))
		end;
No idea whay quest ID was problem.

Re: Quest problem

Posted: Sat Dec 04, 2010 8:05 pm
by rock5
getQuestStatus only accepts names. That's why I usually have something like this at the top of some of my quests.

Code: Select all

questname=RoMScript("TEXT('Sys422386_name')")
Actually, because that seems to be the standard format for the name I could probably modify getQuestStatus to accept ids.

I'll add it to my todo list.

Re: Quest problem

Posted: Sun Dec 05, 2010 4:00 am
by rock5
Added in rev 537. Now accepts Ids.

Re: Quest problem

Posted: Sat Dec 11, 2010 12:10 pm
by wizzyslo
With next code i'm trying do next tings: when I run waypoint that bot check if have daily quests and if he dont have take tham else go farming. But have problem, bot skip <onLoad>

Code: Select all

	<onLoad>
	<!-- #  4 --><waypoint x="9189" z="51499">
	if getQuestStatus("quest_name1") == nil then
                     --somthing else--
		elseif getQuestStatus("quest_name2") == nil then
			--do somthing else--
			else
			 __WPL:setWaypointIndex(__WPL:findWaypointTag("farming"))
			end;
	</waypoint>
	
	
	</onLoad>
How can i fix that? :D

Re: Quest problem

Posted: Sat Dec 11, 2010 6:41 pm
by rock5
You don't put code that needs to be done at a waypoint in the onload section. The waypoint goes outside the onload section.

Also, getQuestStateus should return 'complete', 'incomplet' or 'not accepted'. It shouldn't return nil.

Re: Quest problem

Posted: Sun Dec 12, 2010 5:03 am
by wizzyslo
now it works normal :D Tnx you