CLEO Help [HELP] Get random object

CLEO related
Status
Not open for further replies.

Shakira

Active member
Joined
Jul 11, 2014
Messages
191
Reaction score
0
I need a snippet or something to get all object in stream... simple is traffic lamp i need to get all
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
I used something like this, I'm not 100% sure about the "355840" but it worked well
Code:
0A8D: 16@ = read_memory 0xB7449C size 4 virtual_protect 0
000A: 16@ += 0x4
0A8D: 16@ = read_memory 16@ size 4 virtual_protect 0
for 23@ = 0 to 355840 step 0x100
0A8D: 10@ = read_memory 16@ size 1 virtual_protect 0
000A: 16@ += 0x1
   if and
   0029:  10@ >= 0x00
   001B:  0x80 > 10@
   then
   005A: 10@ += 23@  
   0984: 11@ = object 10@ model 
   // 10@ = object_id            
   // 11@ = object_model_id  
   end  
end  
 

Shakira

Active member
Joined
Jul 11, 2014
Messages
191
Reaction score
0
monday said:
I used something like this, I'm not 100% sure about the "355840" but it worked well
Code:
0A8D: 16@ = read_memory 0xB7449C size 4 virtual_protect 0
000A: 16@ += 0x4
0A8D: 16@ = read_memory 16@ size 4 virtual_protect 0
for 23@ = 0 to 355840 step 0x100
0A8D: 10@ = read_memory 16@ size 1 virtual_protect 0
000A: 16@ += 0x1
   if and
   0029:  10@ >= 0x00
   001B:  0x80 > 10@
   then
   005A: 10@ += 23@  
   0984: 11@ = object 10@ model 
   // 10@ = object_id            
   // 11@ = object_model_id  
   end  
end  


Code:
 // 10@ = object_id            
  // 11@ = object_model_id  
 12@ =  SAMP.ObjectHandleByID(10@)     
  end  
end  
            IF
                03CA:   object 12@ exists
            THEN
                01BB: store_object 12@ position_to 1@ 2@ 3@
                0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 1@ Y 2@ Z 3@ store_screen_X_to 4@ Y_to 5@
                0AB1: @DRAW_OUTLINED_BOX 9 POS 4@ 5@ SIZE 50.0 50.0 RGBA 255 0 0 255 THICKNESS 0.5
            END
    UNTIL 0AB0:   key_pressed 85
END
jump @START

Nothing happen when i active , something wrong??
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
the way it looks like it should draw the box only for the last object in memory, but how can anyone assess what's wrong without seeing the full code?

To draw something for all objects you'd have to put drawing stuff inside the loop (where I put the comments)

You could check the source of this mod:
http://ugbase.eu/Thread-CLEO-supremeTroll-16-01-15-objectFinder-1-3

Edit: just delete 12@ = SAMP.ObjectHandleByID(10@) and replace all 12@ with 10@
 
Status
Not open for further replies.
Top