Help Help me with AIM_AT_POS snippet

Polaroid

Active Member
Joined
Oct 30, 2014
Messages
36
Likes
0
Points
58
#1
Code:
{$CLEO .cs}
0000:

WHILE TRUE
    WAIT 0
    IF 0AD2: [email protected] = player $PLAYER_CHAR targeted_actor
    THEN
        Actor.StorePos([email protected], [email protected], [email protected], [email protected])
        0AB1: @AIM_AT_POS 4 XYZ: [email protected] [email protected] [email protected] ADD_CAMERA_OFFSET 0.04253
    END
END
//0AB1: @AIM_AT_POS 3 XYZ: [email protected] [email protected] [email protected]
:AIM_AT_POS
0087: [email protected] = [email protected]
068D: get_camera_position_to [email protected] [email protected] [email protected]
0063: [email protected] -= [email protected]
0063: [email protected] -= [email protected]
0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected]
[email protected] -= 90.0
0017: [email protected] /= 57.2957795            
005B: [email protected] += [email protected]  // (float)                           
0A8D: [email protected] = read_memory 0xB6F248 size 4 virtual_protect 0
0A25: set_camera_on_players_X_angle [email protected] Z_angle [email protected]
0661: "by Opcode.eXe | UGBASE.EU"
0AB2: 0
Hello. I've been trying to add a smoothing factor to this snippet for HOURS now but I can't get it to work. I tried dividing the angle difference by 2.0 but it aims completely off. I don't know what I am doing wrong. Can somebody please guide me on how to add a smoothing factor to this particular snippet or give me some helpful advice? Thank you
 

Codex1337

Well-Known Member
Joined
Mar 1, 2014
Messages
170
Likes
0
Points
66
#2
call @AIM_AT_PLAYER 1 $PLAYER_HANDLE


Code:
:AIM_AT_PLAYER
Actor.StorePos([email protected], [email protected], [email protected], [email protected])
068D: get_camera_position_to [email protected] [email protected] [email protected]
0063: [email protected] -= [email protected]
0063: [email protected] -= [email protected]
0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected]
[email protected] -= 90.0
0017: [email protected] /= 57.2957795                                      
0A8D: [email protected] = read_memory 0xB6F248 size 4 virtual_protect 0
0A25: set_camera_on_players_X_angle [email protected] Z_angle [email protected]
0AB2: 0
 
OP
OP
P

Polaroid

Active Member
Joined
Oct 30, 2014
Messages
36
Likes
0
Points
58
#3
Codex1337 said:
call @AIM_AT_PLAYER 1 $PLAYER_HANDLE


Code:
:AIM_AT_PLAYER
Actor.StorePos([email protected], [email protected], [email protected], [email protected])
068D: get_camera_position_to [email protected] [email protected] [email protected]
0063: [email protected] -= [email protected]
0063: [email protected] -= [email protected]
0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected]
[email protected] -= 90.0
0017: [email protected] /= 57.2957795                                      
0A8D: [email protected] = read_memory 0xB6F248 size 4 virtual_protect 0
0A25: set_camera_on_players_X_angle [email protected] Z_angle [email protected]
0AB2: 0
I'm trying to make the aiming smooth (slower). I tried this and it snaps to the target too. Do you know how I would go about making it smooth? Thank you!
 

supahdupahnubah

Well-Known Member
Joined
Dec 31, 2015
Messages
680
Likes
4
Points
33
#4
Polaroid said:
I'm trying to make the aiming smooth (slower). I tried this and it snaps to the target too. Do you know how I would go about making it smooth? Thank you!
What about getting the distance between crosshair and a target, then segment (simple "for" loop) it by smooth value + add wait\sleep to prevent perfomance drops because speed of aiming will be simply based on your fps
Obstler's smooth have this error, so when you'll have big fps (like 120+) smooth speed will be f up, as well as if you will have lower fps
sry for my ingris, didn't sleep for 30 hours
 

Opcode.eXe

