CLEO Help Help me!!

CLEO related

Jik ke

Active member
Joined
Jun 2, 2021
Messages
43
Reaction score
2
Location
America
Hi guys, can you help me to fix this error? This cleo is working: when the player enters [/y(other's id)], the command [/s%d] will be executed immediately, the cleo aims to do government work faster without no need to write the word out. But why is it still not working? Can someone help me fix it!!
Code:
{$CLEO .cs}

0000: NOP

wait 8500

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    if 0AB1: @GetLastSentTextFromChatBox 0 _Return: Command 0@ Text 1@
    then
        if 0AD4: $NOT_USED = scan_string 1@ format "/y%d" 9@
     then
    // Create Command
            0AC8: 33@ = allocate_memory_size 1024
                0AD3: 33@ = format "/s %d" 9@
             0AB1: @PROCESS_CHAT_INPUT 1 InputText 33@ 
            0A8C: write_memory 1@ size 1 value 0 virtual_protect 0 // clear last entered text
        end
    end
end
end



:GetLastSentTextFromChatBox
{
    0.3.DL
    0AB1: @GetLastSentTextFromChatBox 0 _Return: 0@
}
if 0AA2: 2@ = "samp.dll"
then               
    0A8E: 3@ = 2@ + 0x2ACA14 // CHATBOX_INPUT_POINTER     
    0A8D: 3@ = readMem 3@ sz 4 vp 0   
    0A8E: 4@ = 3@ + 0x14E5 // command
    0A8E: 5@ = 3@ + 0x1565 // text
end
0AB2: 2 4@ 5@
:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: id 0@
30@ = 0
IF 0AA2: 31@ = load_library "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END

    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END

    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END

    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END

    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
END
0AB2: ret 1 30@
:PROCESS_CHAT_INPUT
{
    0.3.DL
    Ex.:
    0AB1: @PROCESS_CHAT_INPUT 1 InputText 0@
}
IF 0AA2: 20@ = "samp.dll"
THEN
    0A8E: 21@ = 20@ + 0x2ACA14            // SAMP_CHAT_INPUT_INFO_OFFSET
    0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
    0A8E: 26@ = 22@ + 0x8                // pChatInput->pEditBox;
    0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
  
    0A8E: 24@ = 20@ + 0x85000 // CDXUTEditBox::SetText
 
    0AA8: call_function_method 24@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@
  
    0A8E: 25@ = 20@ + 0x69410 // PROCESS_INPUT
    0AA8: call_function_method 25@ struct 22@ num_params 0 pop 0 _retVal 7@
END
0AB2: 0
 
Top