CLEO Help Click

CLEO related
Status
Not open for further replies.

KamKam

Member
Joined
Mar 23, 2019
Messages
12
Reaction score
2
Why is the SAMP crash?
Code:
{$CLEO .cs}

0AB0:   key_pressed 88 // Click Start Script Key = X
THREAD 'TELEPORT'

:TELEPORT_11
WAIT 0
0972: put_actor $PLAYER_ACTOR at 597.2166 -1248.985 18.2856
WAIT 56500
0972: put_actor $PLAYER_ACTOR at 2239.727 -2258.781 14.7647
WAIT 500
JUMP @keyPress
WAIT 1200
0972: put_actor $PLAYER_ACTOR at 2201.598 -2199.129 13.5547
WAIT 500
jump @keyPress
WAIT 1200
0972: put_actor $PLAYER_ACTOR at 2129.484 -2276.748 14.7834
WAIT 500
JUMP @keyPress
WAIT 1200
JUMP @TELEPORT_11

:keyPress
// 0@ - key, 1@ - time
// Example: 0AB1: call @keyPress 2 key 0@ time 1@

if 0AA2: 2@ = load_library "User32.dll"
then
    if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
    then
        0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
        wait 1@
        0AA5: call 2@ num_params 4 pop 0 0 0x59 0 0@ // Click Key = Y
    end
end
0AB2: ret 0
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,113
Solutions
5
Reaction score
878
Location
Lithuania
Why is the SAMP crash?
Code:
{$CLEO .cs}

0AB0:   key_pressed 88 // Click Start Script Key = X
THREAD 'TELEPORT'

:TELEPORT_11
WAIT 0
0972: put_actor $PLAYER_ACTOR at 597.2166 -1248.985 18.2856
WAIT 56500
0972: put_actor $PLAYER_ACTOR at 2239.727 -2258.781 14.7647
WAIT 500
JUMP @keyPress
WAIT 1200
0972: put_actor $PLAYER_ACTOR at 2201.598 -2199.129 13.5547
WAIT 500
jump @keyPress
WAIT 1200
0972: put_actor $PLAYER_ACTOR at 2129.484 -2276.748 14.7834
WAIT 500
JUMP @keyPress
WAIT 1200
JUMP @TELEPORT_11

:keyPress
// 0@ - key, 1@ - time
// Example: 0AB1: call @keyPress 2 key 0@ time 1@

if 0AA2: 2@ = load_library "User32.dll"
then
    if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
    then
        0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
        wait 1@
        0AA5: call 2@ num_params 4 pop 0 0 0x59 0 0@ // Click Key = Y
    end
end
0AB2: ret 0
You must use call not jump for snippets
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
226
Location
( ͡° ͜ʖ ͡°)
Code:
{$CLEO .cs}
THREAD 'TELEPORT'



repeat
    wait 0
until 0AB0:   key_pressed 88 // Click Start Script Key = X



:TELEPORT_11
WAIT 0
0972: put_actor $PLAYER_ACTOR at 597.2166 -1248.985 18.2856
WAIT 56500
0972: put_actor $PLAYER_ACTOR at 2239.727 -2258.781 14.7647
WAIT 500
0AB1: call @keyPress 2 key 0@ time 200 // <-- replace 0@ with your key you want to press ( virtual key code)
WAIT 1200
0972: put_actor $PLAYER_ACTOR at 2201.598 -2199.129 13.5547
WAIT 500
0AB1: call @keyPress 2 key 0@ time 200
WAIT 1200
0972: put_actor $PLAYER_ACTOR at 2129.484 -2276.748 14.7834
WAIT 500
0AB1: call @keyPress 2 key 0@ time 200
WAIT 1200
JUMP @TELEPORT_11

:keyPress
// 0@ - key, 1@ - time
// Example: 0AB1: call @keyPress 2 key 0@ time 1@

if 0AA2: 2@ = load_library "User32.dll"
then
    if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
    then
        0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
        wait 1@
        0AA5: call 2@ num_params 4 pop 0 0 0x59 0 0@ // Click Key = Y
    end
end
0AB2: ret 0
 

KamKam

Member
Joined
Mar 23, 2019
Messages
12
Reaction score
2
Why is the bot not clicking the Y key?
Code:
{$CLEO .cs}
THREAD 'TELEPORT'



repeat
    wait 0
until 0AB0:   key_pressed 88 // Click Start Script Key = X



:TELEPORT_11
WAIT 0
0972: put_actor $PLAYER_ACTOR at 597.2166 -1248.985 18.2856
WAIT 56500
0972: put_actor $PLAYER_ACTOR at 2239.727 -2258.781 14.7647
WAIT 500
0AB1: call @keyPress 2 key 89 time 200 // <-- replace 0@ with your key you want to press ( virtual key code)
WAIT 1200
0972: put_actor $PLAYER_ACTOR at 2201.598 -2199.129 13.5547
WAIT 500
0AB1: call @keyPress 2 key 89 time 200
WAIT 1200
0972: put_actor $PLAYER_ACTOR at 2129.484 -2276.748 14.7834
WAIT 500
0AB1: call @keyPress 2 key 89 time 200
WAIT 1200
JUMP @TELEPORT_11

