CLEO Help Help write ini

CLEO related
Status
Not open for further replies.
Joined
Feb 2, 2018
Messages
12
Reaction score
0
Hello guys! When i want to write string in ini from event organizer its writing like this:

text=avem voie sa tragem in voi eu cu domnu mayor FORTZA  avem voie sa tragem in voi eu cu domnu mayor FORTZA avem voie sa tragem in voi eu cu domnu mayor FORTZA cine nu se izbeste kill cine nu se izbeste kill cine mai intra in mine afara cine mai intra in mine afara 
But i want to copy just "avem voie sa tragem in voi eu cu domnu mayor FORTZA", not 300 copies of texts.


There is what is copying the text. 

Code:
              if
                  0C2B: 15@ = strpbrk string 3@ control ":"
              then
                  0A8C: write_memory 15@ size 1 value 0 virtual_protect 0
                  0AF5: write_string 15@ to_ini_file "cleo\a.ini" section "msgsnormal" key "text"
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
ParmezanulThau said:
Hello guys! When i want to write string in ini from event organizer its writing like this:

text=avem voie sa tragem in voi eu cu domnu mayor FORTZA  avem voie sa tragem in voi eu cu domnu mayor FORTZA avem voie sa tragem in voi eu cu domnu mayor FORTZA cine nu se izbeste kill cine nu se izbeste kill cine mai intra in mine afara cine mai intra in mine afara 
But i want to copy just "avem voie sa tragem in voi eu cu domnu mayor FORTZA", not 300 copies of texts.


There is what is copying the text. 

Code:
              if
                  0C2B: 15@ = strpbrk string 3@ control ":"
              then
                  0A8C: write_memory 15@ size 1 value 0 virtual_protect 0
                  0AF5: write_string 15@ to_ini_file "cleo\a.ini" section "msgsnormal" key "text"

You trying put " : " in the ini?
 
Joined
Feb 2, 2018
Messages
12
Reaction score
0
Uh.. solved, thanks!
LE: or not.. when organizer is saying something, the text is "hi" and the last text is "bye" in .ini its =hi bye, @Parazitas can you help me with that?
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
ParmezanulThau said:
Uh.. solved, thanks!
LE: or not.. when organizer is saying something, the text is "hi" and the last text is "bye" in .ini its =hi bye, @Parazitas can you help me with that?

If i understand you correctly , you trying create auto answer bot .. , yes?
 
Joined
Feb 2, 2018
Messages
12
Reaction score
0
Parazitas said:
ParmezanulThau said:
Uh.. solved, thanks!
LE: or not.. when organizer is saying something, the text is "hi" and the last text is "bye" in .ini its =hi bye, @Parazitas can you help me with that?

If i understand you correctly , you trying create auto answer bot .. , yes?
yes.. like when a event organizer is saying hello man, i want to copy "hello man" in a .ini and when i press a key i want to say back "hello man"
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
ParmezanulThau said:
Parazitas said:
ParmezanulThau said:
Uh.. solved, thanks!
LE: or not.. when organizer is saying something, the text is "hi" and the last text is "bye" in .ini its =hi bye, @Parazitas can you help me with that?

If i understand you correctly , you trying create auto answer bot .. , yes?
yes.. like when a event organizer is saying hello man, i want to copy "hello man" in a .ini and when i press a key i want to say back "hello man"

Give to my little time...

Edit.:
Here take it.. 
You can easy put / edit question and answer

[shcode=cpp]
{$CLEO .cs}
0000:

REPEAT
wait 0
UNTIL 0AFA:

0B34: "aanswer" @cmd

0AC8: 1@ = allocate_memory_size 256 // alloc prefix
0AC8: 2@ = allocate_memory_size 256 // alloc to get chat text
0AC8: 5@ = allocate_memory_size 256 // alloc to get text from ini
0AC8: 6@ = allocate_memory_size 256 // alloc to get text from ini

WHILE TRUE
wait 0
FOR 0@ = 98 TO 99 /// GET CHAT LINE 98 AND 99 , 99 IS LAST CHAT LINE
0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@


