CLEO Help Help with bone...

CLEO related
Status
Not open for further replies.

Parazitas

God
Joined
Jan 2, 2017
Messages
3,115
Solutions
5
Reaction score
879
Location
Lithuania
Who know were is promblem?

PHP:
{$CLEO .cs}

0000:





WHILE TRUE
    WAIT 0
IF
0AD2: 3@ = player $PLAYER_CHAR targeted_actor //IF and SET
THEN
    IF and
    8118:   actor 3@ dead
    8B5C:  samp not is_player 3@ paused
    THEN
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 3@ BONE 24 _STORE_TO 5@ 6@ 7@  // RIGHT HAND
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 3@ BONE 34 _STORE_TO 8@ 9@ 16@  // LEFT HAND
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 3@ BONE 23 _STORE_TO 8@ 9@ 17@  // LEFT SHOULDER
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 3@ BONE 23 _STORE_TO 11@ 12@ 18@  // rIGHT SHOULDER
        call @crosshair_coords 0 x_out 0@ y_out 1@
        IF OR
        0509: 17@ = distance_between_XY 5@ 6@ and_XY 0@ 1@
        0509: 17@ = distance_between_XY 8@ 9@ and_XY 0@ 1@
        0509: 17@ = distance_between_XY 11@ 12@ and_XY 0@ 1@
        0509: 17@ = distance_between_XY 13@ 14@ and_XY 0@ 1@
        THEN
            0AF8: "DISTANCE DETECTED !" -1
        END
    END
END

END

:crosshair_coords
0A8D: 23@ = read_memory 0xC9C040 size 4 virtual_protect 0 //x screen
0A8D: 24@ = read_memory 0xC9C044 size 4 virtual_protect 0 //y screen
0A8D: 25@ = read_memory 0xB6EC14 size 4 virtual_protect 0 
0A8D: 26@ = read_memory 0xB6EC10 size 4 virtual_protect 0 
0093: 22@ = integer 23@ to_float@
006F: 22@ *= 25@
0093: 29@ = integer 23@ to_float
29@ *= 0.0015625
29@ *= 64.0
29@ *= 0.2                            
29@ *= 0.1
0063: 22@ -= 29@  // (float)
///////
0093: 10@ = integer 24@ to_float
006F: 10@ *= 26@
0093: 11@ = integer 24@ to_float
11@ *= 0.002232143
11@ *= 64.0
11@ *= 0.2                            
11@ *= 0.1
0063: 10@ -= 11@  // (float)
ret 2 22@ 10@

:GET_BONE_POS
0085: 10@ = 0@ // (int)
0085: 15@ = 1@ // (int)
1@ = 0.0 // X offset
2@ = 0.0 // Y offset {THX TO: WESSER}
3@ = 0.0 // Z offset
0A96: 0@ = actor 10@ struct
0AC7: 4@ = var 1@ offset
0AA6: call_method 0x5E01C0 struct 0@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 15@ vOffset 4@ // CPed__getBonePositionWithOffset
0AB2: retn 3 1@ 2@ 3@ 
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
PHP:
       0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 3@ BONE 23 _STORE_TO 8@ 9@ 17@  // LEFT SHOULDER
       0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 3@ BONE 23 _STORE_TO 11@ 12@ 18@  // rIGHT SHOULDER

> BONE 23
bone ids are the same
this one returns 3d coordinates of given bone

PHP:
call @crosshair_coords 0 x_out 0@ y_out 1@

meanwhile this one returns 2d screen coordinates of crosshair pos

PHP:
   0509: 17@ = distance_between_XY 13@ 14@ and_XY 0@ 1@

this opcode returns distance, why would you even use it as a condition? anyway you're trying to compare 2d and 3d coords, which is kinda incorrect, if you want to compare them properly, you'd need to translate 13@ 14@ and 15@ into 2d coords (theres a function or opcode for that, calcScreenCords)
anyway this whole cycle is soooooo performance consuming
if i understood this code correctly - you want to get the distance between you and enemy, so you better calculate it a bit different (geometry, here we go)

