From e4b7d2f463d19cab28985414365fd8415e3dc700 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 24 May 2024 15:24:50 +0300 Subject: Mark script messages in compact mode too; code clean up --- indra/newview/scripts/lua/test_LLChat.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/scripts/lua') 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)) -- cgit v1.2.3