optimizing golden eggs profit

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Re: optimizing golden eggs profit

#41 Post by Alkaiser » Thu Dec 23, 2010 7:00 pm

fobsauce wrote:I'm also trying to figure out how to teleport on top the of chickens that still need to be fed so you don't have to walk up to them to harvest them. If anyone knows a solution, let me know.
I made a minor change to the target_object function to enable teleporting if target is within 128 units.

Change this:

Code: Select all

				if( distance(self.X, self.Z, obj.X, obj.Z) > 39 ) then
					self:moveInRange(CWaypoint(obj.X, obj.Z), 39, true);
				end
to this:

Code: Select all

				if( distance(self.X, self.Z, obj.X, obj.Z) > 128 ) then
					self:moveInRange(CWaypoint(obj.X, obj.Z), 128, true);
				elseif( distance(self.X, self.Z, obj.X, obj.Z) > 39 ) then
					local offsets = {0x598, 0x4, 0xB0}
					memoryWriteFloatPtr(getProc(), 0x9B8364, offsets, obj.X) -- x value
					offsets = {0x598, 0x4, 0xB8}
					memoryWriteFloatPtr(getProc(), 0x9B8364, offsets, obj.Z) -- z value
				end
It works!

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#42 Post by jduartedj » Thu Dec 23, 2010 11:17 pm

Really nice,
I still got to test it myself but the feedback is great!
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: optimizing golden eggs profit

#43 Post by rock5 » Fri Dec 24, 2010 1:06 am

Even though I probably wont use it, what I like about it is it doesn't teleport to the waypoint but directly to the object. Cool. :)
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#44 Post by jduartedj » Fri Dec 24, 2010 1:19 am

I decided not to use that specific target_object mod because The "rubber badn" effect has fdifferent limitation in different places, instead I'm only Modding the golden eggs script so its teleports everywhere. I'm almost done Will post it here after!
I also Have a new addon many of you might like.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#45 Post by jduartedj » Fri Dec 24, 2010 2:26 am

Ok I've modded the file so far but I'm stuck and can't implement something.
Anyway Here are the files (attached) one is the modded golden eggs file, the other is a teleport addon created by me. This addon is required to run the modded golden eggs file.

Also the code I can't implement properly is:

Code: Select all

			while inventory:itemTotalCount(204789) > 0 and 	player:findNearestNameOrId(112955,feedHenEvalFunc) do
				target = player:getTarget(player:findNearestNameOrId(112955));
				if distance(player.X,player.Z,target.X,target.Z)>10 and feedHenEvalFunc(target.Address) then 
					teleport(target.X,target.Z); --teleport
				end
				player:target_Object(112955,4500,false,true,feedHenEvalFunc) -- Feed Hens
			end
What I wanted to do was for the hen to be targeted before actually feeding it and if the hen is not close to you one would teleport to it and then feed it!

help would be appreciated.
The script works at the moment but doesn't use teleport to feed hens only to go collect feed and to go encourage hens and back from those too ofc.
Attachments
addon_teleport.lua
(892 Bytes) Downloaded 356 times
TMillersRanchGold.xml
(3.73 KiB) Downloaded 273 times
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#46 Post by jduartedj » Fri Dec 24, 2010 6:47 pm

I'm gonna need some feedback and further debugging on these scripts, I found it may happen that they get stuck in a chicken and simply don't proceed. Don't know why though... I've set the time in target_object instead of waiting for castbar...

The teleport addon should be ok.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

nokirk
Posts: 73
Joined: Sat Jul 03, 2010 2:26 pm

Re: optimizing golden eggs profit

#47 Post by nokirk » Sat Dec 25, 2010 8:02 am

love it, it's so cool :) Thx a lot

MinMax
Posts: 46
Joined: Mon Dec 21, 2009 6:45 am

Re: optimizing golden eggs profit

#48 Post by MinMax » Sat Dec 25, 2010 9:18 am

Great idea with the teleport. I tested the egg script.
I have only with the looting of the eggs some problems. Often the char teleports before he has picked up all 3 eggs.

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#49 Post by jduartedj » Sun Dec 26, 2010 10:19 am

before? is it always on the 3rd? if it is try setting the waittime to 1750 or 2000. I use 1500 because it works 4 me.

any1 getting the bot stuck at collecting eggs?
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

