CLEO Help Write automatically commands after joining a server

CLEO related
Status
Not open for further replies.

Excelds

Active member
Joined
Apr 17, 2021
Messages
101
Reaction score
11
Location
Earth
Hi i want someone that can code for me a cleo script that writes a commands that i specify in the script after joining in server and login. I want it to write them automatically after loging in. If it writes them immediatly before logging in my account it wont work in the server.
 

Dheyker

Member
Joined
Mar 17, 2021
Messages
15
Reaction score
0
Location
En tu cora <3
Same in cleo...
I also easy can make it without SF....

C++:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

while true
wait 0

if 0B61:  samp is_local_player_spawned
then
    if 31@ == FALSE
    then
        0AF9: samp say_msg "/sunny"
        0AF8: samp add_message_to_chat "Command Sent" color -1
        31@ = TRUE
    end
end

end
I was trying to do a similar script, but I get "Unknown command"
 

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
if it doesn’t work, you’ll need to get the caption text in the login dialog and check when it is closed
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

CONST
    COOLDOWN = 50
END

:waitSpawn
wait 0
if 0B61:  samp is_local_player_spawned
    004D: jump_if_false @waitSpawn
if 0B4C:  samp is_dialog_active -1
    004D: jump_if_false @sendCmds
jump @waitSpawn

:sendCmds
wait COOLDOWN
    0AF9: samp say_msg "a"
wait COOLDOWN
    0AF9: samp say_msg "/helmet"
wait COOLDOWN
    0AF9: samp say_msg "/togmsg"
wait COOLDOWN
    0AF9: samp say_msg "/clothes"
wait COOLDOWN
    0AF9: samp say_msg "/sgchange"
wait COOLDOWN
end_thread
 

Excelds

Active member
Joined
Apr 17, 2021
Messages
101
Reaction score
11
Location
Earth
if it doesn’t work, you’ll need to get the caption text in the login dialog and check when it is closed
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

CONST
    COOLDOWN = 50
END

:waitSpawn
wait 0
if 0B61:  samp is_local_player_spawned
    004D: jump_if_false @waitSpawn
if 0B4C:  samp is_dialog_active -1
    004D: jump_if_false @sendCmds
jump @waitSpawn

:sendCmds
wait COOLDOWN
    0AF9: samp say_msg "a"
wait COOLDOWN
    0AF9: samp say_msg "/helmet"
wait COOLDOWN
    0AF9: samp say_msg "/togmsg"
wait COOLDOWN
    0AF9: samp say_msg "/clothes"
wait COOLDOWN
    0AF9: samp say_msg "/sgchange"
wait COOLDOWN
end_thread
As is, upper or lower?
 

Excelds

Active member
Joined
Apr 17, 2021
Messages
101
Reaction score
11
Location
Earth
if it doesn’t work, you’ll need to get the caption text in the login dialog and check when it is closed
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

CONST
    COOLDOWN = 50
END

:waitSpawn
wait 0
if 0B61:  samp is_local_player_spawned
    004D: jump_if_false @waitSpawn
if 0B4C:  samp is_dialog_active -1
    004D: jump_if_false @sendCmds
jump @waitSpawn

:sendCmds
wait COOLDOWN
    0AF9: samp say_msg "a"
wait COOLDOWN
    0AF9: samp say_msg "/helmet"
wait COOLDOWN
    0AF9: samp say_msg "/togmsg"
wait COOLDOWN
    0AF9: samp say_msg "/clothes"
wait COOLDOWN
    0AF9: samp say_msg "/sgchange"
wait COOLDOWN
end_thread
@[RP]Foolish look at my video https://streamable.com/9e0kka
 

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
also it works on other servers, it doesnt work in this i think because it spawns player before login
ok, can u get the dialog text? to make some verifications...
use this cleo that I attached here.
When the last dialog appears press F2, it will show 2 lines in the chat window
then go to your Documents\GTA San Andreas User Files\SAMP\chatlog.txt and copy paste the two lines here
 

Attachments

  • getDialogText.cs
    17.6 KB · Views: 5
Last edited:

Excelds

Active member
Joined
Apr 17, 2021
Messages
101
Reaction score
11
Location
Earth
ok, can u get the dialog text? to make some verifications...
use this cleo that I attached here.
When the last dialog appears press F2, it will show 2 lines in the chat window
then go to your Documents\GTA San Andreas User Files\SAMP\chatlog.txt and copy paste the two lines here
[12:08:55] CAPTION: Влизане:
[12:08:55] TEXT: {FFFFFF}Добре Дошъл {40BF00}[N.W.A]Excelds_
 

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
I can't compile it because my SannyBuilder charset is in conflict xD, try it:
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

CONST
    COOLDOWN = 50
END

