Page 7 of 12

Re: Eggs

Posted: Fri Jul 09, 2010 5:54 pm
by qcalex
gloover wrote:
qcalex wrote:sorry stil en progresse but it is simple as abc all the info to change it to cow insted of chiken is in the topics.
and btw in nub in codding so if i could make it so you ;) you just need motivation
Ok, :? I'll try my best.
I don't have the coordinates of herbs, cows etc. Could you give these at least? Furthermore, I don't need to check for missed eggs, so can I skip this part of the script?
instead of running the bot, if you just want to get the x/y position, in bot window do CTR+L then put your char at the place you want then do rom/getpos.lua

here is my start script (still need to complete it but could help you by replacing the **** by the pos youve collected)

**deleted ive got a new ver***

P.S: my script is base on ROCK5 eggs script credit to him

Re: Eggs

Posted: Fri Jul 09, 2010 6:57 pm
by gloover
Big thanx qcalex, I've completed your script with coordinates, but it seems to be a problem accepting the quest in cause of the questname. I'm playing the german version and the name of this quest is "Süße Milch" - micromacro seems not to accepting special characters such like "ß" and "ü". :(

Any germans here, those who know how to solve this problem?

Re: Eggs

Posted: Fri Jul 09, 2010 8:23 pm
by somberland
Einfachste Lösung: Client auf Englisch stellen ;)

Schonmal mit Umschreibung probiert?

Code: Select all

   Lua-Code 	
ä	\195\164	
Ä	\195\132	
ö	\195\182	
Ö	\195\150	
ü	\195\188	
Ü	\195\156	
ß	\195\159	

Re: Eggs

Posted: Fri Jul 09, 2010 9:44 pm
by rock5
gloover wrote:
qcalex wrote:sorry stil en progresse but it is simple as abc all the info to change it to cow insted of chiken is in the topics.
and btw in nub in codding so if i could make it so you ;) you just need motivation
Ok, :? I'll try my best.
I don't have the coordinates of herbs, cows etc. Could you give these at least? Furthermore, I don't need to check for missed eggs, so can I skip this part of the script?
Maybe you could use 'rom/getpos.lua' to get the new positions?

Re: Eggs

Posted: Sat Jul 10, 2010 12:32 am
by qcalex
somberland wrote:

Code: Select all

   Lua-Code 	
ä	\195\164	
Ä	\195\132	
ö	\195\182	
Ö	\195\150	
ü	\195\188	
Ü	\195\156	
ß	\195\159	
here a more complete one :P

Code: Select all

   à : \195\160    è : \195\168    ì : \195\172    ò : \195\178    ù : \195\185
   á : \195\161    é : \195\169    í : \195\173    ó : \195\179    ú : \195\186
   â : \195\162    ê : \195\170    î : \195\174    ô : \195\180    û : \195\187
   ã : \195\163    ë : \195\171    ï : \195\175    õ : \195\181    ü : \195\188
   ä : \195\164                    ñ : \195\177    ö : \195\182
   æ : \195\166                                    ø : \195\184
   ç : \195\167                                    ? : \197\147

   Ä : \195\132
   Ö : \195\150
   Ü : \195\156
   ß : \195\159
