Page 1 of 1

Bot get stuck while "harvesting" quest item

Posted: Mon Jun 27, 2011 4:55 pm
by Edamh
I am trying to harvest "Aran Grass" for the daily quest "Herbal Supplies". I modeled my waypoint file using the DailyWoods waypoint file.

However, the last couple of times that I ran and left the bot, I came back to a dead character. I watched it today as the script ran, and it seems to get "stuck" while trying to harvest the Aran grass. NOTE: the bot does not get "stuck" at every "Aran Grass" but just at some point during the course of the script.

Here's a snippet of output of the script when the bot got stuck:

Code: Select all

Table not found for ID: 620209
Table not found for ID: 620209
Table not found for ID: 620209
Table not found for ID: 620209
Table not found for ID: 620209
Table not found for ID: 620209
Table not found for ID: 620209
Clearing target.
Table not found for ID: 620209
Table not found for ID: 620209
We found Aran Grass and will harvest it.
The bot just stands there and does not fight back even when aggroed mobs. I had to select and to attack the attacking mob manually before the bot continued to fight back. The bot is even "stuck" that ntbuff is not triggered to auto-heal with potions.

I've attached my waypoint file as follows.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
	function CollectAranGrass()
		while 9 > inventory:itemTotalCount(208487) and player:target_Object("Aran Grass",null,null,false) do
		end
		if inventory:itemTotalCount(208487) == 9 then
			yrest(1000)
			if inventory:itemTotalCount(208487) == 9 then
				player:target_Object("Aran Grass",null,null,false)
			end
		end
	end
</onLoad>
<!-- #  1 -->	<waypoint x="-1841" z="51231" y="164">
	local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()"); 
	if 10 == dailyQuestCount then
      printf ("You've completed "..dailyQuestCount.." out of " .. dailyQuestsPerDay ..    " Waiting for daiy quests to reset...");
      player:rest(180);
	  __WPL:setWaypointIndex(1);
    else
      printf("You've completed "..dailyQuestCount.." out of " .. dailyQuestsPerDay ..    " daily quests, leaving " .. dailyQuestsPerDay - dailyQuestCount .. " quests.");
    end
	</waypoint>
<!-- #  2 -->	<waypoint x="-1884" z="51081" y="163">
		player:target_NPC("Medice Klein");
		player:rest(.5);
		sendMacro("OnClick_QuestListButton(1,1)");	
		sendMacro("ChoiceOption(1,1);");
		sendMacro("CompleteQuest()");             yrest(200);
		sendMacro("CloseWindows()");             yrest(200);
	
	</waypoint>
<!-- #  3 -->	<waypoint x="-1844" z="51195" y="164">	</waypoint>
<!-- #  4 -->	<waypoint x="-1839" z="51447" y="164">	</waypoint>
<!-- #  5 -->	<waypoint x="-2137" z="51519" y="163">	</waypoint>
<!-- #  6 -->	<waypoint x="-2281" z="51638" y="143">	</waypoint>
<!-- #  7 -->	<waypoint x="-2427" z="51666" y="118">	</waypoint>
<!-- #  8 -->	<waypoint x="-2581" z="51519" y="98">	</waypoint>
<!-- #  9 -->	<waypoint x="-2727" z="51516" y="84">	</waypoint>
<!-- # 10 -->	<waypoint x="-2776" z="51584" y="82">	</waypoint>
<!-- # 11 -->	<waypoint x="-2833" z="51622" y="33">	</waypoint>
<!-- # 12 -->	<waypoint x="-2869" z="51630" y="8">	</waypoint>
<!-- # 13 -->	<waypoint x="-3308" z="51629" y="9">	</waypoint>
<!-- # 14 -->	<waypoint x="-3325" z="51690" y="8">	</waypoint>
<!-- # 15 -->	<waypoint x="-3403" z="51786" y="12">	</waypoint>
<!-- # 16 -->	<waypoint x="-3495" z="51857" y="20">	</waypoint>
<!-- # 17 -->	<waypoint x="-3708" z="51861" y="8">	</waypoint>
<!-- # 18 -->	<waypoint x="-3903" z="51775" y="21">	</waypoint>
<!-- # 19 -->	<waypoint x="-4071" z="51790" y="21">	</waypoint>
<!-- # 20 -->	<waypoint x="-4073" z="51825" y="15" tag="harvestMoreGrass">yrest(200);CollectAranGrass()</waypoint>
<!-- # 21 -->	<waypoint x="-4125" z="51851" y="19">	</waypoint>
<!-- # 22 -->	<waypoint x="-4255" z="51811" y="15">yrest(200);CollectAranGrass()</waypoint>
<!-- # 23 -->	<waypoint x="-4468" z="51741" y="15">yrest(200);CollectAranGrass()</waypoint>
<!-- # 24 -->	<waypoint x="-4612" z="51707" y="15">yrest(200);CollectAranGrass()</waypoint>
<!-- # 25 -->	<waypoint x="-4620" z="51714" y="15">	</waypoint>
<!-- # 26 -->	<waypoint x="-4836" z="51621" y="13">	</waypoint>
<!-- # 27 -->	<waypoint x="-4866" z="51563" y="21">yrest(200);CollectAranGrass()</waypoint>
<!-- # 28 -->	<waypoint x="-5119" z="51688" y="8">	</waypoint>
<!-- # 29 -->	<waypoint x="-5098" z="51613" y="18">yrest(200);CollectAranGrass()</waypoint>
<!-- # 30 -->	<waypoint x="-5291" z="51520" y="21">yrest(200);CollectAranGrass()</waypoint>
<!-- # 31 -->	<waypoint x="-5373" z="51530" y="19">yrest(200);CollectAranGrass()</waypoint>
<!-- # 32 -->	<waypoint x="-5418" z="51651" y="11">	</waypoint>
<!-- # 33 -->	<waypoint x="-5597" z="51598" y="8">	</waypoint>
<!-- # 34 -->	<waypoint x="-5019" z="51670" y="8">	</waypoint>
<!-- # 35 -->	<waypoint x="-4644" z="51676" y="17">	</waypoint>
<!-- # 36 -->	<waypoint x="-4327" z="51883" y="8">	</waypoint>
<!-- # 37 -->	<waypoint x="-4114" z="52109" y="8">	</waypoint>
<!-- # 38 -->	<waypoint x="-3997" z="52330" y="17">	</waypoint>
<!-- # 39 -->	<waypoint x="-3883" z="52453" y="18">yrest(200);CollectAranGrass()</waypoint>
<!-- # 40 -->	<waypoint x="-4104" z="52477" y="17">	</waypoint>
<!-- # 41 -->	<waypoint x="-4369" z="52592" y="17">yrest(200);CollectAranGrass()</waypoint>
<!-- # 42 -->	<waypoint x="-4476" z="52612" y="17">	</waypoint>
<!-- # 43 -->	<waypoint x="-4562" z="52758" y="19">yrest(200);CollectAranGrass()</waypoint>
<!-- # 44 -->	<waypoint x="-4482" z="52633" y="18">	</waypoint>
<!-- # 45 -->	<waypoint x="-4358" z="52363" y="28">	</waypoint>
<!-- # 46 -->	<waypoint x="-4106" z="51852" y="18">	</waypoint>
<!-- # 47 -->	<waypoint x="-4071" z="51789" y="22">
	if inventory:itemTotalCount(208487) > 9 then
		yrest(1);
	else
		__WPL:setWaypointIndex(__WPL:findWaypointTag("harvestMoreGrass"));
	end	
	</waypoint>