Well-Known Member
Joined
Feb 18, 2013
Messages
1,280
Likes
30
Points
98
Location
( ͡° ͜ʖ ͡°)
Website
www.youtube.com
10
#5
You need:
YourCurrentAngles and CalculatedAngles


Then remove YourCurrentAngles from the CalculatedAngles and devide it by 20.0 or whatever and add this value to YourCurrentAngles again
 
OP
OP
P

Polaroid

Active Member
Joined
Oct 30, 2014
Messages
36
Likes
0
Points
58
#6
Okay so I divided the angle difference by 10.0 and made a FOR loop (1 to 10) to += to my current angle and aim to it 10 times to reach my target. Now I'm having trouble with adding a wait between each of the 10 increments I aim at. If I try doing "wait 1" after each increment the screen jitters around like crazy and aims at at random spots left and right. I think I need to add a timer wait ([email protected]) but I don't know how to do this in a FOR loop after each time it aims?

Basically i did something like this

newAngle = currentAngle
targetAngle -= currentAngle
targetAngle /= 10.0
for 1 to 10
newAngle += targetAngle
setCamera on currentAngle to newAngle
end

and that works fine. It aims to player but now i cant figure out how to add a WAIT or timer in there to make it smooth
 

supahdupahnubah

Well-Known Member
Joined
Dec 31, 2015
Messages
680
Likes
4
Points
33
#7
Polaroid said:
Okay so I divided the angle difference by 10.0 and made a FOR loop (1 to 10) to += to my current angle and aim to it 10 times to reach my target. Now I'm having trouble with adding a wait between each of the 10 increments I aim at. If I try doing "wait 1" after each increment the screen jitters around like crazy and aims at at random spots left and right. I think I need to add a timer wait ([email protected]) but I don't know how to do this in a FOR loop after each time it aims?

Basically i did something like this

newAngle = currentAngle
targetAngle -= currentAngle
targetAngle /= 10.0
for 1 to 10
  newAngle += targetAngle
  setCamera on currentAngle to newAngle
end

and that works fine. It aims to player but now i cant figure out how to add a WAIT or timer in there to make it smooth
set [email protected] to 0 and add while [email protected] < time_in_ms?
if you don't understand how [email protected] and [email protected] works, you can simply debug them (number draw for example)
 

springfield

Well-Known Member
Staff member
Joined
Feb 18, 2005
Messages
2,935
Likes
17
Points
88
Website
www.ugbase.eu
#11
[shcode=cpp]

{$CLEO .cs}
0000:

while true
    wait 0
    if 0AD2: [email protected] = player $PLAYER_CHAR targeted_actor
    then
        Actor.StorePos([email protected], [email protected], [email protected], [email protected])
        068D: get_camera_position_to [email protected] [email protected] [email protected]
        0063: [email protected] -= [email protected]
        0063: [email protected] -= [email protected]
        0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected] //target angle
        
        while [email protected] < 0.0 
            [email protected] += 360.0
        end
           
        [email protected] -= 90.0
        [email protected] /= 57.295776
       
        [email protected] += 0.04253 // adding offset for crosshair to line up
        
        0A8D: [email protected] = readMem 0xB6F248 size 4 vp 0  //vertical angle
        0A8D: [email protected] = readMem 0xB6F258 size 4 vp 0  //horizontal angle
              
        0087: [email protected] = [email protected]
        0063: [email protected] -= [email protected]  //diff
        
        while [email protected] <= -3.14159 // i have a pi
            [email protected] += 6.28318    // i have a pi * 2
        end                  // ugh, normalized
        
        while [email protected] > 3.14159
            [email protected] -= 6.28318
        end
        
        //gta frame time, use in order to be consistent with FPS
        0A8D: [email protected] = readMem 0xB7CB5C size 4 vp 0 
        [email protected] *= 0.1 //smooth mult.
        
        006B: [email protected] *= [email protected] 
        0063: [email protected] -= [email protected]
        
        0A25: set_camera_on_players_X_angle [email protected] Z_angle [email protected] 
    end