IF
30@ == TRUE
THEN
    0AF4: 5@ = read_string_from_ini_file "Cleo\AutoAnswer.ini" section "OtherPlayer" key "QuestionOrText"
    IF
    0C29: $NOT_USED = stristr string1 1@ string2 5@
    THEN
        0AF4: 6@ = read_string_from_ini_file "Cleo\AutoAnswer.ini" section "You" key "AnswerOrText"
        say "%s" 6@
        wait 1000 /// added time to anti spam
    END
END

END // END FOR 0@ = 98 TO 99
END // END WHILE TRUE

:cmd
0B12: 30@ = 30@ XOR TRUE
IF
30@ == TRUE
THEN
    PRINTF "~B~Auto Answer ~w~Enabled" 1337
ELSE
    PRINTF "~B~Auto Answer ~w~Disabled" 1337
END
0B43: samp cmd_ret

[/shcode]

INI.:
[shcode=cpp]
[OtherPlayer]
QuestionOrText=Hi

[You]
AnswerOrText=Hello
[/shcode]
 
Joined
Feb 2, 2018
Messages
12
Reaction score
0
Parazitas said:
ParmezanulThau said:
Parazitas said:
ParmezanulThau said:
Uh.. solved, thanks!
LE: or not.. when organizer is saying something, the text is "hi" and the last text is "bye" in .ini its =hi bye, @Parazitas can you help me with that?

If i understand you correctly , you trying create auto answer bot .. , yes?
yes.. like when a event organizer is saying hello man, i want to copy "hello man" in a .ini and when i press a key i want to say back "hello man"

Give to my little time...

Edit.:
Here take it.. 
You can easy put / edit question and answer

[shcode=cpp]
{$CLEO .cs}
0000:

REPEAT
wait 0
UNTIL 0AFA:

0B34: "aanswer" @cmd

0AC8: 1@ = allocate_memory_size 256 // alloc prefix
0AC8: 2@ = allocate_memory_size 256 // alloc to get chat text
0AC8: 5@ = allocate_memory_size 256 // alloc to get text from ini
0AC8: 6@ = allocate_memory_size 256 // alloc to get text from ini

WHILE TRUE
wait 0
FOR 0@ = 98 TO 99 /// GET CHAT LINE 98 AND 99 , 99 IS LAST CHAT LINE
0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@


IF
30@ == TRUE
THEN
    0AF4: 5@ = read_string_from_ini_file "Cleo\AutoAnswer.ini" section "OtherPlayer" key "QuestionOrText"
    IF
    0C29: $NOT_USED = stristr string1 1@ string2 5@
    THEN
        0AF4: 6@ = read_string_from_ini_file "Cleo\AutoAnswer.ini" section "You" key "AnswerOrText"
        say "%s" 6@
        wait 1000 /// added time to anti spam
    END
END

END // END FOR 0@ = 98 TO 99
END // END WHILE TRUE

:cmd
0B12: 30@ = 30@ XOR TRUE
IF
30@ == TRUE
THEN
    PRINTF "~B~Auto Answer ~w~Enabled" 1337
ELSE
    PRINTF "~B~Auto Answer ~w~Disabled" 1337
END
0B43: samp cmd_ret

[/shcode]

INI.:
[shcode=cpp]
[OtherPlayer]
QuestionOrText=Hi

