CLEO HELP Help script blackjack

davidel

Well-Known Member
Joined
Jan 17, 2020
Messages
93
Likes
2
Points
8
Location
Germania
5
#1
Can anyone help me? The whole blackjack system is based on textdraw. I made a cleo which runs the system automatically, but not how i really want. The only thing i can’t make it is that:

you have on the right side PLAYER: 14. (14 is the value of cards)
I want when the value is <= 16 to execute send click textdraw and "/bjhit" until reach 16 or more. And if the value reach 16 or higher, i want to execute "/bjstand"
this is tomething i tried but it s not working

Code:
{$CLEO .cs}

0000: NOP

REPEAT
WAIT 0
UNTIL 0AFA:


WHILE TRUE
WAIT 0
    IF
        0C5D: samp textdraw 2091 is_exists
THEN
ALLOC [email protected] = 1024
0C5A: samp textdraw 2091 get_string_to [email protected]
0AC8: [email protected] = allocate_memory_size 260
0AB1: @get_digits_to_print param_count 2 text [email protected] memory_to_store_digits_as_text [email protected]
IF [email protected] <= 16
then
wait 100
0BCA: samp send_click_textdraw 14
wait 100
0c8f: samp process_chat_input "/bjhit"
else
0c8f: samp process_chat_input "/bjstand"
END
end
END

    :get_digits_to_print
{
[email protected] = text
[email protected] = pointer to memory where digits will be stored as text
}
0C17: [email protected] = strlen [email protected]
for [email protected] = 0 to [email protected]
0085: [email protected] = [email protected] // copy pointer
005A: [email protected] += [email protected] // add offset (as the loop progresses it becomes pointers to first-last character)
0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 1 // [email protected] is the ascii number representing character
if and
[email protected] >= 0x30 // '0'
[email protected] <= 0x39 // '9'
then
0A8C: write_memory [email protected] size 1 value [email protected] virtual_protect 1
[email protected] += 1 // move to next address
end
end
0A8C: write_memory [email protected] size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0
 
Top