end 
[/shcode]

Should work, kinda.. maybe.
 

supahdupahnubah

Well-Known Member
Joined
Dec 31, 2015
Messages
680
Likes
4
Points
33
#13
springfield said:
[shcode=cpp]

{$CLEO .cs}
0000:

while true
    wait 0
    if 0AD2: [email protected] = player $PLAYER_CHAR targeted_actor
    then
        Actor.StorePos([email protected], [email protected], [email protected], [email protected])
        068D: get_camera_position_to [email protected] [email protected] [email protected]
        0063: [email protected] -= [email protected]
        0063: [email protected] -= [email protected]
        0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected] //target angle
        
        while [email protected] < 0.0 
            [email protected] += 360.0
        end
           
        [email protected] -= 90.0
        [email protected] /= 57.295776
       
        [email protected] += 0.04253 // adding offset for crosshair to line up
        
        0A8D: [email protected] = readMem 0xB6F248 size 4 vp 0  //vertical angle
        0A8D: [email protected] = readMem 0xB6F258 size 4 vp 0  //horizontal angle
              
        0087: [email protected] = [email protected]
        0063: [email protected] -= [email protected]  //diff
        
        while [email protected] <= -3.14159 // i have a pi
            [email protected] += 6.28318    // i have a pi * 2
        end                  // ugh, normalized
        
        while [email protected] > 3.14159
            [email protected] -= 6.28318
        end
        
        //gta frame time, use in order to be consistent with FPS
        0A8D: [email protected] = readMem 0xB7CB5C size 4 vp 0 
        [email protected] *= 0.1 //smooth mult.
        
        006B: [email protected] *= [email protected] 
        0063: [email protected] -= [email protected]
        
        0A25: set_camera_on_players_X_angle [email protected] Z_angle [email protected] 
    end
end 
[/shcode]

Should work, kinda.. maybe.

        while [email protected] < 0.0 
            [email protected] += 360.0
        end

This ever happens? :O

Btw, you're sick at aimbot calculation, sad I've been sleeping at geometry maths back while xd
Took me 4 hours to figure out how to get Z angle for point in C++ that equals 0604 opcode, well done mate, helped me a lot

P.S. While I was figuring out how to get Z angle the opcode's quote "Springfield, he niggered some aimbot movement calculations" didn't get out of my head all the time xddddd
 

springfield

Well-Known Member
Staff member
Joined
Feb 18, 2005
Messages
2,935
Likes
17
Points
88
Website
www.ugbase.eu
#14
No, opcode 0604 already does that.

[shcode=cpp]
angle = atan(x, y)  * 57.295776 - 90.0;
do
   angle = angle + 360.0;
while ( angle < 0.0 );
[/shcode]

I just converted a c++ aimbot logic and integrated it into opcode.exe snippet.

supahdupahnubah said:
P.S. While I was figuring out how to get Z angle the opcode's quote "Springfield, he niggered some aimbot movement calculations" didn't get out of my head all the time xddddd

:eek:key:
 

supahdupahnubah

Well-Known Member
Joined
Dec 31, 2015
Messages
680
Likes
4
Points
33
#15
springfield said:
No, opcode 0604 already does that.

[shcode=cpp]
angle = atan(x, y)  * 57.295776 - 90.0;
do
   angle = angle + 360.0;
while ( angle < 0.0 );
[/shcode]
Yea I know it, I've tried to do it at C++
Where did ya find that formula? Straight from CLEO src or what? I did it different way and the calculations were the same :O 

kk got it

BTW This is my first time I've been playing around with the calculations, so as it's first try, I've converted your source to C++ and it was aiming glitchy until I've put some debug messages to the chat (lol?) and changed [email protected] *= 0.1 multiplier to 0.001
I can record it if you interested to help me, if not, gonna fix it tomorrow by myself but with different calculations ;c
Gonna test this formula out tomorrow, shiet, I really have to get some geometry classes again >.<
 
Top