Page 2 of 9
Re: optimizing golden eggs profit
Posted: Tue Dec 21, 2010 4:23 am
by T_Zero
I think you should pick up the fresh eggs but don't complete the quest.
Just outsource that to an extra script. So the 1st script just collects golden and normal eggs and the other completes the quest. Could save some time and there's the option to not run the 2nd one.
Re: optimizing golden eggs profit
Posted: Tue Dec 21, 2010 5:13 am
by jduartedj
At the moment that's what I do T0.
Re: optimizing golden eggs profit
Posted: Tue Dec 21, 2010 5:14 am
by jduartedj
fobsause,
What do you mean rubber banded? I've never seen heard of it b4.
Re: optimizing golden eggs profit
Posted: Tue Dec 21, 2010 8:30 am
by fobsauce
Urban dictionary put it into words best for me.
This occurs in online gaming when latency is relatively high. Players (or yourself) will appear to move in one direction, and then suddenly be teleported back several feet where they once were a few seconds ago.
Re: optimizing golden eggs profit
Posted: Tue Dec 21, 2010 9:36 am
by jduartedj
Now I understand the concept but i don't see how can that be used to "appear" in places. I supposed that everytime you move there is a server check to 'control' you movements and be sure you simply don't use a hack to place you somewhere else on the client side.
Re: optimizing golden eggs profit
Posted: Tue Dec 21, 2010 9:51 am
by fobsauce
you're exactly right! The server will check to make sure you haven't moved too far. However, in your house, these controls don't exist. You can change your movement speed and teleport freely. I think I'm just going to go ahead and test it out.
Re: optimizing golden eggs profit
Posted: Tue Dec 21, 2010 10:18 am
by fobsauce
So with a bit of testing, you do get rubber banded in the ranch.
However, it will only rubber band you if you try to teleport beyond the maximum distance of 128.
1 <waypoint x="3940" z="3055" tag="Get Feed">
2 <waypoint x="3948" z="3107" tag="Main">
3 <waypoint x="3928" z="3185" tag="Get Eggs">
4 <waypoint x="3929" z="3261"> (actual egg gathering spot)
Notice that these waypoints are less than 128 units away from each other so you could teleport between these waypoints without getting rubber banded.
So you could basically feed a chicken, teleport to get more feed, teleport back to feed the chicken again.
The only issue is that point 2 and point 4 are too far apart so you would instead have to port from 2 to 3, then walk to 4.
Re: optimizing golden eggs profit
Posted: Tue Dec 21, 2010 10:44 am
by jduartedj
fobsauce wrote:So with a bit of testing, you do get rubber banded in the ranch.
However, it will only rubber band you if you try to teleport beyond the maximum distance of 128.
1 <waypoint x="3940" z="3055" tag="Get Feed">
2 <waypoint x="3948" z="3107" tag="Main">
3 <waypoint x="3928" z="3185" tag="Get Eggs">
4 <waypoint x="3929" z="3261"> (actual egg gathering spot)
Notice that these waypoints are less than 128 units away from each other so you could teleport between these waypoints without getting rubber banded.
So you could basically feed a chicken, teleport to get more feed, teleport back to feed the chicken again.
The only issue is that point 2 and point 4 are too far apart so you would instead have to port from 2 to 3, then walk to 4.
mmm maybe you could have it teleport from 2 to 3 and then 4 or from 2 to a 5th and then 4.
Anyway how exactly do you do that? memory edit?
Re: optimizing golden eggs profit
Posted: Tue Dec 21, 2010 11:20 pm
by fobsauce
Been looking to see if micromacro has any functions for editing memory...
please refer me to it if you find it before I do

Re: optimizing golden eggs profit
Posted: Tue Dec 21, 2010 11:58 pm
by Administrator
fobsauce wrote:Been looking to see if micromacro has any functions for editing memory...
please refer me to it if you find it before I do

