CLEO Help help making 0AB1: working

CLEO related

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
Hello. I need some help making a script with 0AB1: work

Back in the days, with help from Parazitas, i made this
Code:
:CharGoto
// 0AB1: @CharGoto 8 XYZ 1@ 2@ 3@ solid 1 car 1 actor 1 object 1 particle 0
repeat
wait 0
if 0256:   player $PLAYER_CHAR defined
then
    00A0: store_actor $PLAYER_ACTOR position_to 31@ 30@ 29@
    if 06BD:   no_obstacles_between 31@ 30@ 29@ and 0@ 1@ 2@ solid 3@ car 4@ actor 5@ object 6@ particle 7@
    then
        0AB1: @AIM_AT_POS 3 XYZ: 0@ 1@ 2@
        0AB1: @ForcePressGameKeyOffset 1 _KeyOffset 3  
    else  
        33@ = 0
        0AB1: @ForcePressGameKeyOffset 1 _KeyOffset 3
        0AB1: @ForcePressGameKeyOffset 1 _KeyOffset 1
       
        repeat
        wait 0  
        0AB1: @AIM_AT_POS 3 XYZ: 0@ 1@ 2@
        0AB1: @ForcePressGameKeyOffset 1 _KeyOffset 3
        0AB1: @ForcePressGameKeyOffset 1 _KeyOffset 1
        until 33@ > 300
    end
end
until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 0@ 1@ radius 1.0 1.0 on_foot
0AB2: ret 0

This one from above it works, but now I have a better one from Parazitas, but i don't know how to adapt to make code smaller.
Code:
This one is from Parazitas

:getCollisionBetweenPoints
{
 Parameters:
   Passed:
     0@ - start point X
     1@ - start point Y
     2@ - start point Z
     3@ - end point X
     4@ - end point Y
     5@ - end point Z
     6@ - is solid
     7@ - is car
     8@ - is actor
     9@ - is object
     10@ - is particle
     11@ - is car tyre
     12@ - is water
     13@ - entity to ignore (offset)
     14@ - no see-through stuff
     15@ - no camera objects
     16@ - no shoot-through stuff
   Result:
     17@ - collision point X
     18@ - collision point Y
     19@ - collision point Z
     20@ - distance
     21@ - entity

 Example:
   0A96: 11@ = actor $PLAYER_ACTOR struct
    0AB1: call_scm_func @getCollisionBetweenPoints 17 from 0@ 1@ 2@ to 3@ 4@ 5@ solid 1 car 1 actor 1 object 1 particle 1 cartyre 1 water 0 ignore_entity 11@ see_through 0 camera_objects 0 shoot_through 0 store_to 6@ 7@ 8@ distance_to 9@ entity_to 10@
}
if
 13@ <> 0x0
then
 0A8C: write_memory 0xB7CD68 size 4 value 13@ virtual_protect 0
end
0A8C: write_memory 0xB7CD70 size 1 value 11@ virtual_protect 0
0A9F: 26@ = current_thread_pointer
0AB1: call_scm_func @getLocalVarOffset 2 thread 26@ var 0 store_to 22@
0AB1: call_scm_func @getLocalVarOffset 2 thread 26@ var 3 store_to 23@
0AB1: call_scm_func @getLocalVarOffset 2 thread 26@ var 17 store_to 24@
0AB1: call_scm_func @getLocalVarOffset 2 thread 26@ var 21 store_to 25@
0AA7: call_function 0x56BA00 num_params 12 pop 12 bIgnoreShootThroughStuff 16@ bIgnoreSomeObjectsForCamera 15@ bIgnoreSeeThroughStuff 14@ bDummy 10@ bObject 9@ bActor 8@ bCar 7@ bBuilding 6@ pEntity 25@ pPoint 24@ pTarget 23@ pOrigin 22@ bReturn 31@ // CWorld__ProcessLineOfSight
if
 13@ <> 0x0
then
 0A8C: write_memory 0xB7CD68 size 4 value 0x0 virtual_protect 0
end
if
 31@ <> 0
