How to make a simple cleo script

Can someone make a video/Easy written tutorial on how to make a simple cleo script that presses buttons for you such as: I want my player to run automaticly so I want it to press 'W' for me with a on and off button. Can someone make a tutorial for it?

Another example: I want my guy to bunny hop automaticly, with a on and off button

bla bla bla, so I just want to know how to make them simple scritps
 

xzytro

God
Joined
Apr 1, 2013
Messages
2,294
Reaction score
7
If you really want to learn it, take your time and read each line of this long reply of mine.
-
Let's make a simple .cs mod together ! What to do ? uhm... Let's make our character bleed when we press F12 button.

EPISODE-I :lol: :lol::lol:

Open Sanny Builder, hit Ctrl + N. Start with this :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}
Without that, i think the cleo won't work. Then, add name to your cleo file like below :
Code:
thread 'TESTCLEO'

Now that we wrote this as total :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}

thread 'TESTCLEO'

Now we start scripting. To start, put the name you choose for thread as :<yourname>_01, like here:
Code:
:TESTCLEO_01
wait 0
I added "wait 0", because the cleo crashes if i don't use the "wait" command at the beginning. Now, we will put whatever we want. What do we want ? We want our character to bleed if we press F12 button. Here we go, we will put "if" command to give our .cs file the condition to work. :arrow: :arrow::arrow:
Code:
if
Now we add our condition, what was our condition ? It was "if we press F12 button", then our code is "key_pressed" :arrow: :arrow::arrow:
Code:
0AB0:   key_pressed 123
Now, our script is like this :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}

thread 'TESTCLEO'

:TESTCLEO_01
wait 0
if
0AB0:   key_pressed 123
That "123" is the key for F12. To learn the keys, use capslockbomber's tutorial
Now, okay we added our condition for the cleo to work, but what if we didn't press F12 ? We must tell the cleo script to do something if we didn't press F12 button. Otherwise cleo would barely work ! So here we go :arrow: :arrow::arrow:
Code:
else_jump @TESTCLEO_01
this allows the cleo script to go back and check again if the player pressed F12, and doesn't do anything until player presses F12 key.

Now,this is our code :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}

thread 'TESTCLEO'

:TESTCLEO_01
wait 0
if
0AB0:   key_pressed 123
else_jump @TESTCLEO_01
From beginning till the end, this cleo flow means, "You should press F12, If you don't press F12, i will check again if you press or not, but if you press the F12 key, i will do what you want".
Now that we add what we want ! We hit Altgr + 2 button to open opcode search window, and we type "bleed", we find "0332: set_actor 66@ bleeding 1". We will use that ! Let's do it :arrow: :arrow::arrow:
Code:
0332: set_actor $PLAYER_ACTOR bleeding 1
This will do the trick ;D Now, With this cleo till the end, if we press F12 key, our character will bleed until he dies ;D When he dies, the cleo will stop. But will never work again. How to tell the cleo to work again ? Here :arrow: :arrow::arrow:
Code:
jump @TESTCLEO_01
Now, the script will always check if you press F12 or not. So, it will ask you again after you die too ;D And when you press F12 after you die, it will work ;D

Finally our entire script (working) :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}

thread 'TESTCLEO'

:TESTCLEO_01
wait 0
if
0AB0:   key_pressed 123
else_jump @TESTCLEO_01
0332: set_actor $PLAYER_ACTOR bleeding 1
jump @TESTCLEO_01
EPISODE-II
Okay i made it, but i want to make it togglable dude, how to do that ?
Let's make it togglable ! So it bleeds when we press F12, but stops bleeding when we press F11 !

Now, If we look at the entire script, we see that we have only 1 condition, we will put another condition ! (to make the cleo file check if we press F11 button too.). How to do ? we had "else_jump @TESTCLEO_01", we will change it into "else_jump @TESTCLEO_02" :arrow: :arrow::arrow:
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}

thread 'TESTCLEO'

