hello i tried to combine 2 cleos but didnt work cuz i am beginner..
i colored the things i want to do
when i type /txd to get the number from the textdraw and put in the dialog with dialog_editbox
i dont know how to do that..
also if you could open the dialog it would be awesome..key=Y
{$CLEO .cs}
0000:
0AB1: call_scm_func @RUN_CLEO 1 AT LINE @FIRST
0B34: "txd" @FIRST
:SECOND
WHILE TRUE
wait 0
if and
31@ == TRUE
0B4C: samp is_dialog_active -1 // any dialog
THEN
0AC8: 0@ = allocate_memory_size 260
0BD8: samp get_dialog_caption 0@ /// Get dialot caption
IF
0C29: $NOT_USED = stristr string1 0@ string2 "Select"
THEN
0B49: samp set_current_dialog_list_item 0
0B47: samp close_current_dialog_with_button 1
END
IF
0C29: $NOT_USED = stristr string1 0@ string2 "Enter ammount"
THEN
0B4B: samp set_current_dialog_editbox_text "1@"
0B47: samp close_current_dialog_with_button 1
31@ = FALSE
END
END
:FIRST
WHILE TRUE
wait 0
1@ = 2246
if 0C5D: samp textdraw 1@ is_exists
then
alloc 2@ = 1024
0C5A: samp textdraw 2246 get_string_to 0@
0AC8: 1@ = allocate_memory_size 260
0AB1: @get_digits_to_print param_count 2 text 0@ memory_to_store_digits_as_text 1@
say 1@ //test
FREE 0@
end
0B43:
:RUN_CLEO
0A9F: 32@ = current_thread_pointer
000A: 32@ += 0x10
0A8D: 32@ = read_memory 32@ size 4 virtual_protect 0
0062: 32@ -= 0@
0AA7: call_function 0x464C20 num_params 1 pop 1 32@ 33@
005A: 32@ += 0@
000A: 33@ += 0x10
0A8C: write_memory 33@ size 4 value 32@ virtual_protect 0
000A: 33@ += 0x2C
for 32@ = 0 to 30
0A8C: write_memory 33@ size 4 value 1@(32@,30i) virtual_protect 0
000A: 33@ += 4
end
0AB2: ret 0
:get_digits_to_print
{
0@ = text
1@ = pointer to memory where digits will be stored as text
}
0C17: 31@ = strlen 0@
for 30@ = 0 to 31@
0085: 29@ = 0@ // copy pointer
005A: 29@ += 30@ // add offset (as the loop progresses it becomes pointers to first-last character)
0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
if and
28@ >= 0x30 // '0'
28@ <= 0x39 // '9'
then
0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
1@ += 1 // move to next address
end
end
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0
0000:
0AB1: call_scm_func @RUN_CLEO 1 AT LINE @FIRST
0B34: "txd" @FIRST
:SECOND
WHILE TRUE
wait 0
if and
31@ == TRUE
0B4C: samp is_dialog_active -1 // any dialog
THEN
0AC8: 0@ = allocate_memory_size 260
0BD8: samp get_dialog_caption 0@ /// Get dialot caption
IF
0C29: $NOT_USED = stristr string1 0@ string2 "Select"
THEN
0B49: samp set_current_dialog_list_item 0
0B47: samp close_current_dialog_with_button 1
END
IF
0C29: $NOT_USED = stristr string1 0@ string2 "Enter ammount"
THEN
0B4B: samp set_current_dialog_editbox_text "1@"
0B47: samp close_current_dialog_with_button 1
31@ = FALSE
END
END
:FIRST
WHILE TRUE
wait 0
1@ = 2246
if 0C5D: samp textdraw 1@ is_exists
then
alloc 2@ = 1024
0C5A: samp textdraw 2246 get_string_to 0@
0AC8: 1@ = allocate_memory_size 260
0AB1: @get_digits_to_print param_count 2 text 0@ memory_to_store_digits_as_text 1@
say 1@ //test
FREE 0@
end
0B43:
:RUN_CLEO
0A9F: 32@ = current_thread_pointer
000A: 32@ += 0x10
0A8D: 32@ = read_memory 32@ size 4 virtual_protect 0
0062: 32@ -= 0@
0AA7: call_function 0x464C20 num_params 1 pop 1 32@ 33@
005A: 32@ += 0@
000A: 33@ += 0x10
0A8C: write_memory 33@ size 4 value 32@ virtual_protect 0
000A: 33@ += 0x2C
for 32@ = 0 to 30
0A8C: write_memory 33@ size 4 value 1@(32@,30i) virtual_protect 0
000A: 33@ += 4
end
0AB2: ret 0
:get_digits_to_print
{
0@ = text
1@ = pointer to memory where digits will be stored as text
}
0C17: 31@ = strlen 0@
for 30@ = 0 to 31@
0085: 29@ = 0@ // copy pointer
005A: 29@ += 30@ // add offset (as the loop progresses it becomes pointers to first-last character)
0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
if and
28@ >= 0x30 // '0'
28@ <= 0x39 // '9'
then
0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
1@ += 1 // move to next address
end
end
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0
when i type /txd to get the number from the textdraw and put in the dialog with dialog_editbox
i dont know how to do that..
also if you could open the dialog it would be awesome..key=Y