summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/test_LLChat.lua
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2024-05-23 22:06:12 +0300
committerGitHub <noreply@github.com>2024-05-23 22:06:12 +0300
commit591a80765c4438f72795230824d2e549bafc592d (patch)
treed913b4083236bf6e4aa55861b52cb57341f0458c /indra/newview/scripts/lua/test_LLChat.lua
parent58cf9c5c23c10752b26dcac384b51c85f9407ca6 (diff)
parentc38e71411080af9e03646bbe34f766201d942afd (diff)
Merge pull request #1547 from secondlife/lua-nearby-chat
Add support for sending messages to Nearby chat from Lua script
Diffstat (limited to 'indra/newview/scripts/lua/test_LLChat.lua')
-rw-r--r--indra/newview/scripts/lua/test_LLChat.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/test_LLChat.lua b/indra/newview/scripts/lua/test_LLChat.lua
new file mode 100644
index 0000000000..95bd218baa
--- /dev/null
+++ b/indra/newview/scripts/lua/test_LLChat.lua
@@ -0,0 +1,18 @@
+LLChat = require 'LLChat'
+
+function generateRandomWord(length)
+ local alphabet = "abcdefghijklmnopqrstuvwxyz"
+ local word = ""
+ for i = 1, length do
+ local randomIndex = math.random(1, #alphabet)
+ word = word .. alphabet:sub(randomIndex, randomIndex)
+ end
+ return word
+end
+
+local msg = ""
+math.randomseed(os.time())
+for i = 1, math.random(1, 10) do
+ msg = msg .. " ".. generateRandomWord(math.random(1, 8))
+end
+LLChat.sendNearby(msg)