:TESTCLEO_01
wait 0
if
0AB0:   key_pressed 123
else_jump @TESTCLEO_02
0332: set_actor $PLAYER_ACTOR bleeding 1
jump @TESTCLEO_01
So, since we said "check TESTCLEO_02", we must make ":TESTCLEO_02" otherwise the cleo won't know what "TESTCLEO_02" means.:arrow: :arrow::arrow:
Code:
:TEST_CLEO_02
wait 0
Now we add our condition again. Almost same, but with another key (F11)

Code:
if 
0AB0 :   key_pressed 122
else_jump @TESTCLEO_01
0332: set_actor $PLAYER_ACTOR bleeding 0
jump @TESTCLEO_01
I added "else_jump @TESTCLEO_01" because, from the beginning, if the player didn't press F12, it will check if he pressed F11, if the player didn't press F11 either, the cleo will again check if he pressed F12, and it will continue until you close the game.
So here's our entire script :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}

thread 'TESTCLEO'

:TESTCLEO_01
wait 0
if
0AB0:   key_pressed 123
else_jump @TESTCLEO_02
0332: set_actor $PLAYER_ACTOR bleeding 1
jump @TESTCLEO_01

:TESTCLEO_02
wait 0
if
0AB0:   key_pressed 122
else_jump @TESTCLEO_01
0332: set_actor $PLAYER_ACTOR bleeding 0
jump @TESTCLEO_01
Woohooo, looks finished & delicious ! Let's save it as .cs file ! Press F6, it will show you a window and it will ask you where to save. From the window go to "GTA San AndreasCLEO" and then in the name, put whatever you want, i put "bleeding". But don't add any extensions ! In name area, only name should be there. In extension area below, .txt will stay. Now, press OK
saveacleo_zpseb878b0c.png


CONGRATZ ;D You made your own cleo ;D Press F8 to quickly test your bleeding mod in single player ! :arrow: :arrow::arrow:

bleedingtest_zpsf420662f.png

Toggled it on/off/on/off and it looked like this :lol: :lol::lol:
It will work ;D

With this way you can make whatever you want, and togglable too of course ! ;D
HAVE FUN
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Re: [TUTORIAL] How to make a simple cleo script

very very good , but i need to learn how to put addresses like infinite ammo and health ...etc , is there some where i can learn more
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Re: [TUTORIAL] How to make a simple cleo script

we need more tuts please
 

ViruZz

Member
Joined
May 12, 2013
Messages
6
Reaction score
0
Re: [TUTORIAL] How to make a simple cleo script

nice
 

SplinteX

Active member
Joined
Nov 26, 2013
Messages
44
Reaction score
0
Nice tutorial,but can someone tell me how to make a script to toggle it on/off.
So,I have an script (autoscroller) and I want to make it toggle on/off.
How to do it?
 

Rebel

Active member
Joined
Mar 6, 2014
Messages
60
Reaction score
0
Well when I try to save it into my CLEO folder I get error: Unknown directive {$VERSION 3.1.0027}.
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
Do not use {$VERSION bla bla}
btw your cleo script is wrong.
 

GidanDaniel

Active member
Joined
Feb 22, 2014
Messages
28
Reaction score
0
TH3RM4L link said:
Do not use {$VERSION bla bla}
btw your cleo script is wrong.
Wrong :looky:? tell me where i must fix it please :angry:, i tried to edit player's health looks like this
1404628135340.gif
:eek:key:
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
:HEALTH
if
0AB0:
jf @HEALTH
Actor.Health($PLAYER_ACTOR) = 10
wait 375
Actor.Health($PLAYER_ACTOR) = 20
wait 375
bla bla bla
Actor.Health($PLAYER_ACTOR) = 100
jump @HEALTH
 

Rossi

Member
Joined
May 30, 2014
Messages
12
Reaction score
0
Best tutorial ever, it helped me out a lot when i started
 

Dwayne

Active member
Joined
Jun 4, 2014
Messages
125
Reaction score
0
dont workk,i'm saved file.txt in folder cleo and logged in game , when i activate key,nothing ?
 
Top