Page 1 of 1

Tomara Tavern Daily Script, need input

Posted: Tue Aug 03, 2010 4:18 pm
by swietlowka
I would really use some tweaking from you guys, it works but its not perfect yet :)

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<!-- Tomara Tavern Daily "Pig in a Pond's Helper" -->
<onLoad>
	repeat questname=RoMScript("TEXT('Sys421030_name')"); yrest(500) until questname 
	repeat npcname=RoMScript("TEXT('Sys114417_name')"); yrest(500) until npcname 
	changeProfileOption("HARVEST_DISTANCE", 40)
</onLoad>

	<!-- #  1 --><waypoint x="-1023" z="2171" tag="Main">
				repeat queststate = getQuestStatus(questname); yrest(500) until queststate
				if queststate == "complete" then
			-- Complete quest
			player:target_NPC(npcname); yrest(1000);
			sendMacro("OnClick_QuestListButton(3, 1)"); yrest(1000); sendMacro("CompleteQuest()"); yrest(2000);
			-- Accept quest
			player:target_NPC(npcname); yrest(1000);
			sendMacro("OnClick_QuestListButton(1, 2)"); yrest(1000); sendMacro("AcceptQuest()"); yrest(2000);
			__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));	
		elseif queststate == "incomplete" then
			-- Collect menus
			__WPL:setWaypointIndex(__WPL:findWaypointTag("Get Menus"))
		else
			-- Accept quest
			player:target_NPC(npcname); yrest(1000);
			sendMacro("OnClick_QuestListButton(1, 2)"); yrest(1000); sendMacro("AcceptQuest()"); yrest(2000);
			__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));	
		end
	</waypoint>
	<!-- #  2 --><waypoint x="-1013" z="2264" tag="Get Menus"> 
			repeat queststate = getQuestStatus(questname); yrest(500) until queststate
			if queststate == "complete" then
	__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
	end
	player:target_Object(114475,7000,true)
	 </waypoint>
	 <waypoint x="-995" z="2266"> </waypoint>
	<!-- #  3 --><waypoint x="-1006" z="2368">  
			repeat queststate = getQuestStatus(questname); yrest(500) until queststate
			if queststate == "complete" then
	__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
		end
	player:target_Object(114475,7000,true)
	</waypoint>
	<!-- #  4 --><waypoint x="-1050" z="2361"> player:target_Object(114475,7000,true) </waypoint>
	<!-- #  5 --><waypoint x="-1062" z="2296"> player:target_Object(114475,7000,true) </waypoint>
	<!-- #  5 --><waypoint x="-1097" z="2281"> </waypoint>
	<!-- #  5 --><waypoint x="-1029" z="2240"> 
		repeat queststate = getQuestStatus(questname); yrest(500) until queststate
		if queststate == "complete" then
	__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
	else
	__WPL:setWaypointIndex(__WPL:findWaypointTag("Get Menus"))
	end
	</waypoint>
</waypoints>
yup i was using Rock5 egg script, but its rewritten in many places to suit my needs...
what i'd like to achieve is to make the bot look more human, doesnt stuck so much, and sleep after 10 dailys done

Re: Tomara Tavern Daily Script, need input

Posted: Tue Aug 03, 2010 5:27 pm
by Wundervice
No shame in using Rock's work as a catalyst :] I learned from "reverse-engineering" it lol. Can be made into a fine template.

Re: Tomara Tavern Daily Script, need input

Posted: Wed Aug 04, 2010 1:53 am
by swietlowka
I always learn from reverse :P thats how I see the world lol xD
Anyway, if someone would be willing to help get it work more swiftly i'd be really glad, also feel free to use it with your bots ofc :)
It work ok now, as it accept and complete the quest after getting all the items, but it runs there with problems probably because of the obstacles inside the tavern, if someone is willing to make a better pattern for it to run ill gladly implement it in this script :)

Re: Tomara Tavern Daily Script, need input

Posted: Wed Aug 04, 2010 2:12 am
by rock5
First I adjusted the path so it doesn't get stuck or bump into tables so much although because it is a narrow path and rombot isn't too accurate it's impossible to avoid a few bumps and getting stuck sometimes.

Then I looked at the logic. You don't want to head to the npc from the 2nd and 3rd tables because there are tables i in the way. You only want to head back to main where you have a clear run to the npc (I moved the 4th menu collection to the other side of the table for just that reason). Also if the quest is complete and it tries to pick up a menu it wastes 7 seconds so you want to avoid that.

Here's my logic.
At table 1:
If coming from the npc the quest wont be complete. If coming from table 4 the quest isn't complete because it should have gone to npc if complete. So the first thing it should do at table 1 is collect a menu. Because it might have finished the quest, we check the status and head to npc if finished.

At table 2:
It should come to table 2 from 1 only if the quest isn't complete so we only need to collect a menu.

