CLEO Help SAMP Read dialogs and send reply

CLEO related
Status
Not open for further replies.

jeton007

Active member
Joined
May 16, 2015
Messages
29
Reaction score
1
Hi lads, is it possible to have a cleo same like those cleos that read chatstrings such as "First one to type .." but instead this one would be reading a part of the dialog ( a small random text ) and then send the same random text on the reply as a response basically like the PASSWORD type box. If you could help me i would really be thankful to you <3
 

jeton007

Active member
Joined
May 16, 2015
Messages
29
Reaction score
1
It's not an image it's basically like " write the following to get your supplies : " and then after that we get a random code like IlIkEUgBas3401K
Give me a moment for a Screenshot of it
 

jeton007

Active member
Joined
May 16, 2015
Messages
29
Reaction score
1
6UWCZIY.png
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,493
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
Hi. Put the cleo i have attached into your CLEO folder and then
open that dialog, and close it. Then post your chatlog here.
 

Attachments

  • dialogDebug.cs
    17.7 KB · Views: 52

jeton007

Active member
Joined
May 16, 2015
Messages
29
Reaction score
1
Okay i finally made it thru' the cleo, here's the parts of the chatlog while executing and finishing that dialog:
Code:
(79){A4ABA2}-- STEP 1 --
{ffffff}You're cooking drugs and prepare them for use.
Write the following in order to start the extraction:

{A4ABA2}E85F4Ef8bH5
(79){A4ABA2}-- STEP 2 --
{ffffff}Write the following in order to continue with the extraction:

{A4ABA2}d6GheB3C35c
(79){A4ABA2}-- STEP 3 --
{ffffff}Write the following in order to continue with the extraction:

{A4ABA2}8a57HE6ab3G
These codes are written inside the dialog, they change each time you put it wrong or each time you start a new one
 
Last edited:

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
I made something like this, it worked on IMRP server, you could check it out

http://www.mediafire.com/file/y2aop2zob2va1if/autoDrugs.cs/file
http://www.mediafire.com/file/u007029btn1s548/autoDrugsSettings.INI/file

activation command:
/autodrugs

It automates the process, it inputs "/buy" and "/produce heroin" commands, copies/inputs required text etc (it worked around 1 year ago, if the drugs system didn't change then it should still work)
Even if it won't work on your server you could try to modify it or ask someone to modify it. It's a good starting point to make what you need I think

The "autoDrugsSettings.ini" file allows to adjust delays between specific actions (to make the process more stable or faster), it also has variable deactivation key stored there
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
it does
Code:
0000:
 
repeat         
wait 50
until 0AFA:  is_samp_available

alloc 1@ 500
0B34: samp register_client_command "autodrugs" to_label @toggle
31@ = 0

if 0AAB:   file_exists "CLEO\autoDrugsSettings.ini"
then   
0AF0: 10@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "after_buy_cmd"
0AF0: 11@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "after_buy_item_min"
0AF0: 12@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "after_buy_item_max"
0AF0: 13@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "after_all_buying"
0AF0: 14@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "before_sending_dialog_min"
0AF0: 15@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "before_sending_dialog_max"
0AF0: 16@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "before_next_produce_heroin"
0AF0: 17@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "deactivation_key"
    //alloc 30@ 200
    //format 30@ "autoDrugsSettings: %d %d %d %d %d %d %d %d" 10@ 11@ 12@ 13@ 14@ 15@ 16@ 17@
    //chatmsg 30@ -1
    //free 30@
else
0AF8: samp add_message_to_chat "{F7F694}CLEO\autoDrugsSettings.ini {FF4800}not found. {F7F694}The mod won't work"
0A93: end_custom_thread
end
 
while true
wait 0
    if 31@ == 1
    then
        
        //deactivation by key
        call @DeactivationCheck 2 key 17@ state 31@ _returnedState 31@
                
        say "/buy"
        wait 10@
        for 30@ = 1 to 5
            call @WaitRandomTime 2 lowerBorder 11@ higherBorder 12@           
            0B49: samp set_current_dialog_list_item 4 // 3 id could be 4th item
            wait 100
            0B47: samp close_current_dialog_with_button 1 //buy button
        end
        0B47: samp close_current_dialog_with_button 2 //close button
        wait 13@

        for 30@ = 1 to 5 
            say "/produce heroin"   
                // wait for dialog
                
            for 29@ = 1 to 3
                while 8B4C: samp is_dialog_active -1
                wait 0
                    wait 20
                    call @DeactivationCheck 2 key 17@ state 31@ _returnedState 31@
                    if 31@ == 0
                    then
                    break
                    end
                end
    
                0BD7: 1@ //get text   
                call @GetLast11CharactersFromString 1 stringPointer 1@ _returnedPointer 2@ 
                call @WaitRandomTime 2 lowerBorder 14@ higherBorder 15@             
                call @SendDialogResponse 1 responseStringPointer 2@   
                wait 100     
                //printf 2@ 1000     
                                
                call @DeactivationCheck 2 key 17@ state 31@ _returnedState 31@
                if 31@ == 0
                then
                break
                end   
            end
            
            wait 16@
        end
            
    end
end

:toggle
0B12: 31@ = 31@ 1
if 31@ == 1
then
printf "autoDrugs is ~G~activated" 1000
else
printf "autoDrugs is ~R~deactivated" 1000
end
samp.CmdRet()

:GetLast11CharactersFromString
0C17: 31@ = strlen 0@
005A: 0@ += 31@  // (int)
0@ -= 11
ret 1 0@

:DeactivationCheck
if key_down 0@
then
printf "autoDrugs is ~R~deactivated" 1000
1@ = 0
end
ret 1 1@
 
:WaitRandomTime// 2 2873 3861
0209: 31@ = random_int_in_ranges 0@ 1@
wait 31@
ret 0
 
:SendDialogResponse
0B4B: samp set_current_dialog_editbox_text 0@
0B47: samp close_current_dialog_with_button 1
ret 0
 
Status
Not open for further replies.
Top