theres also some other mistakes including variable overwrite and empty\unused variable comparison (in IF OR condition), you sure you do know basics of programming?
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,115
Solutions
5
Reaction score
879
Location
Lithuania
supahdupahnubah said:
PHP:
       0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 3@ BONE 23 _STORE_TO 8@ 9@ 17@  // LEFT SHOULDER
       0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 3@ BONE 23 _STORE_TO 11@ 12@ 18@  // rIGHT SHOULDER

> BONE 23
bone ids are the same
this one returns 3d coordinates of given bone

PHP:
call @crosshair_coords 0 x_out 0@ y_out 1@

meanwhile this one returns 2d screen coordinates of crosshair pos

PHP:
   0509: 17@ = distance_between_XY 13@ 14@ and_XY 0@ 1@

this opcode returns distance, why would you even use it as a condition? anyway you're trying to compare 2d and 3d coords, which is kinda incorrect, if you want to compare them properly, you'd need to translate 13@ 14@ and 15@ into 2d coords (theres a function or opcode for that, calcScreenCords)
anyway this whole cycle is soooooo performance consuming
if i understood this code correctly - you want to get the distance between you and enemy, so you better calculate it a bit different (geometry, here we go)

theres also some other mistakes including variable overwrite and empty\unused variable comparison (in IF OR condition), you sure you do know basics of programming?

I just trying make like Triggerfinger but with player bone.
When my crosshair is on RIGHT HAND, LEFT HAND, LEFT SHOULDER,  RIGHT SHOULDER then send auto shoot.
@supahdupahnubah

P.S. I'am not sure about.. , need convert call @crosshair_coords 0 x_out 21@ y_out 22@ to 2D cords?

PHP:
{$CLEO .cs}

0000:





WHILE TRUE
    WAIT 0
IF
0AD2: 0@ = player $PLAYER_CHAR targeted_actor //IF and SET
THEN
    IF AND
    8118:   actor 0@ dead
    8B5C:  samp not is_player 0@ paused
    THEN ////////////////////////////////////////// Get Bone coords //////////////////////////////////////////
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 24 _STORE_TO 1@ 2@ 3@  // RIGHT HAND
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 34 _STORE_TO 4@ 5@ 6@  // LEFT HAND
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 32 _STORE_TO 7@ 8@ 9@  // LEFT SHOULDER
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 22 _STORE_TO 10@ 11@ 12@  // RIGHT SHOULDER
        //////////////////////////////////////// Convert bones coords ////////////////////////////////////////
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 1@ Y 2@ Z 3@ store_screen_X_to 13@ Y_to 14@
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 4@ Y 5@ Z 6@ store_screen_X_to 15@ Y_to 16@
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 7@ Y 8@ Z 9@ store_screen_X_to 17@ Y_to 18@
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 10@ Y 1@ Z 12@ store_screen_X_to 19@ Y_to 20@
        //////////////////////////////////////// Get crosshair coords ////////////////////////////////////////
        call @crosshair_coords 0 x_out 21@ y_out 22@
        //////////////////////////////////////// Convert crosshair coords ////////////////////////////////////
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 21@ Y 22@ Z $NOT_USED store_screen_X_to 23@ Y_to 24@
        IF AND
        0045: 23@ == 13@ /// Crosshair X and Bone X coords 
        0045: 24@ == 14@ /// Crosshair Y and Bone Y coords 
        THEN
            PRINTF "Your crosshair is on player ~r~RIGHT HAND ! " 2000
        END
        
        IF AND
        0045: 23@ == 15@ /// Crosshair X and Bone X coords 
        0045: 24@ == 16@ /// Crosshair Y and Bone Y coords  
        THEN
            PRINTF "Your crosshair is on player ~r~LEFT HAND ! " 2000
        END
        
        IF AND
        0045: 23@ == 17@ /// Crosshair X and Bone X coords 
        0045: 24@ == 18@ /// Crosshair Y and Bone Y coords 
        THEN
            PRINTF "Your crosshair is on player ~r~RIGHT SHOULDER ! " 2000
        END
        
        IF AND
        0045: 23@ == 17@ /// Crosshair X and Bone X coords 
        0045: 24@ == 18@ /// Crosshair Y and Bone Y coords  
        THEN
            PRINTF "Your crosshair is on player ~r~LEFT SHOULDER ! " 2000
        END
        
    END
