CLEO Help [CLEO] Dialog help

CLEO related
Status
Not open for further replies.

RewardK

Member
Joined
Jun 2, 2018
Messages
13
Reaction score
0
Hello ug-base, i will go directly to my question.

It's possible to read a dialog content?

On a samp server is a system named 'Hunger games', similar to PUBG. When I press L for example, i want that my script to press Y (to open the inventory), search for 'Medical kit' then press on it.
It is possible?


Help me, please. Thank you in advice for spending time with me.
 

Attachments

  • 1560962589020.png
    1560962589020.png
    80.9 KB · Views: 43

RewardK

Member
Joined
Jun 2, 2018
Messages
13
Reaction score
0
1. command to get it?
2. Samp version server use?
3. You use SAMPFUNCS?

1. I want to press a key, for example when I press F12 to execute the code.
2. 0.3.7-R2.
3. Yes.

Tank u man. <3

The inventory opener (dialog) is when I press Y, in game, i mean when I want to press F12, I want that the program open the inventory (to press Y) and search for 'Medical Kit' then press to this line.
Sorry for my bad english.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
1. I want to press a key, for example when I press F12 to execute the code.
2. 0.3.7-R2.
3. Yes.

Tank u man. <3

The inventory opener (dialog) is when I press Y, in game, i mean when I want to press F12, I want that the program open the inventory (to press Y) and search for 'Medical Kit' then press to this line.
Sorry for my bad english.
I do it after job.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
PHP:
{$CLEO .cs}

0000: NOP

wait 10000

WHILE TRUE
WAIT 0

IF 
0AB0: 123 {F12}
THEN
    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59{Y} state 255 // Send Y key
    IF
    0B4C:  samp is_dialog_active -1 // any
    THEN
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59{Y} state 0 // Disable Y Key send
        alloc 0@ 260 // ALLOC TO GET DIALOG CAPTION
        0BD8: samp get_dialog_caption 0@ // GET DIALOG CAPTION
        IF
        0C29: $NOT_USED = stristr string1 0@ string2 "Hunger Games - Container" // check dialog caption
        THEN
            0B49: samp set_current_dialog_list_item 2 // Medical kit
            0B47: samp close_current_dialog_with_button 1 // Left button = 1 , Right button = 0
        END
    END
END

END

:Set_Virtual_Key
{
    255 = true
    0 = false
    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59 state 255 
}
2@ = 0xB72CC8
0@ *= 2
005A: 2@ += 0@  // (int)
0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0
0AB2: ret 0
 

RewardK

Member
Joined
Jun 2, 2018
Messages
13
Reaction score
0
PHP:
{$CLEO .cs}

0000: NOP

wait 10000

WHILE TRUE
WAIT 0

IF
0AB0: 123 {F12}
THEN
    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59{Y} state 255 // Send Y key
    IF
    0B4C:  samp is_dialog_active -1 // any
    THEN
        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59{Y} state 0 // Disable Y Key send
        alloc 0@ 260 // ALLOC TO GET DIALOG CAPTION
        0BD8: samp get_dialog_caption 0@ // GET DIALOG CAPTION
        IF
        0C29: $NOT_USED = stristr string1 0@ string2 "Hunger Games - Container" // check dialog caption
        THEN
            0B49: samp set_current_dialog_list_item 2 // Medical kit
            0B47: samp close_current_dialog_with_button 1 // Left button = 1 , Right button = 0
        END
    END
END

END

:Set_Virtual_Key
{
    255 = true
    0 = false
    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59 state 255
}
2@ = 0xB72CC8
0@ *= 2
005A: 2@ += 0@  // (int)
0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0
0AB2: ret 0
Thank u so much, respect u <3.
 
Status
Not open for further replies.
Top