then
 if and
   17@ <> 0.0
   18@ <> 0.0
   19@ <> 0.0
 then
   050A: 20@ = distance_between_XYZ 0@ 1@ 2@ and_XYZ 17@ 18@ 19@
   if
    12@ == 1
   then
     0A9F: 26@ = current_thread_pointer
     0AB1: call_scm_func @getLocalVarOffset 2 thread 26@ var 27 store_to 30@
     0AA7: call_function 0x6E61B0 num_params 7 pop 7 pPoint 30@ fTargetZ 5@ fTargetY 4@ fTargetX 3@ fOriginZ 2@ fOriginY 1@ fOriginX 0@ bResult 31@ // CWorld__TestLineAgainstWater
     if
       31@ <> 0
     then
       0087: 17@ = 27@
       0087: 18@ = 28@
       0087: 19@ = 29@
       050A: 20@ = distance_between_XYZ 0@ 1@ 2@ and_XYZ 27@ 28@ 29@
     end
   end
   0AB2: ret 5 17@ 18@ 19@ 20@ 21@
 end
end
0AB2: ret 5 3@ 4@ 5@ 0.0 0x0

And this is what i tried:

Code:
:Char
/*usage should be
    0AB1: @Char 14  3@ 4@ 5@ solid 1 car 1 actor 1 object 1 particle 1 cartyre 1 water 0 ignore_entity 11@ see_through 0 camera_objects 0 shoot_through 0 store_to 6@ 7@ 8@ distance_to 9@ entity_to 10@
    or something similar
    */
repeat
wait 0
0A96: 11@ = actor $PLAYER_ACTOR struct
00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
0AB1: @getCollisionBetweenPoints 17 from 0@ 1@ 2@ to 3@ 4@ 5@ solid 1 car 1 actor 1 object 1 particle 1 cartyre 1 water 0 ignore_entity 11@ see_through 0 camera_objects 0 shoot_through 0 store_to 6@ 7@ 8@ distance_to 9@ entity_to 10@
IF 0021: 9@ > 5.0
then
    0AB1: @CharGoStraight 3 3@ 4@ 5@
else
    0AB1: @CharGoLeft 3 3@ 4@ 5@                
end

until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 3@ 5@ radius 2.0 2.0 on_foot
0AB2: ret 0
 
:CharGoStraight
if 0256:   player $PLAYER_CHAR defined
then
    0AB1: @AIM_AT_POS 3 XYZ: 0@ 1@ 2@
    0AB1: @ForcePressGameKeyOffset 1 _KeyOffset 3
end
0AB2: ret 0


:CharGoLeft
if 0256:   player $PLAYER_CHAR defined
then
    33@ = 0
    0AB1: @ForcePressGameKeyOffset 1 _KeyOffset 3
    0AB1: @ForcePressGameKeyOffset 1 _KeyOffset 1
    repeat
    wait 0  
    0AB1: @AIM_AT_POS 3 XYZ: 0@ 1@ 2@
    0AB1: @ForcePressGameKeyOffset 1 _KeyOffset 3
    0AB1: @ForcePressGameKeyOffset 1 _KeyOffset 1  
    until 33@ > 300
end
0AB2: ret 0

Code:
while true  
wait 0  

if 15@ == true
then
    if 0256:    player $PLAYER_CHAR defined
    then
        00A1: put_actor $PLAYER_ACTOR at 1326.0334 1297.617 10.8203
        wait 1000
        say "/vw 55"
        wait 2000
        say "/v fire"
        wait 2000
        00A1: put_actor $PLAYER_ACTOR at 1350.4352 1296.4950 10.8203
        wait 2000
        0A96: 11@ = actor $PLAYER_ACTOR struct
        0AB1: @Char 14  1326.0334 1297.617 10.8203 solid 1 car 1 actor 1 object 1 particle 1 cartyre 1 water 0 ignore_entity 11@ see_through 0 camera_objects 0 shoot_through 0 store_to 6@ 7@ 8@ distance_to 9@ entity_to 10@
        15@ = false
    end
end

end  //end while true


My character won't go to specified coordonates, it will go to the center of the map (that farm where you get spawned on Grand Latency servers)
 
Top