So... we see you haven't signed up here on our website.  

Do you really want to sit here and be "Unregistered" all your life?  No, of course you don't!  So, click this here link and you'll take that all important first step into enlightenment! (or something, whatever...)

[Completed] Text Match Variable

Discussion in 'Feature Requests' started by unit9495, Dec 25, 2017.

  1. unit9495

    unit9495 New Member

    Points:
    19
    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.
     
  2. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    I've had one other report of the messages not working for someone, what version of RAT are you using?
     
  3. unit9495

    unit9495 New Member

    Points:
    19
    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.
     
  4. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    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.
     
  5. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    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.
     
  6. unit9495

    unit9495 New Member

    Points:
    19
    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
     
  7. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    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 =)
     
  8. unit9495

    unit9495 New Member

    Points:
    19
    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.
     
  9. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    Added to the next version of RAT.
     
  10. unit9495

    unit9495 New Member

    Points:
    19
    Thanks I hope it wasn't too much of a burden for you.
     
  11. Trekkan

    Trekkan JFF Administrator Staff Member

    Points:
    1,232
    Not at all, I appreciate suggestions. =)
     

Share This Page