From 2be68f8d6e22d1ed46ec5440db1313ddf7210944 Mon Sep 17 00:00:00 2001 From: Marvin Dalheimer Date: Mon, 24 Apr 2023 21:30:09 +0200 Subject: [PATCH] Init --- HelloWorld.lua | 22 ++++++++++++++++++++++ HelloWorld.toc | 8 ++++++++ 2 files changed, 30 insertions(+) create mode 100755 HelloWorld.lua create mode 100755 HelloWorld.toc diff --git a/HelloWorld.lua b/HelloWorld.lua new file mode 100755 index 0000000..a5f96cf --- /dev/null +++ b/HelloWorld.lua @@ -0,0 +1,22 @@ +HelloWorld_Text = {} +local channel = "SAY" + +SLASH_HELLO_WORLD_ADD1 = "/hwadd" +SLASH_HELLO_WORLD_ADD2 = "/helloworldadd" + +SlashCmdList["HELLO_WORLD_ADD"] = function(msg) + local id, text = msg:match("(%S+)%s+(.+)") + if id and text then + HelloWorld_Text[id:lower()] = text + end +end + +SLASH_HELLO_WORLD_SHOW1 = "/hwshow" +SLASH_HELLO_WORLD_SHOW2 = "/helloworldshow" + +SlashCmdList["HELLO_WORLD_SHOW"] = function(msg) + local text = HelloWorld_Text[msg:lower()] + if text then + print(text) + end +end \ No newline at end of file diff --git a/HelloWorld.toc b/HelloWorld.toc new file mode 100755 index 0000000..059c060 --- /dev/null +++ b/HelloWorld.toc @@ -0,0 +1,8 @@ +## Interface: 11403 +## Title: HelloWorld +## Notes: Say Hello World to Chat +## Author: Rinma +## Version: 0.0.1 +## SavedVariables: HelloWorld_Text + +HelloWorld.lua \ No newline at end of file