summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2024-05-24 15:24:50 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2024-05-24 15:24:50 +0300
commite4b7d2f463d19cab28985414365fd8415e3dc700 (patch)
tree4c2d6ba634d2cdd0be3154d5e469a0cc9f386ca1 /indra/newview/scripts/lua
parent591a80765c4438f72795230824d2e549bafc592d (diff)
Mark script messages in compact mode too; code clean up
Diffstat (limited to 'indra/newview/scripts/lua')
-rw-r--r--indra/newview/scripts/lua/test_LLChat.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/indra/newview/scripts/lua/test_LLChat.lua b/indra/newview/scripts/lua/test_LLChat.lua
index 95bd218baa..883b82fafb 100644
--- a/indra/newview/scripts/lua/test_LLChat.lua
+++ b/indra/newview/scripts/lua/test_LLChat.lua
@@ -2,15 +2,15 @@ LLChat = require 'LLChat'
function generateRandomWord(length)
local alphabet = "abcdefghijklmnopqrstuvwxyz"
- local word = ""
+ local wordTable = {}
for i = 1, length do
local randomIndex = math.random(1, #alphabet)
- word = word .. alphabet:sub(randomIndex, randomIndex)
+ table.insert(wordTable, alphabet:sub(randomIndex, randomIndex))
end
- return word
+ return table.concat(wordTable)
end
-local msg = ""
+local msg = "AI says:"
math.randomseed(os.time())
for i = 1, math.random(1, 10) do
msg = msg .. " ".. generateRandomWord(math.random(1, 8))