At table 3:
The quest might be complete so check if it's complete, if not get menu.

At table 4:
The quest might be complete so check if it's complete, if it is goto npc or else get menu. If it gets a menu the quest might be complete so check again if quest is complete, if so head to npc.

So I ended up with something like this.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<!-- Tomara Tavern Daily "Pig in a Pond's Helper" -->
<onLoad>
	repeat questname=RoMScript("TEXT('Sys421030_name')"); yrest(500) until questname
	repeat npcname=RoMScript("TEXT('Sys114417_name')"); yrest(500) until npcname
	changeProfileOption("HARVEST_DISTANCE", 40)
</onLoad>

	<!-- #  1 --><waypoint x="-1023" z="2171" tag="Main">
	repeat queststate = getQuestStatus(questname); yrest(500) until queststate
	if queststate == "complete" then
		-- Complete quest
		player:target_NPC(npcname); yrest(1000);
		sendMacro("OnClick_QuestListButton(3, 1)"); yrest(1000); sendMacro("CompleteQuest()"); yrest(2000);
		-- Check if Dailies are finished
		repeat dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()") until dailyQuestCount and dailyQuestsPerDay
		if (dailyQuestsPerDay - dailyQuestCount) == 0 then
			player:sleep()
		end
		-- Accept quest
		player:target_NPC(npcname); yrest(1000);
		sendMacro("OnClick_QuestListButton(1, 2)"); yrest(1000); sendMacro("AcceptQuest()"); yrest(2000);
		__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));   
	elseif queststate == "incomplete" then
		-- Collect menus
		__WPL:setWaypointIndex(__WPL:findWaypointTag("Get Menus"))
	else
		-- Accept quest
		player:target_NPC(npcname); yrest(1000);
		sendMacro("OnClick_QuestListButton(1, 2)"); yrest(1000); sendMacro("AcceptQuest()"); yrest(2000);
		__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));   
	end
	</waypoint>
	<!-- #  2 --><waypoint x="-1017" z="2264" tag="Get Menus">
		player:target_Object(114475,7000,true)
		repeat queststate = getQuestStatus(questname); yrest(500) until queststate
		if queststate == "complete" then
			__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
		end
	</waypoint>
	<waypoint x="-985" z="2256"> </waypoint>
	<!-- #  3 --><waypoint x="-1016" z="2373"> 
		player:target_Object(114475,7000,true)
	</waypoint>
	<!-- #  4 --><waypoint x="-1054" z="2368">
		repeat queststate = getQuestStatus(questname); yrest(500) until queststate
		if queststate == "incomplete" then
			player:target_Object(114475,7000,true)
		end
	</waypoint>
	<!-- #  5 --><waypoint x="-1062" z="2318"> -- </waypoint>
	<!-- #  5 --><waypoint x="-1097" z="2265"> </waypoint>
	<!-- #  5 --><waypoint x="-1055" z="2260">
		repeat queststate = getQuestStatus(questname); yrest(500) until queststate
		if queststate == "complete" then
			__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
		else
			player:target_Object(114475,7000,true)
			repeat queststate = getQuestStatus(questname); yrest(500) until queststate
			if queststate == "complete" then
				__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
			else
				__WPL:setWaypointIndex(__WPL:findWaypointTag("Get Menus"))
			end
		end
	</waypoint>
</waypoints>

Re: Tomara Tavern Daily Script, need input

Posted: Wed Aug 04, 2010 3:32 am
by swietlowka
As always i'll check it asap :)
Thx for all your help, and sorry for the PM I though You might be interested in what have I done since I asked you about that before. I didn't mean that You somehow should do it, my point was just to let You know that i work on it and that I used your script for my needs. I will not send another one like that for sure :) Keep the good work guys :)


EDIT:
I though of something, can i somehow make the bot switch channel when i can't find menus(for some time), i mean like more ppl run there for this.

Re: Tomara Tavern Daily Script, need input

Posted: Thu Aug 05, 2010 1:54 am
by swietlowka
Ok it works almost perfectly. Only problem i noticed is that when char is at table #4 (the nearest to the entrance) it for some reason once in couple of runs try to harvest the menu thats upstairs...
Do You guys think that changing HARVEST_DISTANCE to even smaller value could help? or should i change a little the path so it wont touch that non reachable menu?

Re: Tomara Tavern Daily Script, need input

Posted: Thu Aug 05, 2010 2:10 am
by rock5
swietlowka wrote:Ok it works almost perfectly. Only problem i noticed is that when char is at table #4 (the nearest to the entrance) it for some reason once in couple of runs try to harvest the menu thats upstairs...
Do You guys think that changing HARVEST_DISTANCE to even smaller value could help? or should i change a little the path so it wont touch that non reachable menu?
I noticed that too but didn't realize what was making him run around like that. LoL

