Escinject

From EventScripts Community Encyclopedia

Contents

Overview

Syntax: escinject <command> <variable> <string>

Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Description

Escape special characters from <string> depending on <command> and store the result in <variable>


Note: It doesn't expand server variables. Prefix the command with es to expand variables (es escinject).

Parameters

  • command - Must be:
    • regex - escape characters like "*" with a "\" before them
    • sql - escape several characters
    • url - escape characters like "@" with %hex names
    • regexb - reverse the meaning of "escinject regex"
    • sqlb - reverse the meaning of "escinject sql"
    • urlb - reverse the meaning of "escinject url"
  • variable - In what variable store the result in
  • string - The string you want to edit


Examples

Be lazy and let escinject care about special characters:

event player_say
{
  es_xset regular_expression 0
  es_xset result 0
  escinject regex regular_expression "*** Hi ***, (dude).+"
  es_regex search result server_var(regular_expression) event_var(text)
}

Notes

  • The *b subcommand is good to get the "real" string again

See also

blog comments powered by Disqus