END

END

:crosshair_coords
0A8D: 23@ = read_memory 0xC9C040 size 4 virtual_protect 0 //x screen
0A8D: 24@ = read_memory 0xC9C044 size 4 virtual_protect 0 //y screen
0A8D: 25@ = read_memory 0xB6EC14 size 4 virtual_protect 0 
0A8D: 26@ = read_memory 0xB6EC10 size 4 virtual_protect 0 
0093: 22@ = integer 23@ to_float@
006F: 22@ *= 25@
0093: 29@ = integer 23@ to_float
29@ *= 0.0015625
29@ *= 64.0
29@ *= 0.2                            
29@ *= 0.1
0063: 22@ -= 29@  // (float)
///////
0093: 10@ = integer 24@ to_float
006F: 10@ *= 26@
0093: 11@ = integer 24@ to_float
11@ *= 0.002232143
11@ *= 64.0
11@ *= 0.2                            
11@ *= 0.1
0063: 10@ -= 11@  // (float) 
ret 2 22@ 10@

//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@
:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@

:GET_BONE_POS
0085: 10@ = 0@ // (int)
0085: 15@ = 1@ // (int)
1@ = 0.0 // X offset
2@ = 0.0 // Y offset {THX TO: WESSER}
3@ = 0.0 // Z offset
0A96: 0@ = actor 10@ struct
0AC7: 4@ = var 1@ offset
0AA6: call_method 0x5E01C0 struct 0@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 15@ vOffset 4@ // CPed__getBonePositionWithOffset
0AB2: retn 3 1@ 2@ 3@  
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Parazitas said:
I just trying make like Triggerfinger but with player bone.
When my crosshair is on RIGHT HAND, LEFT HAND, LEFT SHOULDER,  RIGHT SHOULDER then send auto shoot.
@supahdupahnubah

PHP:
{$CLEO .cs}

0000:





WHILE TRUE
    WAIT 0
IF
0AD2: 0@ = player $PLAYER_CHAR targeted_actor //IF and SET
THEN
    IF AND
    8118:   actor 0@ dead
    8B5C:  samp not is_player 0@ paused
    THEN ////////////////////////////////////////// Get Bone coords //////////////////////////////////////////
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 24 _STORE_TO 1@ 2@ 3@  // RIGHT HAND
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 34 _STORE_TO 4@ 5@ 6@  // LEFT HAND
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 32 _STORE_TO 7@ 8@ 9@  // LEFT SHOULDER
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 22 _STORE_TO 10@ 11@ 12@  // RIGHT SHOULDER
        //////////////////////////////////////// Convert bones coords ////////////////////////////////////////
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 1@ Y 2@ Z 3@ store_screen_X_to 13@ Y_to 14@
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 4@ Y 5@ Z 6@ store_screen_X_to 15@ Y_to 16@
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 7@ Y 8@ Z 9@ store_screen_X_to 17@ Y_to 18@
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 10@ Y 1@ Z 12@ store_screen_X_to 19@ Y_to 20@
        //////////////////////////////////////// Get crosshair coords ////////////////////////////////////////
        call @crosshair_coords 0 x_out 21@ y_out 22@
        //////////////////////////////////////// Convert crosshair coords ////////////////////////////////////
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 21@ Y 22@ Z $NOT_USED store_screen_X_to 23@ Y_to 24@
        IF AND
        0045: 23@ == 13@ /// Crosshair X and Bone X coords 
        0045: 24@ == 14@ /// Crosshair Y and Bone Y coords 
        THEN
            PRINTF "Your crosshair is on player ~r~RIGHT HAND ! " 2000
        END
        
        IF AND
        0045: 23@ == 15@ /// Crosshair X and Bone X coords 
        0045: 24@ == 16@ /// Crosshair Y and Bone Y coords  
        THEN
            PRINTF "Your crosshair is on player ~r~LEFT HAND ! " 2000
        END
        
        IF AND
        0045: 23@ == 17@ /// Crosshair X and Bone X coords 
        0045: 24@ == 18@ /// Crosshair Y and Bone Y coords 
        THEN
            PRINTF "Your crosshair is on player ~r~RIGHT SHOULDER ! " 2000
        END
        
        IF AND
        0045: 23@ == 17@ /// Crosshair X and Bone X coords 
        0045: 24@ == 18@ /// Crosshair Y and Bone Y coords  
        THEN
            PRINTF "Your crosshair is on player ~r~LEFT SHOULDER ! " 2000
        END
        
    END
