diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-06-20 12:28:09 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-06-20 12:28:09 -0400 |
commit | d110358472b83f2f31d60ea0d76f1b426a087f56 (patch) | |
tree | 83617196e7d444c1063075e4a4c50fe19490a4ce /indra/newview/scripts/lua/test_LLChat.lua | |
parent | bb1f3f08cf93facbf926e57384674441be7e2884 (diff) | |
parent | e92689063bdbe34907348a12f1db39bc81132783 (diff) |
Merge branch 'release/luau-scripting' into lua-speedometer-demo
Diffstat (limited to 'indra/newview/scripts/lua/test_LLChat.lua')
-rw-r--r-- | indra/newview/scripts/lua/test_LLChat.lua | 18 |
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..3abaf28e42 --- /dev/null +++ b/indra/newview/scripts/lua/test_LLChat.lua @@ -0,0 +1,18 @@ +LLChat = require 'LLChat' + +function generateRandomWord(length) + local alphabet = "abcdefghijklmnopqrstuvwxyz" + local wordTable = {} + for i = 1, length do + local randomIndex = math.random(1, #alphabet) + table.insert(wordTable, alphabet:sub(randomIndex, randomIndex)) + end + return table.concat(wordTable) +end + +local msg = {'AI says:'} +math.randomseed(os.time()) +for i = 1, math.random(1, 10) do + table.insert(msg, generateRandomWord(math.random(1, 8))) +end +LLChat.sendNearby(table.concat(msg, ' ')) |