:keyPress
// 0@ - key, 1@ - time
// Example: 0AB1: call @keyPress 2 key 0@ time 1@

if 0AA2: 2@ = load_library "User32.dll"
then
    if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
    then
        0AA5: call 2@ num_params 4 pop 0 0 0 0 89
        wait 1@
        0AA5: call 2@ num_params 4 pop 0 0 0x59 0 89 // Click Key = Y
    end
end
0AB2: ret 0
 

Valiuks

Active member
Joined
Sep 9, 2018
Messages
25
Reaction score
4
idk I would use set virtual key true/false if it was me, anyone can tell me difference to that snippet?
 

JaggerJam

Active member
Joined
Sep 14, 2017
Messages
97
Reaction score
21
Code:
{$CLEO}
0000:


repeat
wait 0
until SAMP.Available()



0@ = 0
while true
wait 0

    if key_down 88
    then
        repeat
        wait 0
        until not key_down 88
        0B12: 0@ = 0@ XOR 1
    end

    if 0@ == 1
    then
        WAIT 0
        0972: put_actor $PLAYER_ACTOR at 597.2166 -1248.985 18.2856
        WAIT 56500
        0972: put_actor $PLAYER_ACTOR at 2239.727 -2258.781 14.7647
        WAIT 500
        0C72: set_virtual_key 89 down true
        wait 1
        0C72: set_virtual_key 89 down false                                               
        WAIT 1200
        0972: put_actor $PLAYER_ACTOR at 2201.598 -2199.129 13.5547
        WAIT 500
        0C72: set_virtual_key 89 down true
        wait 1
        0C72: set_virtual_key 89 down false                                                 
        WAIT 1200
        0972: put_actor $PLAYER_ACTOR at 2129.484 -2276.748 14.7834
        WAIT 500
        0C72: set_virtual_key 89 down true
        wait 1
        0C72: set_virtual_key 89 down false                             
        WAIT 1200
    end
END

Proof that it's working:
 

KamKam

Member
Joined
Mar 23, 2019
Messages
12
Reaction score
2
Thank you very much. Only there is one problem that crashes me with SAMP.
 

Attachments

  • sampcrash.png
    sampcrash.png
    9.1 KB · Views: 8

KamKam

Member
Joined
Mar 23, 2019
Messages
12
Reaction score
2
How to do it with a button on the keyboard?
Start the script by clicking the X button.
Stop the script by clicking the Z button.
Or activation/deactivation with one button X
Code:
{$CLEO .cs}

thread 'TP'

repeat
    wait 0
until 0AB0:   key_pressed 88

:TP_11
wait 0
0972: put_actor $PLAYER_ACTOR at 597.2166 -1248.985 18.2856
wait 56500
0972: put_actor $PLAYER_ACTOR at 2239.727 -2258.781 14.7647
wait 1200
0972: put_actor $PLAYER_ACTOR at 2201.598 -2199.129 13.5547
wait 1200
0972: put_actor $PLAYER_ACTOR at 2129.484 -2276.748 14.7834
wait  1200
jump @TP_11
 
Last edited:

Parazitas

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

0000: NOP

wait 10000

while true
wait 0

if
0ADC:   test_cheat "Z"
then
    0@ = true
else
    if
    0ADC:   test_cheat "X"
    then
        0@ = false
    end
end

if
0@ == true
then
    wait 0
    0972: put_actor $PLAYER_ACTOR at 597.2166 -1248.985 18.2856
    wait 56500
    0972: put_actor $PLAYER_ACTOR at 2239.727 -2258.781 14.7647
    wait 1200
    0972: put_actor $PLAYER_ACTOR at 2201.598 -2199.129 13.5547
    wait 1200
    0972: put_actor $PLAYER_ACTOR at 2129.484 -2276.748 14.7834
    wait  1200
end

end

or

PHP:
{$CLEO .cs}

0000: NOP

wait 10000

while true
wait 0

if
0ADC:   test_cheat "Z"
then
    if
    0@ == false
    then
        0@ = true
    else
        0@ = false
    end
end

if
0@ == true
then
    wait 0
    0972: put_actor $PLAYER_ACTOR at 597.2166 -1248.985 18.2856
    wait 56500
    0972: put_actor $PLAYER_ACTOR at 2239.727 -2258.781 14.7647
    wait 1200
    0972: put_actor $PLAYER_ACTOR at 2201.598 -2199.129 13.5547
    wait 1200
    0972: put_actor $PLAYER_ACTOR at 2129.484 -2276.748 14.7834
    wait  1200
end

end
 
Status
Not open for further replies.
Top