MinMax
Posts: 46
Joined: Mon Dec 21, 2009 6:45 am

Re: optimizing golden eggs profit

#50 Post by MinMax » Mon Dec 27, 2010 6:09 am

Addendum:
I testet the script with three opened acc´s on my pc. Therefore i need a delay for 1900.
If there´s only one account open, your waittime of 1500 works perfect.

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#51 Post by jduartedj » Mon Dec 27, 2010 9:10 am

MinMax wrote:Addendum:
I testet the script with three opened acc´s on my pc. Therefore i need a delay for 1900.
If there´s only one account open, your waittime of 1500 works perfect.
mmm I see, I n ow wonder if there is anyway to see how many bots are running? I could auto configure that using an inv. proportional function that increases the time with the number of bots open. I think it's doable.

Code: Select all

waittime_delta = 500/(1.5*n)
this seems to do it, taking n as the number of bots running. so we call target_Object(id,waittime-waittime_delta, ....
this waittime delta gives us a small gain in time but it's exactly what this thread is about, optimizing.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: optimizing golden eggs profit

#52 Post by rock5 » Mon Dec 27, 2010 9:27 am

jduartedj wrote:Also the code I can't implement properly is:

Code: Select all

			while inventory:itemTotalCount(204789) > 0 and 	player:findNearestNameOrId(112955,feedHenEvalFunc) do
				target = player:getTarget(player:findNearestNameOrId(112955));
				if distance(player.X,player.Z,target.X,target.Z)>10 and feedHenEvalFunc(target.Address) then 
					teleport(target.X,target.Z); --teleport
				end
				player:target_Object(112955,4500,false,true,feedHenEvalFunc) -- Feed Hens
			end
I noticed that when you find the hen to feed you use the 'feedHenEvalFunc' but then when you target it, you don't. That could cause problems.
jduartedj wrote:mmm I see, I n ow wonder if there is anyway to see how many bots are running? I could auto configure that using an inv. proportional function that increases the time with the number of bots open. I think it's doable.
That's assuming all PC's perform the same, isn't it? Anyway, I'm confused. player:target_Object has a default wait of 1000ms. I've never had problems collecting eggs with that regardless of the number of clients open. Are you saying that if you use a 'nil' waittime it fails to collect the last egg? Maybe there's something else causing it to fail.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#53 Post by jduartedj » Mon Dec 27, 2010 9:58 am

not at all rock5, When using nil it waits until the cast bar is over, but using a certain waittime delta we can decrease that time. p/e: of encouraging a chicken is a result of a cast bar time of 2000ms, It can be set to 1500 that it works too, assuming you have an avg. computer and almost no lag. in this case i'm using waittime_delta = 500.
using the formula would be 333. And like you said I'm assuming all computers are the same but I'm giving it a low rank for all computers because waittime_delta = 500/n works, but i made it waittimedelta = 500/(1.5*n) to be safe, ie, results in lower waittime_delta.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: optimizing golden eggs profit

#54 Post by rock5 » Mon Dec 27, 2010 11:42 am

jduartedj wrote:not at all rock5, When using nil it waits until the cast bar is over, but using a certain waittime delta we can decrease that time.
To tell you the truth, I'm not sure what you mean by delta, but if a castbar appears it will wait until its gone. In that case, a waittime can only be used to extend that time, ie. if a castbar appears for 2000ms then setting the waittime to 1500ms will result in it still waiting for 2000ms. If you set the waittime to 2500ms, then it will wait 2500ms.
jduartedj wrote: p/e: of encouraging a chicken is a result of a cast bar time of 2000ms, It can be set to 1500 that it works too, assuming you have an avg. computer and almost no lag. in this case i'm using waittime_delta = 500.
using the formula would be 333. And like you said I'm assuming all computers are the same but I'm giving it a low rank for all computers because waittime_delta = 500/n works, but i made it waittimedelta = 500/(1.5*n) to be safe, ie, results in lower waittime_delta.
I thought we were talking about eggs. Encouraging the chickens is another matter, it's a special case. Even though the castbar appears for only 2000ms or whatever it is, it's a few more seconds before you can click the next hen, which should give you plenty of time to collect the eggs so I'm not sure what you are trying to accomplish by trying to reduce the waittime. Actually by my calculations your example checks if the hen can be encouraged every 2000ms whereas my script checks every 1500ms.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#55 Post by jduartedj » Mon Dec 27, 2010 12:53 pm

What I mean by delta is:

While the cast bar disappears and the bot starts doing something else.
lets say the bot encourages the chicken and then collects it's egg. While the cast bar is on until it is finished and moving to the next step, it takes roughly 2000ms, whereas if you make the time 1500 manually it'll start doing the next task, collecting the egg right away, delta is this diff between the 2000 and the 1500.

But what ur sayin is makeing more sense, I though the cst bar would actually take 2000 ms, but you say it takes 1500 so I think it indeed takes 1500 but the lag/performance/etc makes the value to be bigger.

Anyway does your castbar check take any romscript or aything that takes >500ms to check when you set waittime to nil instead of putting a manual time? Because i think that my "delta" comes from that.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#56 Post by jduartedj » Mon Dec 27, 2010 12:57 pm

In another note With the teleport hack I'm getting some bugs like unclickable chickens/eggs and this make the bot get stuck. Any1 else getting this?
EDIT: this first issue was fixed after I made the bot go collect some more feed for that specific chicken.

also sometimes i get a bug in which the object is clickable but the bot just stands there and does nothing as if it couldn't click the chicken, thus also sticking the bot. any ideas on what causes this?
EDIT: sometimes this second issue is automatically fixed when I take the minimized window into focus (restored).
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: optimizing golden eggs profit

#57 Post by rock5 » Mon Dec 27, 2010 9:57 pm

jduartedj wrote:What I mean by delta is:

While the cast bar disappears and the bot starts doing something else.
lets say the bot encourages the chicken and then collects it's egg. While the cast bar is on until it is finished and moving to the next step, it takes roughly 2000ms, whereas if you make the time 1500 manually it'll start doing the next task, collecting the egg right away, delta is this diff between the 2000 and the 1500.
So you are saying that by setting the waittime to 1500ms you reduced the time by 500ms? That shouldn't happen because either way target_Object will wait until the castingbar disappears then continue. Are you 100% sure that it reduces the time?
jduartedj wrote:But what ur sayin is makeing more sense, I though the cst bar would actually take 2000 ms, but you say it takes 1500 so I think it indeed takes 1500 but the lag/performance/etc makes the value to be bigger.
No what I was saying was, after it's clicked the hen and collected the first egg, that's how often it checks to see if the next hen is clickable. The way it should work is it should click the first hen, then immediately after the castingbar disappears, collect the first egg. Then it loops 1500ms in the 'while' loop until it can click the next hen. Optimizing the waittime is not really possible as, when I was testing it, I found the time before the next hen is clickable was variable.
jduartedj wrote:Anyway does your castbar check take any romscript or aything that takes >500ms to check when you set waittime to nil instead of putting a manual time? Because i think that my "delta" comes from that.
There are no RoMScript commands in player:target_Object besides the 'UseSkill(1,1)' commands. Actually, if you are looking for delays, if there is a waittime and the castingbar doesn't appear(like what happens with the coop hens), it will try the RoMScript("UseSkill(,1,1)") command again. So having a waittime will cause an extra RoMScript on the second and third hens.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#58 Post by jduartedj » Tue Dec 28, 2010 9:13 am

Interesting, you just turned all my beliefs upside down! thankfully! I will have to do a bit of research on that. I understand now.

What is worrying me the most is the pause it makes, as sometimes when it's targeting hens it pauses a while before targeting. sometimes that pause is long and makes the bot get stuck. I'll have a closer look at target_Object function.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#59 Post by jduartedj » Tue Dec 28, 2010 10:37 am

On a related note, rock5, if I set the feedbag waittime to nill it doesn't get the bag! it stops at 2000 ms aprox. and tries again. Any thoughts on this? I have to set it to 4000-4500.
But the eggs work fine with nil.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: optimizing golden eggs profit

#60 Post by jduartedj » Tue Dec 28, 2010 10:51 am

Just a quick update using nill while collecting eggs is proven to be better so:
[attachement removed]
refer to the 1st post for the updated script

Updated the Addon repo.
Attachments
TMillersRanchGold.xml
(3.73 KiB) Downloaded 336 times
Last edited by jduartedj on Thu Dec 30, 2010 12:34 pm, edited 1 time in total.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest