[Completed] Text Match Variable

unit9495

New member
Dec 25, 2017
5
0
1
29
Hello I am trying to create and event to call out players for attempting to execute commands they do not have access to. The event currently looks similar to the following.

Type : Text Match
Conditionals : Contains:Denying Command
Script : say " Hey {player_name} is trying to cheat."

The event triggers fine however the player_name variable is not set when the message is sent resulting in a message exactly like what is in the script qoutes.

Thank you in advance for your help.
 
Hello I am trying to create and event to call out players for attempting to execute commands they do not have access to. The event currently looks similar to the following.

Type : Text Match
Conditionals : Contains:Denying Command
Script : say " Hey {player_name} is trying to cheat."

The event triggers fine however the player_name variable is not set when the message is sent resulting in a message exactly like what is in the script qoutes.

Thank you in advance for your help.

I've had one other report of the messages not working for someone, what version of RAT are you using?
 
Version 0.1.13.2
This is the first text match event I have created. I have created other events based on public player chat with scripts that call the player_name variable and they set correctly. Thanks for the help.
 
Version 0.1.13.2
This is the first text match event I have created. I have created other events based on public player chat with scripts that call the player_name variable and they set correctly. Thanks for the help.

Ok, sounds like a bug then. I'll get that fixed up, thanks for reporting it! I'm going to move this thread to the bug report section so I don't forget it.
 
Wait... I just thought of something... this isn't a bug.

TEXT MATCH, will match any text from any text generated by the server. Because of that, there is probably not a "player" associated with the event. So, because of that I can't populate the player data, so these variables are empty. The only text that comes from the server that is generated by a player, is chat.
 
Yeah that had crossed my mind. Thanks for the help. Would there be a way to read the whole line and extract the client information.
here is what the console display line looks like.
2017-12-22T19:37:36 263637.226 INF Denying command 'killall' from client firebug1103
Perhaps like readline() in python than extract the client as a substring. Just some thoughts. Again Thank You
 
Yeah that had crossed my mind. Thanks for the help. Would there be a way to read the whole line and extract the client information.
here is what the console display line looks like.
2017-12-22T19:37:36 263637.226 INF Denying command 'killall' from client firebug1103
Perhaps like readline() in python than extract the client as a substring. Just some thoughts. Again Thank You

Is that a default 7d2d server message? It looks like, if so, yeah, I can add something in for that specifically. Its not so much that I can't do such things, its that there is no standard way the 7d2d server messages are displayed, so I'd have to parse each line, etc. But... I can do this one =)
 
Yes that was a default message taken from my logs. Up to you mate I can live without it, so if you think it would be useful and you don't mind working on it go ahead. But just to help you think, yes you would have to parse each line. Then you would have to do something like

string Line = "Denying command 'killall' from client firebug1103"
int wordIndex
IF string.contains("Denying command")
{
wordIndex = Line.IndexOf("client");
wordIndex = wordIndex + 7;
return Line.SubString(Line.Length - wordIndex);
}
Else
{
return "";
}

pardon any syntax errors I do not deal with C# but mainly sql.