Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
Hello.
I see version 84.1 and in this version the bbot read messages on the client.
Please, i need a example for system message.
[Sistema Anti-Bot] Responda a pergunta a seguir através do comando !r ". Se não responder corretamente será banido. PERGUNTA: Responda essa sequencia: MRSQ"OUWTV2
Exemplo de resposta: !r QWXV@TZLY{3
R) !r MRSQ"OUWTV2
I need only example.
Posts: 3,907
Threads: 340
Joined: Feb 2012
Reputation:
0
09-24-2018, 01:43 PM
(This post was last modified: 09-27-2018, 01:30 PM by MegaNo0body.)
I loved this request! I don't have BBot here, but I believe the final macro will be similar to this:
Outdated, new version below!
[macro]1 {Anti Bot Responder} Str.Set(AntiBotMessagePattern, ^\\[Sistema Anti-Bot\\].*: \(.*?\)$) When.SystemMessage(WhenReceivedAntiBotMessage, !AntiBotMessagePattern) Exit() {WhenReceivedAntiBotMessage} Self.Say(\!r !Str.Match.1)[/macro]
This regex can be seen here: https://regex101.com/r/45XrhL/1
As you can see, this regex will match a system message similar to the one you describe, it uses a (matching group) to capture anything after the : symbol. Then, it will simply Self.Say(...) that match.
Note: the Macro Engine requires several escaping of the regex (adding \ before some characters), because the regex contains some special symbols that BBot also recognizes. Escaping them makes them normal characters
Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
09-24-2018, 09:20 PM
(This post was last modified: 09-24-2018, 10:53 PM by paradex.)
(09-24-2018, 01:43 PM)MegaNo0body Wrote: I loved this request! I don't have BBot here, but I believe the final macro will be similar to this:
[macro]1 {Anti Bot Responder} Str.Set(AntiBotMessagePattern, ^\\[Sistema Anti-Bot\\].*: \(.*?\)$) When.SystemMessage(WhenReceivedAntiBotMessage, !AntiBotMessagePattern) Exit() {WhenReceivedAntiBotMessage} Self.Say(\!r !Str.Match.1)[/macro]
This regex can be seen here: https://regex101.com/r/45XrhL/1
As you can see, this regex will match a system message similar to the one you describe, it uses a (matching group) to capture anything after the : symbol. Then, it will simply Self.Say(...) that match.
Note: the Macro Engine requires several escaping of the regex (adding \ before some characters), because the regex contains some special symbols that BBot also recognizes. Escaping them makes them normal characters ![Smile Smile](https://forums.bmega.net/images/smilies/smile.png)
After create "once macro" paste the line and "enable auto macros" my bbot enter in Panic mode.
Posts: 1,630
Threads: 103
Joined: Sep 2015
Reputation:
0
(09-24-2018, 09:20 PM)paradex Wrote: After create "once macro" paste the line and "enable auto macros" my bbot enter in Panic mode.
![Sad Sad](https://forums.bmega.net/images/smilies/sad.png)
Because that isn't finished macro yet.
I'm still trying to figure out it
Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
Posts: 1,630
Threads: 103
Joined: Sep 2015
Reputation:
0
(09-25-2018, 11:31 AM)paradex Wrote: OK, I am wait ![Wink Wink](https://forums.bmega.net/images/smilies/wink.png)
I didnt mean this one in particular, i meant that string reading and when macros overall.
instead of wait, try to understand it also, google how RegEx works (regular expressions)
analyze what BMega made in casino macro.
Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
(09-25-2018, 12:36 PM)Catar Wrote: (09-25-2018, 11:31 AM)paradex Wrote: OK, I am wait ![Wink Wink](https://forums.bmega.net/images/smilies/wink.png)
I didnt mean this one in particular, i meant that string reading and when macros overall.
instead of wait, try to understand it also, google how RegEx works (regular expressions)
analyze what BMega made in casino macro.
Sorry, i am not waiting the solution, i am Talk wrong. (Sorry for that)
I am testing That.
----------------//------------------
Str.Set(A, oi)
When.PrivateMessage(WhenOI, !A)
Exit()
{WhenOI}
Self.say(oi)
Exit()
----------------//------------------
That Still work greath.
I am go working in respond "antibot" I am need get character in position 158 at 169.
I think is more easy.
Sorry my bad ingles.
Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
09-26-2018, 11:20 AM
(This post was last modified: 09-26-2018, 11:21 AM by paradex.)
First change Str.set to Str.Regex and stop panic error.
But I dont understand Regex.
Str.Regex(AntiBotMessagePattern, ^\[Sistema Anti-Bot\].*: \(.*?\)$)
When.SystemMessage(WhenReceivedAntiBotMessage, !AntiBotMessagePattern)
Exit()
{WhenReceivedAntiBotMessage}
Self.Say(\!r !Str.Match.1)
exit()
In red It is pieces i a dont understand.
I think so, get positional caracter 158 at 169 is more easy.
You have regex for get this characters?
Posts: 3,907
Threads: 340
Joined: Feb 2012
Reputation:
0
Updated
[macro]1 {Anti Bot Responder} Str.Set(AntiBotMessagePattern, ^.*?\\[Sistema Anti-Bot\\].*?: \(.*?\)$) When.AnyMessage(WhenReceivedAntiBotMessage, !AntiBotMessagePattern) Exit() Comment(Testing tip, only after Message.Text is set) Str.Regex(AntiBotMessagePattern, Message.Text) Exit() {WhenReceivedAntiBotMessage} Self.Say(\!r !Str.Match.1)[/macro]
Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
(09-27-2018, 01:29 PM)MegaNo0body Wrote: Updated
[macro]1 {Anti Bot Responder} Str.Set(AntiBotMessagePattern, ^.*?\\[Sistema Anti-Bot\\].*?: \(.*?\)$) When.AnyMessage(WhenReceivedAntiBotMessage, !AntiBotMessagePattern) Exit() Comment(Testing tip, only after Message.Text is set) Str.Regex(AntiBotMessagePattern, Message.Text) Exit() {WhenReceivedAntiBotMessage} Self.Say(\!r !Str.Match.1)[/macro]
Dosen't work
I am respond
13:00 Xxxxxxx [xxx]: !r ?Str.Match.1
I need respond: MRSQ"OUWTV2
But this string is random...
Posts: 3,907
Threads: 340
Joined: Feb 2012
Reputation:
0
(09-27-2018, 04:04 PM)paradex Wrote: (09-27-2018, 01:29 PM)MegaNo0body Wrote: Updated
[macro]1 {Anti Bot Responder} Str.Set(AntiBotMessagePattern, ^.*?\\[Sistema Anti-Bot\\].*?: \(.*?\)$) When.AnyMessage(WhenReceivedAntiBotMessage, !AntiBotMessagePattern) Exit() Comment(Testing tip, only after Message.Text is set) Str.Regex(AntiBotMessagePattern, Message.Text) Exit() {WhenReceivedAntiBotMessage} Self.Say(\!r !Str.Match.1)[/macro]
Dosen't work ![Sad Sad](https://forums.bmega.net/images/smilies/sad.png)
I am respond
13:00 Xxxxxxx [xxx]: !r ?Str.Match.1
I need respond: MRSQ"OUWTV2
But this string is random...
Please, screenshoot your Variables screen after you receive the message.
Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
09-27-2018, 04:31 PM
Posts: 3,907
Threads: 340
Joined: Feb 2012
Reputation:
0
Are you sure you`re using the last version?
Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
(09-27-2018, 06:41 PM)MegaNo0body Wrote: Are you sure you`re using the last version?
Yes...
84.1
see my print...
Posts: 3,907
Threads: 340
Joined: Feb 2012
Reputation:
0
The last version of the macro I mean, because in your variables, I see AntiBotMessagePattern is totally wrong.
Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
09-28-2018, 04:41 PM
(This post was last modified: 09-28-2018, 04:42 PM by paradex.)
(09-28-2018, 02:46 PM)MegaNo0body Wrote: The last version of the macro I mean, because in your variables, I see AntiBotMessagePattern is totally wrong.
ahhh sorry.
I have one modifications.
1 {Anti Bot Responder} Str.Set(AntiBotMessagePattern, ^.*?\[Sistema Anti-Bot\].*?: \(.*?\)$) When.AnyMessage(WhenReceivedAntiBotMessage, !AntiBotMessagePattern) Exit() Comment(Testing tip, only after Message.Text is set) Str.Regex(AntiBotMessagePattern, Message.Text) Exit() {WhenReceivedAntiBotMessage} Self.Say(\!r !Str.Match.1)
for
1 {Anti Bot Responder} Str.Set(AntiBotMessagePattern, Anti) When.AnyMessage(WhenReceivedAntiBotMessage, !AntiBotMessagePattern) Exit() Comment(Testing tip, only after Message.Text is set) Str.Regex(AntiBotMessagePattern, Message.Text) Exit() {WhenReceivedAntiBotMessage} Self.Say(\!r !Str.Match.1)
If i use "^.*?\[Sistema Anti-Bot\].*?: \(.*?\)$" my bbot receive "panic mode".
I think so change Str.Set to STR.Regex. but doesn't work too.
PS: I am hunting now and wait this message for more tests...
Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
Mega...
I am change in your macro only string "str.Set" to "str.Regex" Because Str.Set causes panic mode in bbot if i use Regex sintax...
See that.
Variables:
https://imageshack.us/i/poQGuiu4p
Macro:
https://imageshack.us/i/plw3XCkCp
Answer:
https://imageshack.us/i/pnZPtjG4p
I need get de Bold and underlined characters:
15:57 [Sistema Anti-Bot] Responda a pergunta a seguir através do comando !r ". Se não responder corretamente será banido. PERGUNTA: Responda essa sequencia: DNOM*KQBPR6
Exemplo de resposta: !r QWXV@TZLY{3
Posts: 3,907
Threads: 340
Joined: Feb 2012
Reputation:
0
09-29-2018, 11:59 AM
(This post was last modified: 09-29-2018, 12:01 PM by MegaNo0body.)
(09-28-2018, 07:06 PM)paradex Wrote: Mega...
I am change in your macro only string "str.Set" to "str.Regex" Because Str.Set causes panic mode in bbot if i use Regex sintax...
See that.
Variables:
https://imageshack.us/i/poQGuiu4p
Macro:
https://imageshack.us/i/plw3XCkCp
Answer:
https://imageshack.us/i/pnZPtjG4p
I need get de Bold and underlined characters:
15:57 [Sistema Anti-Bot] Responda a pergunta a seguir através do comando !r ". Se não responder corretamente será banido. PERGUNTA: Responda essa sequencia: DNOM*KQBPR6
Exemplo de resposta: !r QWXV@TZLY{3
Please, read the documentation http://wiki.bmega.net/doku.php?id=macros...nds#string
You can`t simply change the Str.Set to Str.Regex, because they do different things. Also, When requires a Str.Set.
Tweaks you can do:
1. change the When.SystemMessage to When.AnyMessage
2. change the pattern to something valid, 'anti' is not a valid pattern. Regular Expressions are an advanced topic and there's no way to make them simpler. The one I gave you on the sample should work for most of the cases, just try modifing it so that it will filter the right message.
Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
(09-29-2018, 11:59 AM)MegaNo0body Wrote: (09-28-2018, 07:06 PM)paradex Wrote: Mega...
I am change in your macro only string "str.Set" to "str.Regex" Because Str.Set causes panic mode in bbot if i use Regex sintax...
See that.
Variables:
https://imageshack.us/i/poQGuiu4p
Macro:
https://imageshack.us/i/plw3XCkCp
Answer:
https://imageshack.us/i/pnZPtjG4p
I need get de Bold and underlined characters:
15:57 [Sistema Anti-Bot] Responda a pergunta a seguir através do comando !r ". Se não responder corretamente será banido. PERGUNTA: Responda essa sequencia: DNOM*KQBPR6
Exemplo de resposta: !r QWXV@TZLY{3
Please, read the documentation http://wiki.bmega.net/doku.php?id=macros...nds#string
You can`t simply change the Str.Set to Str.Regex, because they do different things. Also, When requires a Str.Set.
Tweaks you can do:
1. change the When.SystemMessage to When.AnyMessage
2. change the pattern to something valid, 'anti' is not a valid pattern. Regular Expressions are an advanced topic and there's no way to make them simpler. The one I gave you on the sample should work for most of the cases, just try modifing it so that it will filter the right message.
MegaNobody... You dont understand...
If I use, str.set i receiver bbot panic error, see this.
https://imageshack.com/a/img922/5563/AUvLwb.png
See variables:
https://imageshack.com/a/img924/4186/0KpEyy.png
Posts: 35
Threads: 7
Joined: Dec 2014
Reputation:
0
|