[You]
AnswerOrText=Hello
[/shcode]
It`s ok but i want like if a event organizer is typing, to write in .ini what has he sayed.
like: Event Organizer Picasso: hi everyone
i want to write in a .ini "hi everyone", but when picasso is saying after "hi x2" in .ini it`s like text=hi x2 hi everyone and i don`t know how to clear a ini string from a key.
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
@ParmezanulThau,

use strchr to find the first ':' char in the string
after you found it copy the pointer into a new var and look for the first space and copy the pointer again in to a new var
you do one more time what i told you above

if you did what i said above your copy chat should work in the following examples:

Event Organizer Penis: Text: My penis is so big.
Event organizer Penis: My penis is so cute.

following texts are copied: first example: 'my penis is so bug' , second example: 'my penis is so cute'
 
Joined
Feb 2, 2018
Messages
12
Reaction score
0
doroftel said:
@ParmezanulThau,

use strchr to find the first ':' char in the string
after you found it copy the pointer into a new var and look for the first space and copy the pointer again in to a new var
you do one more time what i told you above

if you did what i said above your copy chat should work in the following examples:

Event Organizer Penis: Text: My penis is so big.
Event organizer Penis: My penis is so cute.

following texts are copied: first example: 'my penis is so bug' , second example: 'my penis is so cute'

i`ve did this already. I`m just saying why when i`m writing in .ini the key text with your examples will be 
Code:
[blabla]
text= My penis is so cute My penis is so big
and i don`t know how to clean the string from the key or smthing like this.
 
Joined
Feb 2, 2018
Messages
12
Reaction score
0
doroftel said:
what are you saying?

I want to write string to .ini, but when a event organizer it`s saying first time "plm" and then "textul este cv" 
in .ini will be:

Code:
[Event]
Text= textul este cv plm
And i want to write only "textul este cv"
This is the code:
Code:
  if
                   0C2B: 7@ = strpbrk string 3@ control ":"
               then
                   0A8C: write_memory 7@ size 1 value 0 virtual_protect 0
                   alloc 9@ = 600
                   0C13: strcpy destination 9@ source 7@ 
                   
                    
                    0AF5: write_string 9@ to_ini_file "cleo\event.ini" section "Event" key "Text"
 
Joined
Feb 2, 2018
Messages
12
Reaction score
0
doroftel said:
you mean he's saying something else after he just said the text on /e? to just counter your copy chat?

EN: When Tiganasu is saying before on /e "luamiai varu", in .ini will be text=luamiai varu , but after if Tiganasu is saying on /e "textul ie jmecher" in my .ini file the key will be like this:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
And i don`t know why... i want to write only the last /e string..

RO: Cand Tiganasu gen scrie inainte pe /e "luamiai varu", in .ini o sa fie text=luamiai varu, da dupa aceea cand Tiganasu zice iar pe /e "textul ie jmecher" in .ini o sa fie gen asa:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
Si chiar nu inteleg de ce... scz de engleza de balta :))
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
ParmezanulThau said:
doroftel said:
you mean he's saying something else after he just said the text on /e? to just counter your copy chat?

EN: When Tiganasu is saying before on /e "luamiai varu", in .ini will be text=luamiai varu , but after if Tiganasu is saying on /e "textul ie jmecher" in my .ini file the key will be like this:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
And i don`t know why... i want to write only the last /e string..

RO: Cand Tiganasu gen scrie inainte pe /e "luamiai varu", in .ini o sa fie text=luamiai varu, da dupa aceea cand Tiganasu zice iar pe /e "textul ie jmecher" in .ini o sa fie gen asa:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
Si chiar nu inteleg de ce... scz de engleza de balta :))

This?

PHP:
0000:
 
REPEAT
wait 0
UNTIL 0AFA:
 
0B34: "aanswer" @cmd
 
0AC8: 1@ = allocate_memory_size 256 // alloc prefix
0AC8: 2@ = allocate_memory_size 256 // alloc to get chat text
0AC8: 6@ = allocate_memory_size 256 // alloc to get text from ini
 
WHILE TRUE
wait 0
FOR 0@ = 98 TO 99 /// GET CHAT LINE 98 AND 99 , 99 IS LAST CHAT LINE
0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
 
 
IF
30@ == TRUE
THEN
    IF
    0C29: $NOT_USED = stristr string1 1@ string2 "Hi"
    THEN
        0AF5: write_string 1@ to_ini_file "Cleo\AutoAnswer.ini" section "You" key "AnswerOrText"
        0AF4: 6@ = read_string_from_ini_file "Cleo\AutoAnswer.ini" section "You" key "AnswerOrText"
        say "%s" 6@
        wait 1000 /// added time to anti spam
    END