and a new script (credit to Reiko, Rock5 and me) Change **** for your pos, ***Grass name*** for the in bag grass name and ***Quest name*** for your quest name.
*Script still in testing*

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<!-- #  1 --><waypoint x="4032" z="3333" tag="from_npc_for_quest">
	</waypoint>
	<!-- #  2 --><waypoint x="4054" z="3333" tag="npc">
		queststate = getQuestStatus("***Quest name***")		
		if queststate == "complete" then
			-- Complete quest
			player:target_NPC("Jessica Miller");
			sendMacro("CompleteQuest()"); yrest(2000);
			-- Accept quest
			player:target_NPC("Jessica Miller");
			sendMacro("AcceptQuest()"); yrest(2000);
			__WPL:setWaypointIndex(__WPL:findWaypointTag("from_npc_for_herb"));	
		elseif queststate == "incomplete" then
			-- Collect herb
			inventory:update()
			if 1 >= inventory:itemTotalCount("***grass name***") then -- Get more herb
				__WPL:setWaypointIndex(__WPL:findWaypointTag("from_npc_for_herb"));	
			else
				__WPL:setWaypointIndex(__WPL:findWaypointTag("from_npc_for_milk"));				
			end
		else
			-- Accept quest
			player:target_NPC("Jessica Miller");
			sendMacro("AcceptQuest()"); yrest(2000);
			__WPL:setWaypointIndex(__WPL:findWaypointTag("from_npc_for_quest"));	
		end		
	</waypoint>
	<!-- #  3 --><waypoint x="****" z="****" tag="from_npc_for_herb">
	</waypoint>	
	<!-- #  4 --><waypoint x="****" z="****" tag="from_herb">
	</waypoint>
	<!-- #  5 --><waypoint x="****" z="****" tag="get_herb">
		while player:target_Object(112954) do			
			player:harvest(112954);			
			yrest(7500);
		end				
	</waypoint>
	<!-- #  6 --><waypoint x="****" z="****" tag="from_npc_for_milk">	
	</waypoint>
	<!-- #  7 --><waypoint x="****" z="****" tag="from_cow" >
	</waypoint>
	<!-- #  8 --><waypoint x="****" z="****" tag="get Milk">
		inventory:update()
		queststate = getQuestStatus("***Quest name***")
		while inventory:itemTotalCount("***Grass Name***") > 1 and queststate == "incomplete"  do
			player:harvest(112952);		
			yrest(7000);
			inventory:update()
			queststate = getQuestStatus("***Quest name***")	
		end		
	</waypoint>
	<!-- #  9 --><waypoint x="****" z="****" tag="from_cow" >
		__WPL:setWaypointIndex(__WPL:findWaypointTag("from_npc_for_quest"));
	</waypoint>
</waypoints>
112952=Cow
112953=Goat

still got problem with the bot loosing his pos in game (appeared from 470 and fixed a little in 471(don't open chat now))

Re: Eggs

Posted: Sat Jul 10, 2010 4:21 am
by DrG

Code: Select all

while inventory:itemTotalCount("***Grass Name***") > 1 and queststate == "incomplete"  do
         player:harvest(112953);    
correct the harvest code of the cow for 112952. :)

Re: Eggs

Posted: Sat Jul 10, 2010 12:41 pm
by Reiko
DrG wrote:

Code: Select all

while inventory:itemTotalCount("***Grass Name***") > 1 and queststate == "incomplete"  do
         player:harvest(112953);    
correct the harvest code of the cow for 112952. :)
the script is faster with the goat, because he's doing less mouvement and turning
and originaly my script is using goat thats why this code was there

if you want to use the cow, you may need to add waypoints to fully work

Re: Eggs

Posted: Mon Jul 12, 2010 8:06 pm
by Starrider
i have problems wih the file from rock5 in some cases the bot doesnt collegt golden eggs.
How to fix this? maybe add a loop for checking if all eggs collegted?

Re: Eggs

Posted: Mon Jul 12, 2010 11:37 pm
by rock5
Starrider wrote:i have problems wih the file from rock5 in some cases the bot doesnt collegt golden eggs.
How to fix this? maybe add a loop for checking if all eggs collegted?
The way my script works is, it should collect the fresh eggs after every hen. When the hens are gone it collects any fresh eggs it missed then collects the gold eggs last.

If it still misses one, it doesn't matter as it will pick it up the next time it comes around.

Re: Eggs

Posted: Tue Jul 13, 2010 1:51 am
by gloover
Starrider wrote:i have problems wih the file from rock5 in some cases the bot doesnt collegt golden eggs.
How to fix this? maybe add a loop for checking if all eggs collegted?
Rock's script is perfect - even collect some eggs twice, although it was one laid!!

My problem is, from time to time (may after 5 min - 1h running) the script cancel himself with this errror message: "[string "..."]:13: attempt to compare nil with number"

What's that supposed to mean?

Re: Eggs

Posted: Tue Jul 13, 2010 1:57 am
by rock5
gloover wrote:
Starrider wrote:i have problems wih the file from rock5 in some cases the bot doesnt collegt golden eggs.
How to fix this? maybe add a loop for checking if all eggs collegted?
Rock's script is perfect - even collect some eggs twice, although it was one laid!!

My problem is, from time to time (may after 5 min - 1h running) the script cancel himself with this errror message: "[string "..."]:13: attempt to compare nil with number"