END

END

:crosshair_coords
0A8D: 23@ = read_memory 0xC9C040 size 4 virtual_protect 0 //x screen
0A8D: 24@ = read_memory 0xC9C044 size 4 virtual_protect 0 //y screen
0A8D: 25@ = read_memory 0xB6EC14 size 4 virtual_protect 0 
0A8D: 26@ = read_memory 0xB6EC10 size 4 virtual_protect 0 
0093: 22@ = integer 23@ to_float@
006F: 22@ *= 25@
0093: 29@ = integer 23@ to_float
29@ *= 0.0015625
29@ *= 64.0
29@ *= 0.2                            
29@ *= 0.1
0063: 22@ -= 29@  // (float)
///////
0093: 10@ = integer 24@ to_float
006F: 10@ *= 26@
0093: 11@ = integer 24@ to_float
11@ *= 0.002232143
11@ *= 64.0
11@ *= 0.2                            
11@ *= 0.1
0063: 10@ -= 11@  // (float) 
ret 2 22@ 10@

//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@
:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@

:GET_BONE_POS
0085: 10@ = 0@ // (int)
0085: 15@ = 1@ // (int)
1@ = 0.0 // X offset
2@ = 0.0 // Y offset {THX TO: WESSER}
3@ = 0.0 // Z offset
0A96: 0@ = actor 10@ struct
0AC7: 4@ = var 1@ offset
0AA6: call_method 0x5E01C0 struct 0@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 15@ vOffset 4@ // CPed__getBonePositionWithOffset
0AB2: retn 3 1@ 2@ 3@  

You don't really need to translate your crosshair coords into 2d since they are already 2d O-O

        0045: 23@ == 15@ /// Crosshair X and Bone X coords 
        0045: 24@ == 16@ /// Crosshair Y and Bone Y coords  
That's exactly means your triggerbot has 1 pixel of screen FOV
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,115
Solutions
5
Reaction score
879
Location
Lithuania
supahdupahnubah said:
Parazitas said:
I just trying make like Triggerfinger but with player bone.
When my crosshair is on RIGHT HAND, LEFT HAND, LEFT SHOULDER,  RIGHT SHOULDER then send auto shoot.
@supahdupahnubah

PHP:
{$CLEO .cs}

0000:





WHILE TRUE
    WAIT 0
