CLEO Help Set multiple values for one variable

CLEO related
Status
Not open for further replies.

Shayel

New member
Joined
Jul 17, 2019
Messages
3
Reaction score
0
Hello everyone, just to make it clear I am a complete noob when it comes to coding so sorry for my illness.
So I found a cleo mod, basically it runs a check for a specific nearby object(Deagle) everytime I activate the cheat. I also have an .INI config file linked to the cleo mod so I already figured out how to change the object key to whatever I want (E.G make it find shotguns instead of deagles).

What I want to do is this - I want to make it so it won't only scan for deagles (ID 384) but shotguns too (ID 385), and later on the rest of the weapons I wish to add. I was really running up on google for straight 4 hours with no luck, I couldn't figure out how to make it scan multiple object ids at once rather than only 1 ID.

Cleo Code:
Code:
0AF0: 19@ = get_int_from_ini_file "CLEO\MOSH_CONFIGURATION.INI" section "SETTINGS" key "OBJECT_ID"

INI Code:
Code:
[SETTINGS]
OBJECT_ID=348

My question: How do I make it so the variable '19@' will get more results off the key "OBJECT_ID" (E.G - instead of scanning object ID 348 around me, it will scan object ID 348 and object 349 simultaneously). I've seen something about using short/long string in the variable (E.G '4@v') instead of "Object_id", but yet, I really don't know what that means or how I use that.
Thank you helpers!
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AB1: @GetClosestObject 0 XYZ 0@ 1@ 2@ Model 3@
    0AD1: "~w~X: %f Y: %f Z: %f Model: %d" 1 0@ 1@ 2@ 3@
end

end

:GetClosestObject
20@ = 9999.0
0A8D: 29@ = read_memory 0xB7449C size 4 virtual_protect 0
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
for 30@ = 0 to 89344 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
    000A: 29@ += 0x1
    if and
        0029:  31@ >= 0x00 
        001B:  0x80 > 31@
    then 
        005A: 31@ += 30@     
        if and
        03CA:   object 31@ exists
        02CC:   object 31@ bounding_sphere_visible
        then     
            0400: store_coords_to 4@ 5@ 6@ from_object 31@ with_offset 0.0 0.0 0.0
            if
            00DF:   actor $PLAYER_ACTOR driving
            then
                03C0: 1@ = actor $PLAYER_ACTOR car
                0407: store_coords_to 7@ 8@ 9@ from_car 1@ with_offset 0.0 0.0 0.0
            else
                04C4: store_coords_to 7@ 8@ 9@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
            end
            0509: 10@ = distance_between_XY 4@ 5@ and_XY 7@ 8@
            if
            0025:   20@ > 10@  // (float)
            then
                0087: 20@ = 10@ // (float)
                0984: 18@ = object 31@ model
                0400: store_coords_to 12@ 13@ 14@ from_object 31@ with_offset 0.0 0.0 0.0
                0087: 15@ = 12@ // (float)
                0087: 16@ = 13@ // (float)
                0087: 17@ = 14@ // (float)
                0085: 19@ = 18@ // (int)
            end
        end
    end 
end  
0AB2: ret 4 15@ 16@ 17@ 19@
 

Shayel

New member
Joined
Jul 17, 2019
Messages
3
Reaction score
0
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    0AB1: @GetClosestObject 0 XYZ 0@ 1@ 2@ Model 3@
    0AD1: "~w~X: %f Y: %f Z: %f Model: %d" 1 0@ 1@ 2@ 3@
end

end

:GetClosestObject
20@ = 9999.0
0A8D: 29@ = read_memory 0xB7449C size 4 virtual_protect 0
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
for 30@ = 0 to 89344 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
    000A: 29@ += 0x1
    if and
        0029:  31@ >= 0x00
        001B:  0x80 > 31@
    then
        005A: 31@ += 30@    
        if and
        03CA:   object 31@ exists
        02CC:   object 31@ bounding_sphere_visible
        then    
            0400: store_coords_to 4@ 5@ 6@ from_object 31@ with_offset 0.0 0.0 0.0
            if
            00DF:   actor $PLAYER_ACTOR driving
            then
                03C0: 1@ = actor $PLAYER_ACTOR car
                0407: store_coords_to 7@ 8@ 9@ from_car 1@ with_offset 0.0 0.0 0.0
            else
                04C4: store_coords_to 7@ 8@ 9@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
            end
            0509: 10@ = distance_between_XY 4@ 5@ and_XY 7@ 8@
            if
            0025:   20@ > 10@  // (float)
            then
                0087: 20@ = 10@ // (float)
                0984: 18@ = object 31@ model
                0400: store_coords_to 12@ 13@ 14@ from_object 31@ with_offset 0.0 0.0 0.0
                0087: 15@ = 12@ // (float)
                0087: 16@ = 13@ // (float)
                0087: 17@ = 14@ // (float)
                0085: 19@ = 18@ // (int)
            end
        end
    end
end 
0AB2: ret 4 15@ 16@ 17@ 19@
Yeah thank you for the reponse but as mentioned above, I'm a noob in whatever related to coding and stuff like that therefore I don't really know what should I do with the code you just gave me or how does it solve my issue?

btw I already have a whole complete cleo file which helps me detecting the weapons around me and such, I just copied a simple sentence out of it. I can send you the whole cleo file if that would help.
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
625
Reaction score
39
The same variable can't have 2 values at the same time, you could use an array or multiple variables for this (which means various OBJECT_ID in your .ini). You could also use the cmd opcode to do something like /detect shotgun, /detect pistol or /detect modellID which seems better to me.

This objectfinder by @monday has multiple object searcher, source is there too so you can learn from it:
http://ugbase.eu/index.php?threads/supremetroll-16-01-15-objectfinder-1-3.8937/
 
Last edited:
Status
Not open for further replies.
Top