END
 
END // END FOR 0@ = 98 TO 99
END // END WHILE TRUE
 
:cmd
0B12: 30@ = 30@ XOR TRUE
IF
30@ == TRUE
THEN
    PRINTF "~B~Auto Answer ~w~Enabled" 1337
ELSE
    PRINTF "~B~Auto Answer ~w~Disabled" 1337
END
0B43: samp cmd_ret
 
Joined
Feb 2, 2018
Messages
12
Reaction score
0
Parazitas said:
ParmezanulThau said:
doroftel said:
you mean he's saying something else after he just said the text on /e? to just counter your copy chat?

EN: When Tiganasu is saying before on /e "luamiai varu", in .ini will be text=luamiai varu , but after if Tiganasu is saying on /e "textul ie jmecher" in my .ini file the key will be like this:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
And i don`t know why... i want to write only the last /e string..

RO: Cand Tiganasu gen scrie inainte pe /e "luamiai varu", in .ini o sa fie text=luamiai varu, da dupa aceea cand Tiganasu zice iar pe /e "textul ie jmecher" in .ini o sa fie gen asa:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
Si chiar nu inteleg de ce... scz de engleza de balta :))

This?

PHP:
0000:
 
REPEAT
wait 0
UNTIL 0AFA:
 
0B34: "aanswer" @cmd
 
0AC8: 1@ = allocate_memory_size 256 // alloc prefix
0AC8: 2@ = allocate_memory_size 256 // alloc to get chat text
0AC8: 6@ = allocate_memory_size 256 // alloc to get text from ini
 
WHILE TRUE
wait 0
FOR 0@ = 98 TO 99 /// GET CHAT LINE 98 AND 99 , 99 IS LAST CHAT LINE
0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
 
 
IF
30@ == TRUE
THEN
    IF
    0C29: $NOT_USED = stristr string1 1@ string2 "Hi"
    THEN
        0AF5: write_string 1@ to_ini_file "Cleo\AutoAnswer.ini" section "You" key "AnswerOrText"
        0AF4: 6@ = read_string_from_ini_file "Cleo\AutoAnswer.ini" section "You" key "AnswerOrText"
        say "%s" 6@
        wait 1000 /// added time to anti spam
    END
END
 
END // END FOR 0@ = 98 TO 99
END // END WHILE TRUE
 
:cmd
0B12: 30@ = 30@ XOR TRUE
IF
30@ == TRUE
THEN
    PRINTF "~B~Auto Answer ~w~Enabled" 1337
ELSE
    PRINTF "~B~Auto Answer ~w~Disabled" 1337
END
0B43: samp cmd_ret

No. I want to make a copy chat 
I`ve made all of these Parazitas, all I want to know now it`s why when a event organizer is saying on /e cf ( Event Organizer Name: cf ) and after this it`s saying bn ( Event Organizer Name: bn ) in my .ini file will be the string cf bn, but I want to write just the last event organizer`s text.. ( bn )
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
ParmezanulThau said:
Parazitas said:
ParmezanulThau said:
doroftel said:
you mean he's saying something else after he just said the text on /e? to just counter your copy chat?

EN: When Tiganasu is saying before on /e "luamiai varu", in .ini will be text=luamiai varu , but after if Tiganasu is saying on /e "textul ie jmecher" in my .ini file the key will be like this:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
And i don`t know why... i want to write only the last /e string..

RO: Cand Tiganasu gen scrie inainte pe /e "luamiai varu", in .ini o sa fie text=luamiai varu, da dupa aceea cand Tiganasu zice iar pe /e "textul ie jmecher" in .ini o sa fie gen asa:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
Si chiar nu inteleg de ce... scz de engleza de balta :))

This?

PHP:
0000:
 
REPEAT
wait 0
UNTIL 0AFA:
 
0B34: "aanswer" @cmd
 