IF
0AD2: 0@ = player $PLAYER_CHAR targeted_actor //IF and SET
THEN
    IF AND
    8118:   actor 0@ dead
    8B5C:  samp not is_player 0@ paused
    THEN ////////////////////////////////////////// Get Bone coords //////////////////////////////////////////
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 24 _STORE_TO 1@ 2@ 3@  // RIGHT HAND
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 34 _STORE_TO 4@ 5@ 6@  // LEFT HAND
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 32 _STORE_TO 7@ 8@ 9@  // LEFT SHOULDER
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 22 _STORE_TO 10@ 11@ 12@  // RIGHT SHOULDER
        //////////////////////////////////////// Convert bones coords ////////////////////////////////////////
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 1@ Y 2@ Z 3@ store_screen_X_to 13@ Y_to 14@
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 4@ Y 5@ Z 6@ store_screen_X_to 15@ Y_to 16@
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 7@ Y 8@ Z 9@ store_screen_X_to 17@ Y_to 18@
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 10@ Y 1@ Z 12@ store_screen_X_to 19@ Y_to 20@
        //////////////////////////////////////// Get crosshair coords ////////////////////////////////////////
        call @crosshair_coords 0 x_out 21@ y_out 22@
        //////////////////////////////////////// Convert crosshair coords ////////////////////////////////////
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 21@ Y 22@ Z $NOT_USED store_screen_X_to 23@ Y_to 24@
        IF AND
        0045: 23@ == 13@ /// Crosshair X and Bone X coords 
        0045: 24@ == 14@ /// Crosshair Y and Bone Y coords 
        THEN
            PRINTF "Your crosshair is on player ~r~RIGHT HAND ! " 2000
        END
        
        IF AND
        0045: 23@ == 15@ /// Crosshair X and Bone X coords 
        0045: 24@ == 16@ /// Crosshair Y and Bone Y coords  
        THEN
            PRINTF "Your crosshair is on player ~r~LEFT HAND ! " 2000
        END
        
        IF AND
        0045: 23@ == 17@ /// Crosshair X and Bone X coords 
        0045: 24@ == 18@ /// Crosshair Y and Bone Y coords 
        THEN
            PRINTF "Your crosshair is on player ~r~RIGHT SHOULDER ! " 2000
        END
        
        IF AND
        0045: 23@ == 17@ /// Crosshair X and Bone X coords 
        0045: 24@ == 18@ /// Crosshair Y and Bone Y coords  
        THEN
            PRINTF "Your crosshair is on player ~r~LEFT SHOULDER ! " 2000
        END
        
    END
END

END

:crosshair_coords
0A8D: 23@ = read_memory 0xC9C040 size 4 virtual_protect 0 //x screen
0A8D: 24@ = read_memory 0xC9C044 size 4 virtual_protect 0 //y screen
0A8D: 25@ = read_memory 0xB6EC14 size 4 virtual_protect 0 
0A8D: 26@ = read_memory 0xB6EC10 size 4 virtual_protect 0 
0093: 22@ = integer 23@ to_float@
006F: 22@ *= 25@
0093: 29@ = integer 23@ to_float
29@ *= 0.0015625
29@ *= 64.0
29@ *= 0.2                            
29@ *= 0.1
0063: 22@ -= 29@  // (float)
///////
0093: 10@ = integer 24@ to_float
006F: 10@ *= 26@
0093: 11@ = integer 24@ to_float
11@ *= 0.002232143
11@ *= 64.0
11@ *= 0.2                            
11@ *= 0.1
0063: 10@ -= 11@  // (float) 
ret 2 22@ 10@

//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@
:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@

:GET_BONE_POS
0085: 10@ = 0@ // (int)
0085: 15@ = 1@ // (int)
1@ = 0.0 // X offset
2@ = 0.0 // Y offset {THX TO: WESSER}
3@ = 0.0 // Z offset
0A96: 0@ = actor 10@ struct
0AC7: 4@ = var 1@ offset
0AA6: call_method 0x5E01C0 struct 0@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 15@ vOffset 4@ // CPed__getBonePositionWithOffset
0AB2: retn 3 1@ 2@ 3@  

