Files
Bubberstation/code/_globalvars/_regexes.dm
SkyratBot fb24e440a6 [MIRROR] Adds linking tickets in asay, referencing mob datums in asay, improves asay ref code [MDB IGNORE] (#12475)
* Adds linking tickets in asay, referencing mob datums in asay, improves asay ref code (#65634)

About The Pull Request

Continuing on the work started in #65154 and 61712, this PR expands what asay linking can be used for and improves the code for it. You can now link tickets in asay by saying #[ticket ID] like #1. This shows the ticket's status and who filed the ahelp. Might remove the ticket filer if it's not really useful.

This also fixes an oversight of mine with datum linking, with how mobs and certain other datums (armor datums, landmarks) don't follow the memory address format for their tag values. Datum linking now uses a @ [tag] format, so you can link to a mob by saying @ mob_702 and such.

dreamseeker_2022-03-22_21-51-41.png
Why It's Good For The Game

More robust admin tools
Changelog

cl Ryll/Shaps
admin: You can now link tickets in asay with #[ticket ID], like #1 and #5.
admin: asay datum linking now functions by saying '@ [datum's tag value]`, whether it's a normal datum (@ 0x2001169) or a mob (@ mob_702) or whatever else.

Discord_2022-03-16_23-38-09.png
(old pic)

* Adds linking tickets in asay, referencing mob datums in asay, improves asay ref code

Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
Co-authored-by: Funce <funce.973@gmail.com>
2022-04-07 15:42:34 +01:00

20 lines
1.2 KiB
Plaintext

//These are a bunch of regex datums for use /((any|every|no|some|head|foot)where(wolf)?\sand\s)+(\.[\.\s]+\s?where\?)?/i
GLOBAL_DATUM_INIT(is_http_protocol, /regex, regex("^https?://"))
GLOBAL_DATUM_INIT(is_website, /regex, regex("http|www.|\[a-z0-9_-]+.(com|org|net|mil|edu)+", "i"))
GLOBAL_DATUM_INIT(is_email, /regex, regex("\[a-z0-9_-]+@\[a-z0-9_-]+.\[a-z0-9_-]+", "i"))
GLOBAL_DATUM_INIT(is_alphanumeric, /regex, regex("\[a-z0-9]+", "i"))
GLOBAL_DATUM_INIT(is_punctuation, /regex, regex("\[.!?]+", "i"))
GLOBAL_DATUM_INIT(is_color, /regex, regex("^#\[0-9a-fA-F]{6}$"))
//finds text strings recognized as links on discord. Mainly used to stop embedding.
GLOBAL_DATUM_INIT(has_discord_embeddable_links, /regex, regex("(https?://\[^\\s|<\]{2,})"))
//All < and > characters
GLOBAL_DATUM_INIT(angular_brackets, /regex, regex(@"[<>]", "g"))
//All characters forbidden by filenames: ", \, \n, \t, /, ?, %, *, :, |, <, >, ..
GLOBAL_DATUM_INIT(filename_forbidden_chars, /regex, regex(@{""|[\\\n\t/?%*:|<>]|\.\."}, "g"))
GLOBAL_PROTECT(filename_forbidden_chars)
// had to use the OR operator for quotes instead of putting them in the character class because it breaks the syntax highlighting otherwise.