I'd say try changing the harvest distance a little first.

Re: Tomara Tavern Daily Script, need input

Posted: Thu Aug 05, 2010 3:02 am
by swietlowka
will check it asap an report here after :)

Re: Tomara Tavern Daily Script, need input

Posted: Fri Aug 06, 2010 2:47 am
by swietlowka
Now it works just fine, and doesn't run like mad at table 4, but when there no one around it will harvest menus faster than they spawn :?

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<!-- Tomara Tavern Daily "Pig in a Pond's Helper" -->
<onLoad>
   repeat questname=RoMScript("TEXT('Sys421030_name')"); yrest(500) until questname
   repeat npcname=RoMScript("TEXT('Sys114417_name')"); yrest(500) until npcname
   changeProfileOption("HARVEST_DISTANCE", 30)
</onLoad>

   <!-- #  1 --><waypoint x="-1023" z="2171" tag="Main">
   repeat queststate = getQuestStatus(questname); yrest(500) until queststate
   if queststate == "complete" then
      -- Complete quest
      player:target_NPC(npcname); yrest(1000);
      sendMacro("OnClick_QuestListButton(3, 1)"); yrest(1000); sendMacro("CompleteQuest()"); yrest(2000);
      -- Check if Dailies are finished
      repeat dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()") until dailyQuestCount and dailyQuestsPerDay
      if (dailyQuestsPerDay - dailyQuestCount) == 0 then
         player:sleep()
      end
      -- Accept quest
      player:target_NPC(npcname); yrest(1000);
      sendMacro("OnClick_QuestListButton(1, 2)"); yrest(1000); sendMacro("AcceptQuest()"); yrest(2000);
      __WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));   
   elseif queststate == "incomplete" then
      -- Collect menus
      __WPL:setWaypointIndex(__WPL:findWaypointTag("Get Menus"))
   else
      -- Accept quest
      player:target_NPC(npcname); yrest(1000);
      sendMacro("OnClick_QuestListButton(1, 2)"); yrest(1000); sendMacro("AcceptQuest()"); yrest(2000);
      __WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));   
   end
   </waypoint>
   <!-- #  2 --><waypoint x="-1017" z="2264" tag="Get Menus">
      player:target_Object(114475,7000,true)
      repeat queststate = getQuestStatus(questname); yrest(500) until queststate
      if queststate == "complete" then
         __WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
      end
   </waypoint>
   <waypoint x="-985" z="2256"> </waypoint>
   <!-- #  3 --><waypoint x="-1016" z="2373">
      player:target_Object(114475,7000,true)
   </waypoint>
   <!-- #  4 --><waypoint x="-1054" z="2368">
      repeat queststate = getQuestStatus(questname); yrest(500) until queststate
      if queststate == "incomplete" then
         player:target_Object(114475,7000,true)
      end
   </waypoint>
   <!-- #  5 --><waypoint x="-1062" z="2318"> -- </waypoint>
   <!-- #  5 --><waypoint x="-1097" z="2265"> </waypoint>
   <!-- #  5 --><waypoint x="-1055" z="2260">
      repeat queststate = getQuestStatus(questname); yrest(500) until queststate
      if queststate == "complete" then
         __WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
      else
         player:target_Object(114475,7000,true)
         repeat queststate = getQuestStatus(questname); yrest(500) until queststate
         if queststate == "complete" then
            __WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
         else
            __WPL:setWaypointIndex(__WPL:findWaypointTag("Get Menus"))
         end
      end
   </waypoint>
</waypoints>

Re: Tomara Tavern Daily Script, need input

Posted: Tue Jun 07, 2011 10:06 pm
by jboggan
i like this but is there a way that u can set it to send them to a alt everytime u get 10 using a convenient mailbox?

Re: Tomara Tavern Daily Script, need input

Posted: Tue Jun 07, 2011 10:33 pm
by rock5
I'm not familiar with using the Convenient Mailbox but there have been other posts about it. Try doing a search and see if anyone else has posted instructions on how to use them with rombot.

Re: Tomara Tavern Daily Script, need input

Posted: Tue Jun 07, 2011 11:38 pm
by lisa
arn't all menus bound?

Re: Tomara Tavern Daily Script, need input

Posted: Wed Jun 08, 2011 1:38 am
by jboggan
no they arent, i have done it manually one day like that but i would like it to be able to send them and me go aways

Re: Tomara Tavern Daily Script, need input

Posted: Wed Jun 08, 2011 4:18 pm
by kanta
swietlowka wrote:Now it works just fine, and doesn't run like mad at table 4, but when there no one around it will harvest menus faster than they spawn :?
Could he use this because they are respawning slower than he can collect?

Code: Select all

repeat
until player:target_Object(114475,7000,true)