You don't really need to translate your crosshair coords into 2d since they are already 2d O-O

        0045: 23@ == 15@ /// Crosshair X and Bone X coords 
        0045: 24@ == 16@ /// Crosshair Y and Bone Y coords  
That's exactly means your triggerbot has 1 pixel of screen FOV

I tested that and yes i see FOV bad when use  0045:   ...
So maybe you can you explain how i must do?

PHP:
        IF AND /// FOV - Fiel OF View
        0045: 21@ == 15@ /// Crosshair X and Bone X coords 
        0045: 22@ == 16@ /// Crosshair Y and Bone Y coords  
        THEN
            PRINTF "Your crosshair is on player ~r~LEFT HAND ! " 2000
        END
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,115
Solutions
5
Reaction score
879
Location
Lithuania
supahdupahnubah said:
it's 4:53 am and i became really lazy and creative, so heres my microsoft paint skills - https://imgur.com/a/UoAxX

"Wet Dream" - nice :D
Don't understand what you writed with paint o_O
 

WaTTi

Well-known member
Joined
Jan 4, 2015
Messages
260
Reaction score
8
@supahdupahnubah something like this ?

Code:
const
FOV = 2@
end
FOV = 20.0

0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 24 _STORE_TO 7@ 8@ 9@  // RIGHT HAND
0AB1: @getScreenXYFrom3DCoords 3 3D_coords_X 7@ 8@ 9@ store_screen_X_to 10@ Y_to 11@
12@ = 329.100
0065: 12@ -= FOV  //X NEGATIVA
13@ = 169.100
0065: 13@ -= FOV //Y NEGATIVA
14@ = 329.100
005D: 14@ += FOV //X POSITIVA
15@ = 169.100
005D: 15@ += FOV // Y POSITIVA
IF AND
0025: 14@ > 10@  // (float)
8025: not 12@ > 10@  // (float)
0025: 15@ > 11@  // (float)
8025: not 13@ > 11@  // (float)
THEN
    // "youre aimingsomeshit"
END
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,115
Solutions
5
Reaction score
879
Location
Lithuania
supahdupahnubah said:
it's 4:53 am and i became really lazy and creative, so heres my microsoft paint skills - https://imgur.com/a/UoAxX

@Springfield
@supahdupahnubah
If i correctly understand this picture that must be like that.:

PHP:
        ////////////////////////////////////////// Get Bone coords //////////////////////////////////////////
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 24 _STORE_TO 1@ 2@ 3@  // RIGHT HAND
        //////////////////////////////////////// Convert bones coords ////////////////////////////////////////
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 1@ Y 2@ Z 3@ store_screen_X_to 13@ Y_to 14@
        //////////////////////////////////////// Get crosshair coords ////////////////////////////////////////
        call @crosshair_coords 0 x_out 21@ y_out 22@
        
        //////////////////////////////////////// Final checks and send auto shoot ////////////////////////////////////////
        21@ - 20
        22@ + 20
        13@ + 20
        14@ - 20
        IF 13@ > 0
        THEN
            IF 14@ > 0
            THEN
                IF AND
                13@ >= 21@
                13@ <= 22@
                14@ >= 22@
                14@ <= 22@
                THEN
                    PRINTF "Your crosshair is on player ~r~RIGHT HAND ! " 2000
                END
            END
        END

Edited.:
So this " [font=Monaco, Consolas, Courier, monospace]<=[/font] " opcode don't exist o_O

Can explane what wrong now?
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
@WaTTi's calculations almost right, "IF AND" block should be opposite instead :
0025: 10@ > 14@ // (float)
8025: not 10@ > 12@ // (float)
0025: 11@ > 15@ // (float)
8025: not 11@ > 13@ // (float)

I bet it should work
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,115
Solutions
5
Reaction score
879
Location
Lithuania
supahdupahnubah said:
@WaTTi's calculations almost right, then "IF AND" block should be opposite instead :
0025: 10@ > 14@  // (float)
8025: not 10@ > 12@  // (float)
0025: 11@ > 15@  // (float)
8025: not 11@ > 13@  // (float)

