summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/test_group_chat.lua
blob: 6299ba535fdc5d1c0045483a66e946c7ab55b772 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
LLChat = require 'LLChat'
inspect = require 'inspect'
LLAgent = require 'LLAgent'
popup = require 'popup'

local OK = 'OK_okcancelbuttons'
local GROUPS = LLAgent.getGroups()

-- Choose one of the groups randomly and send group message
math.randomseed(os.time())
group_info = GROUPS[math.random(#GROUPS)]
LLChat.startGroupChat(group_info.id)
response = popup:alertYesCancel('Started group chat with ' .. group_info.name .. ' group. Send greetings?')
if next(response) == OK then
  LLChat.sendGroupIM('Greetings', group_info.id)
end