Difference between revisions of "AdminBot for LSL/Commands/SB INVITE SEND"

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE: SB_INVITE_SEND}} <onlyinclude>Invites resident to the group.</onlyinclude> {{API Variables Table}} {{AdminBot Required Vars|SB_INVITE_SEND}} {{API Variable|s...")
 
 
(9 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
<onlyinclude>Invites resident to the group.</onlyinclude>
 
<onlyinclude>Invites resident to the group.</onlyinclude>
  
{{API Variables Table}}
+
{{AdminBot Variables Table|command=SB_INVITE_SEND}}
  
 
{{AdminBot Required Vars|SB_INVITE_SEND}}
 
{{AdminBot Required Vars|SB_INVITE_SEND}}
{{API Variable|str|yes}} flags
+
{{AdminBot Variable|str|yes}} flags, separated by commas
  
 
The following flags can be used:
 
The following flags can be used:
Line 12: Line 12:
 
* Role:''role-name'' - invite to specific role instead of "Everyone"
 
* Role:''role-name'' - invite to specific role instead of "Everyone"
  
The flags have to be separated by commas (see the "Examples" section below).
+
See the "Examples" section below.
  
{{API Variable|id|yes}} avatar UUID
+
{{AdminBot Variable|id|yes}} avatar UUID
  
 
{{API Variables Table End}}
 
{{API Variables Table End}}
Line 20: Line 20:
 
== Comments ==
 
== Comments ==
  
This command invites resident to the group. By default, existing group members are not invited. The invitation is being sent to the "Everyone" role.
+
=== Avoiding invitation spam ===
  
The default behavior can be changed by using ''flags''.
+
By default, SmartBots does not invite existing group members. Bot reads the list of existing members every 15-20 minutes. Thus:
  
=== Important: existing members check ===
+
* if avatar leaves the group, bot will not invite him to the group during the next 20 minutes.
 +
* if avatar just joined the group, an immediate second join command will send another group invitation (bot still does not know about new group member).
  
Bot updates the list of existing members every hour. Thus,
+
To invite existing group members too, use the ''FORCE'' flag to invite them too.
* if avatar leaves the group, bot will not invite him to the group during the next 60 minutes.
+
* if avatar just joined the group, immediate second join command will send another group invitation (bot still does not know about new group member).
+
  
Take this into account while testing your group inviter.
 
  
 
=== Roles ===
 
=== Roles ===
  
==== 1. Use the role name, not the role title! The name is case-sensitive. ====
+
By default, an invitation is being sent to "Everyone" role. This can be changed by using the ''Role'' flag.
 +
 
 +
==== 1. Use the role name, not the role title! The name is case-sensitive ====
  
 
Make sure that you use the role name. Using the role title (or the role tag name) won't work. Also remember that role name is cAsE SeNsItIvE!  
 
Make sure that you use the role name. Using the role title (or the role tag name) won't work. Also remember that role name is cAsE SeNsItIvE!  
Line 43: Line 43:
  
 
Inviting to the specific role requires additional group setup:
 
Inviting to the specific role requires additional group setup:
 +
 
# "Assign members to Assigner's Roles" ability given to the bot
 
# "Assign members to Assigner's Roles" ability given to the bot
 
# Bot have to be a member of that role.  
 
# Bot have to be a member of that role.  
Line 52: Line 53:
 
== Examples ==
 
== Examples ==
  
See [[SB_INVITE_SEND Examples]] for group inviter example.s
+
Invite resident to the group on touch:
 +
 
 +
<syntaxhighlight lang="lsl">
 +
touch_start(integer detected) {
 +
  // "FORCE" means to invite existing group members too
 +
  llMessageLinked(LINK_SET, SB_INVITE_SEND, "", llDetectedKey(0));
 +
}
 +
</syntaxhighlight>
 +
 
 +
Invite resident to the custom role:
 +
 
 +
 
 +
<syntaxhighlight lang="lsl">
 +
touch_start(integer detected) {
 +
  // We use the "Role" flag to specify the role
 +
  llMessageLinked(LINK_SET, SB_INVITE_SEND, "Role:Tenants", llDetectedKey(0));
 +
}
 +
</syntaxhighlight>
 +
 
 +
 
 +
Also see [[AdminBot_for_Groups/Examples/Group_Inviter_Script|Group Inviter Script]] for a complex group inviter example.
  
 
{{AdminBot for Groups Commands - standard footer}}
 
{{AdminBot for Groups Commands - standard footer}}

Latest revision as of 13:11, 12 May 2017

Invites resident to the group.

// Command usage:
llMessageLinked(LINK_SET, SB_INVITE_SEND, string str, key id);


API parameters

llMessageLinked function accepts str and id parameters. Their meaning for SB_INVITE_SEND is explained below:

Variable Required Description.


str yes flags, separated by commas

The following flags can be used:

  • FORCE - send invitation to existing group members
  • Role:role-name - invite to specific role instead of "Everyone"

See the "Examples" section below.

id yes avatar UUID

Comments

Avoiding invitation spam

By default, SmartBots does not invite existing group members. Bot reads the list of existing members every 15-20 minutes. Thus:

  • if avatar leaves the group, bot will not invite him to the group during the next 20 minutes.
  • if avatar just joined the group, an immediate second join command will send another group invitation (bot still does not know about new group member).

To invite existing group members too, use the FORCE flag to invite them too.


Roles

By default, an invitation is being sent to "Everyone" role. This can be changed by using the Role flag.

1. Use the role name, not the role title! The name is case-sensitive

Make sure that you use the role name. Using the role title (or the role tag name) won't work. Also remember that role name is cAsE SeNsItIvE!

If role-name is misspelled, then invite will work though but will invite avatars to default Everyone role.

2. Give the necessary permissions to the bot!

Inviting to the specific role requires additional group setup:

  1. "Assign members to Assigner's Roles" ability given to the bot
  2. Bot have to be a member of that role.

If bot has lack abilities, the flashing pop-up appears in viewer of the invited person, reporting that "Inviter is lack of permission...".

Read Inviting residents to custom role page for more details.

Examples

Invite resident to the group on touch:

touch_start(integer detected) {
  // "FORCE" means to invite existing group members too
  llMessageLinked(LINK_SET, SB_INVITE_SEND, "", llDetectedKey(0));
}

Invite resident to the custom role:


touch_start(integer detected) {
  // We use the "Role" flag to specify the role
  llMessageLinked(LINK_SET, SB_INVITE_SEND, "Role:Tenants", llDetectedKey(0));
}


Also see Group Inviter Script for a complex group inviter example.