I bet it should work

1. For me this don't work.
2. Can you help finish my calculate

WaTTi's :
PHP:
{$CLEO .cs}
0000:

REPEAT
wait 0
UNTIL 0AFA:

const
FOV = 2@
end
FOV = 20.0

WHILE TRUE
    WAIT 0
IF
0AD2: 0@ = player $PLAYER_CHAR targeted_actor //IF and SET
THEN
    IF
    8118: NOT actor 0@ dead
    THEN
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 24 _STORE_TO 7@ 8@ 9@  // RIGHT HAND
        0AB1: @getScreenXYFrom3DCoords 3 3D_coords_X 7@ 8@ 9@ store_screen_X_to 10@ Y_to 11@
        12@ = 329.100
        0065: 12@ -= FOV  //X NEGATIVA
        13@ = 169.100
        0065: 13@ -= FOV //Y NEGATIVA
        14@ = 329.100
        005D: 14@ += FOV //X POSITIVA
        15@ = 169.100
        005D: 15@ += FOV // Y POSITIVA
        IF AND
        0025: 10@ > 14@ // (float)
        8025: not 10@ > 12@ // (float)
        0025: 11@ > 15@ // (float)
        8025: not 11@ > 13@ // (float)
        THEN
            23@ = 0xB73458 
            23@ += 34 // FIRE_BULLET
            0A8C: write_memory 23@ size 4 value 255 virtual_protect 0 
            WAIT 100
            0A8D: 24@ = read_memory 0xB6F3B8 size 4 virtual_protect 0
            24@ += 0x79C
            0A8C: write_memory 24@ size 4 value 0 virtual_protect 0
        END
    END
END

END
        
        
//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@
:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@

//0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 24 _STORE_TO 1@ 2@ 3@
:GET_BONE_POS
0085: 10@ = 0@ // (int)
0085: 15@ = 1@ // (int)
1@ = 0.0 // X offset
2@ = 0.0 // Y offset {THX TO: WESSER}
3@ = 0.0 // Z offset
0A96: 0@ = actor 10@ struct
0AC7: 4@ = var 1@ offset
0AA6: call_method 0x5E01C0 struct 0@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 15@ vOffset 4@ // CPed__getBonePositionWithOffset
0AB2: retn 3 1@ 2@ 3@  

2. What's wrong here? .:
PHP:
        ////////////////////////////////////////// Get Bone coords //////////////////////////////////////////
        0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR 0@ BONE 24 _STORE_TO 1@ 2@ 3@  // RIGHT HAND
        //////////////////////////////////////// Convert bones coords ////////////////////////////////////////
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 1@ Y 2@ Z 3@ store_screen_X_to 13@ Y_to 14@
        //////////////////////////////////////// Get crosshair coords ////////////////////////////////////////
        call @crosshair_coords 0 x_out 21@ y_out 22@
        
        //////////////////////////////////////// Final checks and send auto shoot ////////////////////////////////////////
        21@ - 20
        22@ + 20
        13@ + 20
        14@ - 20
        IF 13@ > 0
        THEN
            IF 14@ > 0
            THEN
                IF AND
                13@ >= 21@
                13@ <= 22@
                14@ >= 22@
                14@ <= 22@
                THEN
                    PRINTF "Your crosshair is on player ~r~RIGHT HAND ! " 2000
                END
            END
        END
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Woops, it should be y1 = y - fov; y2 = y + fov; 
But still, I'm explaining and feeding you all the aspects, why don't you turn on your brain and fix this yourself?
Your code looks awful, basic programming mistakes and shit, meanwhile WaTTi's code looks almost good and clean, except for the IF AND part logic mistake and except for my mistake in "scheme" picture
 
Status
Not open for further replies.
Top