CLEO Help Export text from dialog

CLEO related
Status
Not open for further replies.

Petricko

Member
Joined
Dec 21, 2014
Messages
23
Reaction score
0
Is posible to export text from dialog to TXT file from some dialog? If is posible how.
Thanks in advance.
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
636
Reaction score
45
{$CLEO .cs}
0000: NOP

thread "LessonDialog"

if not 0@ = SAMP.Base()
then 0A93: end_custom_thread
end
while not SAMP.Available()
wait 100
end

0B34: samp register_client_command "lesson" to_label @lesson

Dialog.Create(1@,"Test Dialog")
Dialog.AddEditBox(1@, 1, "Text...", 0, 0 300, 40)
Dialog.AddButton(1@,2,"Writing", 90, 55, 120, 33)
0B5A: get_screen_resolution 2@ 3@
3@ /= 2
0B84: samp dialog 1@ set_pos_XY 0 3@ size 300 124
0B86: samp dialog 1@ set_visible false

while true
wait 0
    if 11@ == 1
    then
    0B8D: samp set_cursor_mode 2
    0B86: samp dialog 1@ set_visible true
        if
        Dialog.PopEvent(1@, 4@, 5@)
        then
            if and
            5@ == 2
            4@ == 257
            10@ = File.Open("cleo/text.txt", "at")
            then
            0AC8: 6@ = allocate_memory_size 1024
            0B89: samp dialog 1@ get_control 1 text_to 6@
            0AD9: write_formatted_text "%s%c%c" in_file 10@ 6@ 0xD 0xA
            0af8: "Written if the txt file" 0xffffff
            end
        end
    end
end
               
:lesson
0B12: 11@ = 11@ XOR 1
if
11@ == 1
then
0B86: samp dialog 1@ set_visible true
0B5D: samp toggle_cursor true
else
0B86: samp dialog 1@ set_visible false
0B5D: samp toggle_cursor false
end
0B43: samp cmd_ret
By HenryTailor
 

34qwredsfvc

Active member
Joined
Mar 23, 2013
Messages
50
Reaction score
4
I've been looking for something like this for quite a long time but I'm not sure what to do with the script posted above, does it work, if so, could anyone compile it for me? Thanks.
 
Status
Not open for further replies.
Top