summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/test_LLChat.lua
blob: 3abaf28e4299f7152f63c55f05a928765be6cae9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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, ' '))