while true
wait 0
    if 0B4C:  samp is_dialog_active -1
    then
        alloc 0@ 248
        alloc 1@ 248
        0BD8: samp get_dialog_caption 0@
        0BD7: samp get_dialog_text 1@
        if and
            0C29: $NOT_USED = stristr string1 0@ string2 "Влизане"
            0C29: $NOT_USED = stristr string1 1@ string2 "{FFFFFF}Добре Дошъл"
        then
            31@ = TRUE
        end
        free 0@
        free 1@
    end
   
    if and
        31@ == TRUE
        0B61:  samp is_local_player_spawned
    then
        wait COOLDOWN
        0AF9: samp say_msg "/protect"
        wait COOLDOWN
        0AF9: samp say_msg "/helmet"
        wait COOLDOWN
        0AF9: samp say_msg "/togmsg"
        wait COOLDOWN
        0AF9: samp say_msg "/clothes"
        wait COOLDOWN
        0AF9: samp say_msg "/sgchange"
        wait COOLDOWN
        31@ = FALSE
    end
end
 
Last edited:

Excelds

Active member
Joined
Apr 17, 2021
Messages
101
Reaction score
11
Location
Earth
I can't compile it because my SannyBuilder charset is in conflict xD, try it:
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

CONST
    COOLDOWN = 50
END

while true
wait 0
    if 0B4C:  samp is_dialog_active -1
    then
        alloc 0@ 248
        alloc 1@ 248
        0BD8: samp get_dialog_caption 0@
        0BD7: samp get_dialog_text 1@
        if and
            0C29: $NOT_USED = stristr string1 0@ string2 "Влизане"
            0C29: $NOT_USED = stristr string1 1@ string2 "{FFFFFF}Добре Дошъл"
        then
            31@ = TRUE
        end
        free 0@
        free 1@
    end
 
    if and
        31@ == TRUE
        0B61:  samp is_local_player_spawned
    then
        wait COOLDOWN
        0AF9: samp say_msg "/protect"
        wait COOLDOWN
        0AF9: samp say_msg "/helmet"
        wait COOLDOWN
        0AF9: samp say_msg "/togmsg"
        wait COOLDOWN
        0AF9: samp say_msg "/clothes"
        wait COOLDOWN
        0AF9: samp say_msg "/sgchange"
        wait COOLDOWN
        31@ = FALSE
    end
end
writes them when the login box appears, when im not logged in... Look at this video please: https://streamable.com/sz28qi
 

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
writes them when the login box appears, when im not logged in... Look at this video please: https://streamable.com/sz28qi
lol, so the server keep u spawned even when you're not logged in

I tried using the isDialogResponded snippet from @Parazitas, but I failed, maybe he can make using it
try it:
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

CONST
    COOLDOWN = 50
END

while true
wait 0
    if and
          0B4C:  samp is_dialog_active -1
          31@ == FALSE
    then
        alloc 0@ 248
        alloc 1@ 248
        0BD8: samp get_dialog_caption 0@
        0BD7: samp get_dialog_text 1@
        if and
            0C29: $NOT_USED = stristr string1 0@ string2 "Влизане"
            0C29: $NOT_USED = stristr string1 1@ string2 "{FFFFFF}Добре Дошъл"
        then
            31@ = TRUE
        end
        free 0@
        free 1@
    end

    if and
        31@ == TRUE
        0B61:  samp is_local_player_spawned
    then
        if 0B4C:  samp is_dialog_active -1
        then
                  //do nothing
        else //wait dialog close
            wait COOLDOWN
            0AF9: samp say_msg "/protect"
            wait COOLDOWN
            0AF9: samp say_msg "/helmet"
            wait COOLDOWN
            0AF9: samp say_msg "/togmsg"
            wait COOLDOWN
            0AF9: samp say_msg "/clothes"
            wait COOLDOWN
            0AF9: samp say_msg "/sgchange"
            wait COOLDOWN
            31@ = FALSE
        end
    end
end
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
lol, so the server keep u spawned even when you're not logged in

I tried using the isDialogResponded snippet from @Parazitas, but I failed, maybe he can make using it
try it:
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

CONST
    COOLDOWN = 50
END

while true
wait 0
    if and
          0B4C:  samp is_dialog_active -1
          31@ == FALSE
    then
        alloc 0@ 248
        alloc 1@ 248
        0BD8: samp get_dialog_caption 0@
        0BD7: samp get_dialog_text 1@
        if and
            0C29: $NOT_USED = stristr string1 0@ string2 "Влизане"
            0C29: $NOT_USED = stristr string1 1@ string2 "{FFFFFF}Добре Дошъл"
        then
            31@ = TRUE
        end
        free 0@
        free 1@
    end

    if and
        31@ == TRUE
        0B61:  samp is_local_player_spawned
    then
        if 0B4C:  samp is_dialog_active -1
        then
                  //do nothing
        else //wait dialog close
            wait COOLDOWN
            0AF9: samp say_msg "/protect"
            wait COOLDOWN
            0AF9: samp say_msg "/helmet"
            wait COOLDOWN
            0AF9: samp say_msg "/togmsg"
            wait COOLDOWN
            0AF9: samp say_msg "/clothes"
            wait COOLDOWN
            0AF9: samp say_msg "/sgchange"
            wait COOLDOWN
            31@ = FALSE
        end
    end
