summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/test_group_chat.lua
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2024-08-09 18:24:25 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2024-08-09 18:24:25 +0300
commit926a32aa0a9518fe7f19d0c63b30b12a66469f2d (patch)
tree64cc0705e0df9e7048ac0f8f6576aea4d7444559 /indra/newview/scripts/lua/test_group_chat.lua
parent087cbe553e5bac6fe702200c33acc42baf4eef4f (diff)
add demo script for sending group chat messages
Diffstat (limited to 'indra/newview/scripts/lua/test_group_chat.lua')
-rw-r--r--indra/newview/scripts/lua/test_group_chat.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/test_group_chat.lua b/indra/newview/scripts/lua/test_group_chat.lua
new file mode 100644
index 0000000000..6299ba535f
--- /dev/null
+++ b/indra/newview/scripts/lua/test_group_chat.lua
@@ -0,0 +1,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