PWI - Resources/Loot Structure

04/25/2012 13:32 Interest07#16
try this:



Code:
        public void moveTo(float X, float Y, float Z, float height = -1.0F)
        {

                int actionStruct = MemFunctions.MemReadInt(processHandle, getPlayerAddress() + off_player_actStruct);
                int actionList = MemFunctions.MemReadInt(processHandle, actionStruct + off_player_actStruct_list);
                int moveAction = MemFunctions.MemReadInt(processHandle, actionList + off_player_actStruct_list_move);

                MemFunctions.MemWriteInt(processHandle, moveAction + off_player_actStruct_list_move_finished, 0);  //action finished = 0
                MemFunctions.MemWriteInt(processHandle, moveAction + off_player_actStruct_list_move_started, 1); //Action start = 1
                MemFunctions.MemWriteFloat(processHandle, moveAction + off_player_actStruct_list_move_X, X); // Set X coord
                MemFunctions.MemWriteFloat(processHandle, moveAction + off_player_actStruct_list_move_Y, Y); // Set Y coord
                MemFunctions.MemWriteFloat(processHandle, moveAction + off_player_actStruct_list_move_Z, Z); // Set Z coord
                MemFunctions.MemWriteFloat(processHandle, moveAction + off_player_actStruct_list_move_height, height); // Set height
                if (height >= 0.0)
                {
                    MemFunctions.MemWriteInt(processHandle, moveAction + off_player_actStruct_list_move_var1, 26625); //Set 1st var for flying up
                    MemFunctions.MemWriteInt(processHandle, moveAction + off_player_actStruct_list_move_var2, 256); // Set 2nd var for flying up
                }
                else
                {
                    MemFunctions.MemWriteInt(processHandle, moveAction + off_player_actStruct_list_move_var1, 26624); //Set 1st var for not flying up
                    MemFunctions.MemWriteInt(processHandle, moveAction + off_player_actStruct_list_move_var2, 65536); // Set 2nd var for not flying up
                }

                MemFunctions.MemWriteInt(processHandle, moveAction + off_player_actStruct_list_move_type, 0); // Set moveType

                MemFunctions.MemWriteInt(processHandle, moveAction + off_player_actStruct_list_move_error1, 0); // Set error
                MemFunctions.MemWriteInt(processHandle, moveAction + off_player_actStruct_list_move_error2, 0); // Set error

                MemFunctions.MemWriteInt(processHandle, actionStruct + off_player_actStruct_newAction, moveAction); // Set new actionType
                MemFunctions.MemWriteInt(processHandle, actionStruct + off_player_actStruct_startNext, 1); // Set next action position to 1
                MemFunctions.MemWriteInt(processHandle, actionStruct + off_player_actStruct_nextAction, moveAction); // Set new actionType
            
        }
where the offsets are as follows:
[Only registered and activated users can see links. Click Here To Register...]
04/25/2012 13:37 dumbfck#17
Quote:
Originally Posted by Sᴡoosh View Post
Interest, do pass me one of those fluffy, white jackets though, will you? :D
Prepare for mad photoshop skillz...
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
04/25/2012 13:50 Sᴡoosh#18
Quote:
Originally Posted by dumbfck View Post
Prepare for mad photoshop skillz...
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
LOL :D

That's actually pretty decent man :D

Nice!
04/25/2012 14:13 Subzero12#19
Wow those offsets are different from the offsets I was using :o
[Only registered and activated users can see links. Click Here To Register...] Was using outdated stuff i guess :)

Edit, with those offsets the char is moving, but he isn't going to the coords I want lol
04/25/2012 14:39 Interest07#20
Quote:
Originally Posted by Subzero12 View Post
Wow those offsets are different from the offsets I was using :o
[Only registered and activated users can see links. Click Here To Register...] Was using outdated stuff i guess :)

Edit, with those offsets the char is moving, but he isn't going to the coords I want lol
You do realise that the coords showing ingame are different from those used internally (by for example functions such as this) I hope. Where is your character going? If it's in the general direction of heavens tear, that means its going to (0, Y, 0)

@dumbfck lmao that's exactly what i had in mind!! Mad photoshop skillz there :chuckles:
04/25/2012 14:45 Subzero12#21
Yes I know it *.*

Found the problem :D there was an error storing a position in one of my classes :)

Thx for the help ;)
04/25/2012 14:50 Interest07#22
Quote:
Originally Posted by Subzero12 View Post
Yes I know it *.*

Found the problem :D there was an error storing a position in one of my classes :)

Thx for the help ;)
grats! glad you got it working :)
04/25/2012 15:04 Subzero12#23
It moves, it gathers resources and it attacks =) (pick loot should be easy too)

Time to start putting things into places and working on the bot logic :D

---- Edit.

One thing, its possible to know when my char is gathering?

For now I'm using a bad approach of using a sleep while gathering, but I wanted a more optimal approach of knowing when the action ends (to help me with the defend section).

Its getting nicer :D already have a neat radius farm bot :o (will post a small clip tomorrow)
04/27/2012 00:39 Subzero12#24
I have some questions for the next steps I want to take:
How to unfreeze window? I just need to write in a certain address?

How can I 'see' if my harvest action has stopped? (to make the bot faster and implement a defend action)

Thx for all the help guys.
04/27/2012 07:53 Interest07#25
Quote:
Originally Posted by Subzero12 View Post
I have some questions for the next steps I want to take:
How to unfreeze window? I just need to write in a certain address?

How can I 'see' if my harvest action has stopped? (to make the bot faster and implement a defend action)

Thx for all the help guys.
You can use the action struct to see if the char is idle. The first action in the list (move ix 0x8 for example) is idle, so if current action is a pointer to the first action in the list your char is doing nothing.

for example:

Code:
        public bool isIdle()
        {
            int actionStruct = MemFunctions.MemReadInt(processHandle, getPlayerAddress() + off_player_actStruct);
            int actionList = MemFunctions.MemReadInt(processHandle, actionStruct + off_player_actStruct_list);
            int idleAction = MemFunctions.MemReadInt(processHandle, actionList);

            return MemFunctions.MemReadInt(processHandle, actionStruct + off_player_actStruct_nextAction) == idleAction; // Set new actionType
        
        }
I wouldn't suggest unfreezing your client, it's a huge resource hog and doesn't benefit a properly built bot. If you insist the way to do it would be something like this, but at the correct address instead of 0x430d98. It basically adjusts the opcode to always render the screen and removes the check. I never used it myself though, so I haven't updated the correct address ever.

Code:
        public void unfreeze()
        {
            byte[] buffer = new byte[] { 0xb0, 1, 0x90 };
            MemFunctions.MemWriteBytes(this.pr_processHandle, 0x430d98, buffer);
        }
04/27/2012 12:33 Subzero12#26
Hmmm I see, then if I want to see if i'm gathering anything I can also see what action I'm making, action type and item ID? (Reading the correct memory addresses)

I will put this to use later and start creating a record farm pattern algorithm :D

Thx
04/27/2012 19:08 Interest07#27
Quote:
Originally Posted by Subzero12 View Post
Hmmm I see, then if I want to see if i'm gathering anything I can also see what action I'm making, action type and item ID? (Reading the correct memory addresses)

I will put this to use later and start creating a record farm pattern algorithm :D

Thx
Yeah, pretty much :)