end

You made infinity loop here with booleans
 

Juli4n

Active member
Joined
Mar 31, 2021
Messages
43
Solutions
1
Reaction score
19
Location
Argentina
maybe it works
C#:
{$CLEO .cs}
{$INCLUDE SF}

0000:

while 8AFA:
    wait 0
end

0BE1: raknet setup_outcoming_rpc_hook @O_RPC

while true
    wait 0
    if
    0@ == true
    then
        wait 1000 // wait to spawn fully
        0AF9: samp say_msg "/protect"
        wait 1000 // enter the delay you need
        0AF9: samp say_msg "/helmet"
        wait 1000 // enter the delay you need
        0AF9: samp say_msg "/togmsg"
        wait 1000 // enter the delay you need
        0AF9: samp say_msg "/clothes"
        wait 1000 // enter the delay you need
        0AF9: samp say_msg "/sgchange"
        while true
            wait 0
        end
    end
end
        
:O_RPC       
0BE5: raknet 31@ = get_hook_param PARAM_PACKETID
if
31@ == 52 // send spawn
then   
    if
    0@ == false
    then
        0@ = true
    end
end
0BE0: raknet hook_ret true
 

Excelds

Active member
Joined
Apr 17, 2021
Messages
101
Reaction score
11
Location
Earth
maybe it works
C#:
{$CLEO .cs}
{$INCLUDE SF}

0000:

while 8AFA:
    wait 0
end

0BE1: raknet setup_outcoming_rpc_hook @O_RPC

while true
    wait 0
    if
    0@ == true
    then
        wait 1000 // wait to spawn fully
        0AF9: samp say_msg "/protect"
        wait 1000 // enter the delay you need
        0AF9: samp say_msg "/helmet"
        wait 1000 // enter the delay you need
        0AF9: samp say_msg "/togmsg"
        wait 1000 // enter the delay you need
        0AF9: samp say_msg "/clothes"
        wait 1000 // enter the delay you need
        0AF9: samp say_msg "/sgchange"
        while true
            wait 0
        end
    end
end
       
:O_RPC      
0BE5: raknet 31@ = get_hook_param PARAM_PACKETID
if
31@ == 52 // send spawn
then  
    if
    0@ == false
    then
        0@ = true
    end
end
0BE0: raknet hook_ret true
tried it, it joins the server, i log in but no commands activate, like it does nothing
 

Excelds

Active member
Joined
Apr 17, 2021
Messages
101
Reaction score
11
Location
Earth
lol, so the server keep u spawned even when you're not logged in

I tried using the isDialogResponded snippet from @Parazitas, but I failed, maybe he can make using it
try it:
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

CONST
    COOLDOWN = 50
END

while true
wait 0
    if and
          0B4C:  samp is_dialog_active -1
          31@ == FALSE
    then
        alloc 0@ 248
        alloc 1@ 248
        0BD8: samp get_dialog_caption 0@
        0BD7: samp get_dialog_text 1@
        if and
            0C29: $NOT_USED = stristr string1 0@ string2 "Влизане"
            0C29: $NOT_USED = stristr string1 1@ string2 "{FFFFFF}Добре Дошъл"
        then
            31@ = TRUE
        end
        free 0@
        free 1@
    end

    if and
        31@ == TRUE
        0B61:  samp is_local_player_spawned
    then
        if 0B4C:  samp is_dialog_active -1
        then
                  //do nothing
        else //wait dialog close
            wait COOLDOWN
            0AF9: samp say_msg "/protect"
            wait COOLDOWN
            0AF9: samp say_msg "/helmet"
            wait COOLDOWN
            0AF9: samp say_msg "/togmsg"
            wait COOLDOWN
            0AF9: samp say_msg "/clothes"
            wait COOLDOWN
            0AF9: samp say_msg "/sgchange"
            wait COOLDOWN
            31@ = FALSE
        end
    end
end
yo this one works, but i need to change the wait time can u help me, cuz it writes 4 commands (/protect,/helmet,/togmsg,/clothes) it doesnt write /sgchange because it thinks im spamming commands , then it kicks me for command spawn, look at thispicture https://prnt.sc/12b6008
 

Excelds

Active member
Joined
Apr 17, 2021
Messages
101
Reaction score
11
Location
Earth
ok so 4 commands is still good, but sometimes when i click esc or write a command (sometimes only) my gta freezes then crashes
 
Status
Not open for further replies.
Top