See the memoryWrite* functions in the wiki.
Re: optimizing golden eggs profit
Posted: Wed Dec 22, 2010 12:25 am
by jduartedj
Wait you mean to say that if we simply edit memory to the place we can teleport within 128 radius! WOOT
well MM is loaded for that like Admin said... Do you know the position addresses already?
Re: optimizing golden eggs profit
Posted: Wed Dec 22, 2010 1:16 am
by fobsauce
Ty for the reference admin.
jduartedj, I don't know where they are exactly but you can start with the getpos script
local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
let's see how this goes...
Re: optimizing golden eggs profit
Posted: Wed Dec 22, 2010 2:53 am
by fobsauce
it works! I'll see what I can do within a day. Gonna be gone for a week.
Also, how would I use:
memoryWriteFloatPtr(myProcess, 0x0D2E0F90, 0xA8, myData);
for multi level pointers? Or should I just find the address, then write to it thereafter...
Edit:
I think it uses the same data in the getpos function.
local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
Client.exe+5B8364, offset 0x598
address, offset 0x4
address,0xB0 (for x) 0xB8 (for y)
Re: optimizing golden eggs profit
Posted: Wed Dec 22, 2010 8:13 am
by jduartedj
I think you want these from CPawn:
Code: Select all
self.X = debugAssert(memoryReadFloat(proc, self.Address + addresses.pawnX_offset), memerrmsg);
self.Y = debugAssert(memoryReadFloat(proc, self.Address + addresses.pawnY_offset), memerrmsg);
self.Z = debugAssert(memoryReadFloat(proc, self.Address + addresses.pawnZ_offset), memerrmsg);
and the respective addresses from addresses.lua:
Code: Select all
pawnX_offset = 0x28,
pawnY_offset = 0x2C,
pawnZ_offset = 0x30,
given that self.address is the player's address. (CPlayer is an extrension of CPAwn).
so I think writing would be:
Code: Select all
memoryWriteFloat(proc, player.Address+addresses.pawnX_offset, value_of_X);
Also the Y coordinate is not really necessary unless you have a mountain in front of you... it's just X,Z
Re: optimizing golden eggs profit
Posted: Wed Dec 22, 2010 8:27 am
by jduartedj
Hmmm it seems whatever code/address I use nothing works for me. I've tried all the usual suspects but as I can't even reproduce it I'm stuck here. Could you post some steps so I can at least reproduce how you did it the first time?
Re: optimizing golden eggs profit
Posted: Wed Dec 22, 2010 10:26 am
by fobsauce
Using Cheat Engine...
Attach to Client.exe
click on the button "Add Address Manually" to open a new window
click the box "Pointer"
click "Add Pointer" twice
Then enter the pointer information.

Re: optimizing golden eggs profit
Posted: Wed Dec 22, 2010 11:16 am
by fobsauce
Insert this into in your first waypoint to teleport to your second waypoint (replace 9999 with your x and z)
offsets = {0x598, 0x4, 0xB0};
memoryWriteFloatPtr(getProc(), 0x9B8364, offsets, 9999); -- x value
offsets = {0x598, 0x4, 0xB8};
memoryWriteFloatPtr(getProc(), 0x9B8364, offsets, 9999); -- z value
For example, at the end of your "Main" waypoint you can insert:
Code: Select all
if 1 > inventory:itemTotalCount(204789) then -- Get more feed
__WPL:setWaypointIndex(__WPL:findWaypointTag("Get Feed"));
offsets = {0x598, 0x4, 0xB0};
memoryWriteFloatPtr(getProc(), 0x9B8364, offsets, 3940); -- x value
offsets = {0x598, 0x4, 0xB8};
memoryWriteFloatPtr(getProc(), 0x9B8364, offsets, 3000); -- z value
else
__WPL:setWaypointIndex(__WPL:findWaypointTag("Get Eggs"))
offsets = {0x598, 0x4, 0xB0};
memoryWriteFloatPtr(getProc(), 0x9B8364, offsets, 3928); -- x value
offsets = {0x598, 0x4, 0xB8};
memoryWriteFloatPtr(getProc(), 0x9B8364, offsets, 3185); -- z value
end
You would also add these to when you're returning to the "Main" waypoint.
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.
Re: optimizing golden eggs profit
Posted: Wed Dec 22, 2010 1:20 pm
by swietlowka
writing memory like that will get someones attention for sure...
in not into it, beside i rather to keep the miller's cake, it gets me less money but i belive it will be enough for the lack of ekstra golden eggs there
Re: optimizing golden eggs profit
Posted: Wed Dec 22, 2010 2:38 pm
by jduartedj
I believe that writing memory won't draw attention since it is checked by the game and it is not allowed if you cross any lines, p/e you cannot do this outside the ranch at all!
Also this doesn't mean you have to give up your miller's cakes, au contraire it just makes the gathering of seed/chickens/eggs faster, you may then choose to pick up the fresh eggs or not, BUT as i recommended you SHOULD pick them up because it causes a memory flood.
This could DRASTICALLY improve the speed of the script and who knows it may be also used in instances!
I think (and this is just my opinion!) that rock5 should put an option in the script to use this or not. OFC I'm assuming this can be used with no apparent problem.
AND thank you fobsauce for all the help so far, atm i'm at work but will test that when i get home.
Re: optimizing golden eggs profit
Posted: Thu Dec 23, 2010 12:52 am
by rock5
jduartedj wrote:I think (and this is just my opinion!) that rock5 should put an option in the script to use this or not.
I have no interest in hacking the game which is basically what this does. I'm only interested in using the bot to do what already can be done manually.
I'll probably eventually add an option to choose if you want to complete the quest or not but probably not for collecting fresh eggs as, has been pointed out, you can collect them while you wait to be able to click the next hen. Although I might add an option to drop the fresh eggs.