summaryrefslogtreecommitdiff
path: root/indra/newview/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/scripts')
-rw-r--r--indra/newview/scripts/lua/test_LLChat.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/indra/newview/scripts/lua/test_LLChat.lua b/indra/newview/scripts/lua/test_LLChat.lua
index 95bd218baa..3c5cbeeeb2 100644
--- a/indra/newview/scripts/lua/test_LLChat.lua
+++ b/indra/newview/scripts/lua/test_LLChat.lua
@@ -2,17 +2,17 @@ LLChat = require 'LLChat'
function generateRandomWord(length)
local alphabet = "abcdefghijklmnopqrstuvwxyz"
- local word = ""
+ local word = {}
for i = 1, length do
local randomIndex = math.random(1, #alphabet)
- word = word .. alphabet:sub(randomIndex, randomIndex)
+ table.insert(word, alphabet:sub(randomIndex, randomIndex))
end
- return word
+ return table.concat(word)
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))
+ table.insert(msg, generateRandomWord(math.random(1, 8)))
end
-LLChat.sendNearby(msg)
+LLChat.sendNearby(table.concat(msg, ' '))