CLEO Help samp ahk read chatlog

CLEO related

aymanbest

New member
Joined
Mar 5, 2020
Messages
3
Reaction score
0
Location
Hong Kong
i'm wondering if it is possible for AHK to read chatlog and everytime a specific message is sent the autohotkey then sends automatically another command.

for example of what i mean:

a guy asks for license, everytime autohotkey detects the message in chat for example
```
* Fun_ky (level 13) requested an instructor (RO). To accept his request use (/accept needlicense 440).
```
it responds by executing the command to accept needlicense the player id who asked.

in short:

1) autohotkey reads "...(/accept needlicense...."

2) it automatically types /accept needlicense (player id that asked for score)

is it possible and how?
 

Halfastrc24

Active member
Joined
Jun 4, 2021
Messages
46
Solutions
1
Reaction score
6
Location
Greenland
Can we do this? "Read chatlog and everytime a specific message is sent the autohotkey then sends automatically another command. " If yes, how? I apreciate any reply, thanks.
 

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
Don't need be this version, and doesn't need be in .ahk.
[CLEO] 0.3.7 R1 USING SAMPFUNCS:
PHP:
{$CLEO .cs}

0000: NOP

REPEAT
WAIT 1000
UNTIL 0afa:

alloc 0@ 128
alloc 1@ 128

WHILE TRUE
WAIT 0
    if 0B61:  samp is_local_player_spawned
    then
        0B75: samp get_chat_string 99 text_to 0@ prefix_to $NOT_USED color_to $NOT_USED prefix_color_to $NOT_USED
        if
            0AD4: $NOT_USED = scan_string 0@ format "Player %s [%d] is asking to be released." 1@v 2@
        then
            chatmsg "captured id: %d" -1 2@
            say "/release %d" 2@
            wait 500
        end
    end
END

if u can play in any version then you can use sampfuncs.
 
Last edited:

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
I tested it and not workig..
[CLEO] 0.3.7 R1 USING SAMPFUNCS:
PHP:
{$CLEO .cs}

0000: NOP

REPEAT
WAIT 1000
UNTIL 0afa:

alloc 0@ 128
alloc 1@ 128

WHILE TRUE
WAIT 0
    if 0B61:  samp is_local_player_spawned
    then
        0B75: samp get_chat_string 99 text_to 0@ prefix_to $NOT_USED color_to $NOT_USED prefix_color_to $NOT_USED
        if
            0AD4: $NOT_USED = scan_string 0@ format "Player %s [%d] is asking to be released." 1@v 2@
        then
            chatmsg "captured id: %d" -1 2@
            say "/release %d" 2@
            wait 500
        end
    end
END

if u can play in any version then you can use sampfuncs.
i tested it and not working bruh
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
First of all explain what exactly you trying to do and where you getting problem.

I'm trying to get the player ID from chat and then say "/sl %d"

The chatline text it's like that : Player Derrek [7} has commited a crime: speeding.

detect player id and say /mdc %d > /mdc

for automatically geting the playe mdc when im using the radar..

And I tryed this code to do that I replaced the text's but not working. Does nothing
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
First of all explain what exactly you trying to do and where you getting problem.

Code:
PHP:
{$CLEO .cs}

0000: NOP

REPEAT
WAIT 1000
UNTIL 0afa:

alloc 0@ 128
alloc 1@ 128

WHILE TRUE
WAIT 0
    if 0B61:  samp is_local_player_spawned
    then
        0B75: samp get_chat_string 99 text_to 0@ prefix_to $NOT_USED color_to $NOT_USED prefix_color_to $NOT_USED
        if
            0AD4: $NOT_USED = scan_string 0@ format "Dispatch: %s [%d] has commited a crime: speeding." 1@v 2@
        then
            chatmsg "captured id: %d" -1 2@
            say "/mdc %d" 2@
            wait 500
        end
    end

so i used this and not working. it does nothing.

full Chatlog message for that string: Dispatch: Player [ID] has commited a crime: speeding. Reporter: Unknown. W: +2. New wanted level: 2.
 
Top