CLEO Help Only while Aiming at Target

CLEO related
Status
Not open for further replies.

Monstercat

Well-known member
Joined
Feb 26, 2013
Messages
281
Reaction score
5
Hey i try to make a script that only work while Aiming at a Target...
This is what I have so far...

But I'm stuck somehow.

Code:
:MAIN_ACTIVATION
0AD2: $target = player $PLAYER_CHAR targeted_actor
if
0457: player $PLAYER_CHAR aiming_at_actor $target
else_jump @MAIN_ACTIVATION
if and
0457: player $PLAYER_CHAR aiming_at_actor $target
0AB0: key_pressed 1
0AB0: key_pressed 2
else_jump @MAIN_ACTIVATION

:GO
wait 0
repeat
wait 0
until player.Defined(0)
0A96: 0@ = actor $PLAYER_ACTOR struct
0@ += 66
while true
wait 0
if
    //???
else_jump @CONTINUE
0A8C: write_memory 0@ size 1 value 0 virtual_protect 0
jump @MAIN_ACTIVATION

:CONTINUE
0A8C: write_memory 0@ size 1 value 0xCC virtual_protect 0
end
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
0AB0: key_pressed 1 = mouse 1, so it won't work unless you aim at the player(you see the green triangle over his head) and press mouse2 and mouse1.
 

Monstercat

Well-known member
Joined
Feb 26, 2013
Messages
281
Reaction score
5
Do you mean that...

Code:
:MAIN_ACTIVATION
0AD2: $target = player $PLAYER_CHAR targeted_actor
if
0457: player $PLAYER_CHAR aiming_at_actor $target
else_jump @MAIN_ACTIVATION
if and
0457: player $PLAYER_CHAR aiming_at_actor $target
else_jump @MAIN_ACTIVATION

... is enough

And how i deactivate it while not aiming (no green triangle)
 

xzytro

God
Joined
Apr 1, 2013
Messages
2,294
Reaction score
7
Code:
:MAIN_ACTIVATION
0AD2: $target = player $PLAYER_CHAR targeted_actor
if
0457: player $PLAYER_CHAR aiming_at_actor $target
else_jump @MAIN_ACTIVATION
if and
0457: player $PLAYER_CHAR aiming_at_actor $target
else_jump @MAIN_ACTIVATION

... is enough

And how i deactivate it while not aiming (no green triangle)
Why do you need it twice ? Just this one will be enough :
Code:
:MAIN_ACTIVATION
0AD2: $target = player $PLAYER_CHAR targeted_actor
if
0457: player $PLAYER_CHAR aiming_at_actor $target
else_jump @MAIN_ACTIVATION

And about deactivation, you already don't need something special about deactivation, because while you weren't aiming, it will not work already. It will work only when you aim on a skin.
 

Monstercat

Well-known member
Joined
Feb 26, 2013
Messages
281
Reaction score
5
Ok now i made it like this...

Code:
:MAIN_ACTIVATION
wait 0
0AD2: $target = player $PLAYER_CHAR targeted_actor
if
0457: player $PLAYER_CHAR aiming_at_actor $target
else_jump @MAIN_ACTIVATION

:GO
wait 0
repeat
wait 0
until player.Defined(0)
0A96: 0@ = actor $PLAYER_ACTOR struct
0@ += 66
while true
wait 0
if
 // <------ WHAT HERE
else_jump @CHECK_IF_MOVING
0A8C: write_memory 0@ size 1 value 0 virtual_protect 0
jump @MAIN_ACTIVATION

:CONTINUE
0A8C: write_memory 0@ size 1 value 0xCC virtual_protect 0
end

But now when i aim and then stop aim the value is still 0xCC.
How i can get the value 0 if im not aiming?
 

xzytro

God
Joined
Apr 1, 2013
Messages
2,294
Reaction score
7
How can i get the value as 0 if i am not aiming?
Code:
:MAIN_ACTIVATION
wait 0
0AD2: $target = player $PLAYER_CHAR targeted_actor
if
0457: player $PLAYER_CHAR aiming_at_actor $target
else_jump @MAIN_ACTIVATION

:GO
wait 0
repeat
wait 0
if
0457: player $PLAYER_CHAR aiming_at_actor $target
else_jump @MAIN_ACTIVATION
until player.Defined(0)
0A96: 0@ = actor $PLAYER_ACTOR struct
0@ += 66
while true
wait 0
if
0457: player $PLAYER_CHAR aiming_at_actor $target
else_jump @CONTINUE
0A8C: write_memory 0@ size 1 value 0xCC virtual_protect 0
jump @MAIN_ACTIVATION

:CONTINUE
0A8C: write_memory 0@ size 1 value 0 virtual_protect 0
end


This here :

while true
wait 0
if
0457: player $PLAYER_CHAR aiming_at_actor $target
else_jump @CONTINUE
0A8C: write_memory 0@ size 1 value 0xCC virtual_protect 0
jump @MAIN_ACTIVATION

:CONTINUE
0A8C: write_memory 0@ size 1 value 0 virtual_protect 0
end

means, while i was aiming on a target, set value constantly as 0xCC, but while i was not aiming, first set it as 0, then return back up to the flow, checking if aiming or not.
 

Monstercat

Well-known member
Joined
Feb 26, 2013
Messages
281
Reaction score
5
Ok... well, i have a small problem...
When i ingame and somebody shoot at me i lose HP // Ok everything fine
Then i aim at a Target and the GM is ON //W ell that's good
But then if i stop aiming i have to Aim On and Off again to turn it off // That's the Problem

I hope you help me again :) :):)
 
Status
Not open for further replies.
Top