0AC8: 1@ = allocate_memory_size 256 // alloc prefix
0AC8: 2@ = allocate_memory_size 256 // alloc to get chat text
0AC8: 6@ = allocate_memory_size 256 // alloc to get text from ini
 
WHILE TRUE
wait 0
FOR 0@ = 98 TO 99 /// GET CHAT LINE 98 AND 99 , 99 IS LAST CHAT LINE
0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
 
 
IF
30@ == TRUE
THEN
    IF
    0C29: $NOT_USED = stristr string1 1@ string2 "Hi"
    THEN
        0AF5: write_string 1@ to_ini_file "Cleo\AutoAnswer.ini" section "You" key "AnswerOrText"
        0AF4: 6@ = read_string_from_ini_file "Cleo\AutoAnswer.ini" section "You" key "AnswerOrText"
        say "%s" 6@
        wait 1000 /// added time to anti spam
    END
END
 
END // END FOR 0@ = 98 TO 99
END // END WHILE TRUE
 
:cmd
0B12: 30@ = 30@ XOR TRUE
IF
30@ == TRUE
THEN
    PRINTF "~B~Auto Answer ~w~Enabled" 1337
ELSE
    PRINTF "~B~Auto Answer ~w~Disabled" 1337
END
0B43: samp cmd_ret

No. I want to make a copy chat 
I`ve made all of these Parazitas, all I want to know now it`s why when a event organizer is saying on /e cf ( Event Organizer Name: cf ) and after this it`s saying bn ( Event Organizer Name: bn ) in my .ini file will be the string cf bn, but I want to write just the last event organizer`s text.. ( bn )

Show your own code... , you say know that.. , you have code?
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
ParmezanulThau said:
doroftel said:
you mean he's saying something else after he just said the text on /e? to just counter your copy chat?

EN: When Tiganasu is saying before on /e "luamiai varu", in .ini will be text=luamiai varu , but after if Tiganasu is saying on /e "textul ie jmecher" in my .ini file the key will be like this:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
And i don`t know why... i want to write only the last /e string..

RO: Cand Tiganasu gen scrie inainte pe /e "luamiai varu", in .ini o sa fie text=luamiai varu, da dupa aceea cand Tiganasu zice iar pe /e "textul ie jmecher" in .ini o sa fie gen asa:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
Si chiar nu inteleg de ce... scz de engleza de 

lmao  :iknowwhatyoudidthere:

free vars when u dont need them anymore
 
Joined
Feb 2, 2018
Messages
12
Reaction score
0
doroftel said:
ParmezanulThau said:
doroftel said:
you mean he's saying something else after he just said the text on /e? to just counter your copy chat?

EN: When Tiganasu is saying before on /e "luamiai varu", in .ini will be text=luamiai varu , but after if Tiganasu is saying on /e "textul ie jmecher" in my .ini file the key will be like this:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
And i don`t know why... i want to write only the last /e string..

RO: Cand Tiganasu gen scrie inainte pe /e "luamiai varu", in .ini o sa fie text=luamiai varu, da dupa aceea cand Tiganasu zice iar pe /e "textul ie jmecher" in .ini o sa fie gen asa:
Code:
[Sectiune]
Text=textul ie jmecher luamiai varu
Si chiar nu inteleg de ce... scz de engleza de 

lmao  :iknowwhatyoudidthere:

free vars when u dont need them anymore

Nope.. I already did that. Look some screenshots from chat https://imgur.com/a/aHwrV
And my .INI File: https://imgur.com/a/YXPRH

In my .INI File i want to be writed just Castigator:AzteK(177), and not the history.

RO: Pt ca-s prost, iti scriu si in romana, sa nu intelegi cv gresit daca raspunzi tu, @doroftel .
Vreau in .INI sa fie scris doar Castigator:AzteK(177), nu tot istoricu gen.
Uita-te mai sus ca ti-am dat niste ss-uri cu .ini-u si din chat
De dat free am dat la toate si chiar nu inteleg de ce imi scrie tot istoricu in loc sa-mi scrie doar ultimu text..
 
Status
Not open for further replies.
Top