From 58cc6d9171017eb26fb4e0ba4674b89708df0c85 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Fri, 17 Jun 2016 01:22:13 +0100 Subject: [PATCH] Add example lua pattern --- chapters/chat_complex.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chapters/chat_complex.md b/chapters/chat_complex.md index deff2ac..0a6e10f 100644 --- a/chapters/chat_complex.md +++ b/chapters/chat_complex.md @@ -18,6 +18,11 @@ This chapter will show you how to make complex chat commands, such as ## Why ChatCmdBuilder? Traditionally mods implemented these complex commands using Lua patterns. + +{% highlight lua %} +local name = string.match(param, "^join ([%a%d_-]+)") +{% endhighlight %} + I however find Lua patterns annoying to write and unreadable. Because of this, I created a library to do this for you.