<!-- # 48 -->	<waypoint x="-3650" z="51836" y="27">	</waypoint>
<!-- # 49 -->	<waypoint x="-3529" z="51841" y="31">	</waypoint>
<!-- # 50 -->	<waypoint x="-3113" z="51819" y="8">	</waypoint>
<!-- # 51 -->	<waypoint x="-2894" z="51652" y="8">	</waypoint>
<!-- # 52 -->	<waypoint x="-2824" z="51625" y="23">	</waypoint>
<!-- # 53 -->	<waypoint x="-2756" z="51567" y="72">	</waypoint>
<!-- # 54 -->	<waypoint x="-2616" z="51409" y="79">	</waypoint>
<!-- # 55 -->	<waypoint x="-2443" z="51640" y="111">	</waypoint>
<!-- # 56 -->	<waypoint x="-2327" z="51657" y="136">	</waypoint>
<!-- # 57 -->	<waypoint x="-2165" z="51544" y="164">	</waypoint>
<!-- # 58 -->	<waypoint x="-1905" z="51464" y="164">	</waypoint>
<!-- # 59 -->	<waypoint x="-1833" z="51424" y="164">	</waypoint>
<!-- # 60 -->	<waypoint x="-1826" z="51236" y="164">	</waypoint>
<!-- # 61 -->	<waypoint x="-1880" z="51085" y="164">				
		player:target_NPC("Medice Klein");
		player:rest(.5);
		sendMacro("OnClick_QuestListButton(3,1)");	
		sendMacro("ChoiceOption(1,1);");
		sendMacro("CompleteQuest()");             yrest(200);
		sendMacro("CloseWindows()");             yrest(200);
	</waypoint>
	
	
</waypoints>
Any thoughts as to why bot is getting stuck and not responding? Thanks.

Re: Bot get stuck while "harvesting" quest item

Posted: Mon Jun 27, 2011 7:42 pm
by rock5
Your CollectAranGrass function doesn't release control until it's finished. It doesn't take into account if you are being attacked. You can fix this 1 of 2 way.

1. The easy solution: the function can release control if you are in combat. This means, after combat, it will move to the next waypoint instead of finishing collecting the item.

Code: Select all

      while 9 > inventory:itemTotalCount(208487) and not player.Battling and player:target_Object("Aran Grass",null,null,false) do
            player:update()
      end
or
2. Deal with the attacker in your loop.

Code: Select all

      while 9 > inventory:itemTotalCount(208487) and player:target_Object("Aran Grass",null,null,false) do
            player:update()
            if player.Battling then
                  player:target(player:findEnemy(true,nil,evalTargetDefault)
                  player:update()
                  player:fight()
            end
      end
To fix the 62xxxx errors try replacing the 2 files here.
http://www.solarstrike.net/phpBB3/viewt ... 778#p22778

Re: Bot get stuck while "harvesting" quest item

Posted: Mon Jun 27, 2011 7:46 pm
by rock5
By the way, 620209 is the new Electrostatic Charge buff id. If you want that skill working properly you should update skills.lua.

Code: Select all

	<skill name="MAGE_ELECTROSTATIC_CHARGE" aslevel="2" skilltab="4" skillnum="3" mana="75" manainc="7.5" cooldown="20" type="buff" buffname="620209" target="self"  />

Re: Bot get stuck while "harvesting" quest item

Posted: Wed Jun 29, 2011 11:27 pm
by Edamh
Thanks for the fixes. I implemented "easy solution" or option 1. Script ran through today without death.