CLEO Help How to add alternate condition in a loop like "else"?

CLEO related
Status
Not open for further replies.

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
PHP:
{$CLEO .cs}
0000:

31@ = 0
      
:SHOT
WAIT 0 
IF and
0AD2: 0@ = player $PLAYER_CHAR targeted_actor //IF and SET
0247: load_model 1775
JF @SHOT
31@ += 1
JUMP @WORK

:WORK
WAIT 100
IF and 
8118:   actor 0@ dead
0248:   model 1775 available
else_jump @False
wait 0
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0
0107: 21@ = create_object 1775 at 1@ 2@ 3@
JUMP @WORK

:FALSE
WAIT 0
IF  
0ADC:   test_cheat "C"
JF @FALSE
31@ -= 1
JUMP @SHOT


END_THREAD
In "Work" label. I want to add deactivation like: "If i press 'C' then the mod will be disable. The system will no longer keep sending Sprunks at target position. I've tried to add the false (means else) with name False label but system did not jump on that label to deactivate it. Please help..


In simple words... how to deactivate this!
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
[shcode=cpp]
{$CLEO}

THREAD "BLABLABLA"

31@ = 0

WHILE TRUE
WAIT 0
IF
31@ == 1
THEN
IF AND
0AD2: 0@ = player $PLAYER_CHAR targeted_actor //IF and SET
0247: load_model 1775
THEN
IF AND
8118: actor 0@ dead
0248: model 1775 available
THEN
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0
0107: 21@ = create_object 1775 at 1@ 2@ 3@
END
END
END
WAIT 0
IF
0ADC: "C"
THEN
IF
31@ == 0
THEN
WAIT 100
31@ = 1
ELSE
WAIT 100
31@ = 0
END
END
END
[/shcode]

There you go. Those labels make it so complicated.
 

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
Noo.. i want to keep giving him sprunk objects until i won't press "C". You code makes one sprunk object of each aim but i want to do like this:

if i "aim" at the target actor only one time then sprunk guard keep adding at his position automatically until i won't press 'C' to disable it.

And please with Low level I hate high level.
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
Sorry I don't make in low level.

[shcode=cpp]
{$CLEO}

THREAD "BLABLABLA"

WHILE TRUE
WAIT 0
IF
0AB0: 67 // C ON KB
THEN
IF AND
0AD2: 0@ = player $PLAYER_CHAR targeted_actor //IF and SET
0247: load_model 1775
THEN
IF AND
8118: actor 0@ dead
0248: model 1775 available
THEN
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0
0107: 21@ = create_object 1775 at 1@ 2@ 3@
END
END
END
END
[/shcode]

Something like that ?
 

M3D

Active member
Joined
May 22, 2014
Messages
130
Solutions
1
Reaction score
2
Code:
{$CLEO}
31@ = 1

:1
wait 0
if
31@ == 1
jf @1
if
0AD2: 0@ = player $PLAYER_CHAR targeted_actor
jf @1  
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0  
0107: 4@ = create_object 1775 at 1@ 2@ 3@   

:2
wait 0
if and 
8118:  actor 0@ dead   
0248:   model 1775 available  
056D:   actor 0@ defined 
jf @1
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0      
01BC: put_object 4@ at 1@ 2@ 3@
if
0ADC: "C"
jf @2
0108: destroy_object 4@ 
goto @1
Maybe that's what you think


I do not understand why you have always created sprunk?
 

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
M3D said:
Code:
{$CLEO}
31@ = 1

:1
wait 0
if
31@ == 1
jf @1
if
0AD2: 0@ = player $PLAYER_CHAR targeted_actor
jf @1  
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0  
0107: 4@ = create_object 1775 at 1@ 2@ 3@   

:2
wait 0
if and 
8118:  actor 0@ dead   
0248:   model 1775 available  
056D:   actor 0@ defined 
jf @1
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0      
01BC: put_object 4@ at 1@ 2@ 3@
if
0ADC: "C"
jf @2
0108: destroy_object 4@ 
goto @1  
Maybe that's what you think


I do not understand why you have always created sprunk?


Thanks, it works and thanks to everyone who tried to help me. :)
 
Status
Not open for further replies.
Top