What's that supposed to mean?
That's not a problem with my script. It is a known issue of rombot that RoMScript sometimes returns nil when it shouldn't. It's hard to fix because sometimes RoMScript is supposed to return nil.

Edit: Actually you can check for nil value by replacing line 3 with;

Code: Select all

		repeat
			queststate = getQuestStatus("An Easy Lay"); yrest(500)
		until queststate ~= nil
Don't forget to change the quest name to match your language.

Re: Eggs

Posted: Tue Jul 13, 2010 11:56 am
by qcalex
for the "don't pickup twice" replace the value:1800 by 1700 work better as Rock5 said

Code: Select all

			while player:target_Object(112958,1700) do
				sendMacro("UseSkill(1,1)") yrest(40)
				sendMacro("UseSkill(1,1)") yrest(40)
				sendMacro("UseSkill(1,1)") yrest(4000)
			end
		end
		while player:target_Object(112958,1700) do -- Check for any missed eggs
			sendMacro("UseSkill(1,1)") yrest(40)
			sendMacro("UseSkill(1,1)") yrest(40)
			sendMacro("UseSkill(1,1)") yrest(3000)
		end
		while player:target_Object(114931,1700) do
			sendMacro("UseSkill(1,1)") yrest(40)
			sendMacro("UseSkill(1,1)") yrest(40)
			sendMacro("UseSkill(1,1)") yrest(3000)
		end
		changeProfileOption("HARVEST_DISTANCE", 75)
	</waypoint>

Re: Eggs

Posted: Tue Jul 13, 2010 12:12 pm
by rock5
qcalex wrote:for the "don't pickup twice" replace the value:1800 by 1700 work better as Rock5 said
Yes definitely, but I've done some more tweaking. Actually why don't I just attach my updated version.

Changes:
- Should work in any language.
- Removed 2nd while loop when collecting eggs as it was obsolete.
- Improved the timing of egg collection.
- Added 'nil' value checks so you shouldn't get any "compared with nil" errors.

Re: Eggs

Posted: Tue Jul 13, 2010 12:19 pm
by wil32
rock5, could you add version to your xml to see where we are going

Re: Eggs

Posted: Tue Jul 13, 2010 12:38 pm
by qcalex
and have you take a look on our milk script? to get it improuved? because reiko found a way to improuve it but we cant touch any "CTR", "ALT" key or the bot crash.

Re: Eggs

Posted: Tue Jul 13, 2010 12:40 pm
by rock5
wil32 wrote:rock5, could you add version to your xml to see where we are going
Ok, done. The file above has been changed but because I don't want to mess with different file names, I've added the version as a comment in the file.

Re: Eggs

Posted: Tue Jul 13, 2010 12:50 pm
by rock5
qcalex wrote:and have you take a look on our milk script? to get it improuved? because reiko found a way to improuve it but we cant touch any "CTR", "ALT" key or the bot crash.
Sure I'll have a look at your milk script. Where is it?

I don't know about "ALT" but there is a known issue with "CTRL". If you are using your pc for something else and you press ctrl while the bot is pressing 's' then it will open chat edit which will end communication for the bot so it crashes.

Administrator says "Disable CTRL+S hotkey in-game. It's used to open up the Say chat.".

Re: Eggs

Posted: Tue Jul 13, 2010 12:56 pm
by qcalex
just a few post above us its in the code line ill make a download one
EDIT: change the **** for the quest name (exept if u use the new method)
and check if i put the right name for the grass (sorry my script is in french )

Re: Eggs

Posted: Tue Jul 13, 2010 4:35 pm
by rock5
qcalex wrote:just a few post above us its in the code line ill make a download one
EDIT: change the **** for the quest name (exept if u use the new method)
and check if i put the right name for the grass (sorry my script is in french )
Here's my version. I changed it quite a lot.

One think I noticed is, because of the double click target_Objects does, it couldn't target the goats. So I removed the double click from the function. So you will probably have to update to revision 472 for this to work.
MillersRanchMilk.xml
Corrected herb harvest command
(1.58 KiB) Downloaded 328 times
Edit: I just realized there is a small mistake. Line 31 should be;

Code: Select all

		player:target_Object(112954,7500,true)
It will still work if you don't change it but will cause delays when targeting the next herb. I updated the above file.

Re: Eggs

Posted: Wed Jul 14, 2010 8:47 am
by DrG
With the rev 472 we still can double pick the eggs?