Join or leave a group

Assuming you already have a group created - it does not need to be “open” - this script can be used to toggle a character's membership on activation. Don't use this with any sensitive groups!

Under configuration, scripting, create a new script named e.g. ToggleOOC, then paste in the code below. Change the word “test” on the 2nd line to e.g. “OOC” or whatever suits.

// set the text betwween the "" on the next line to the name of the group to toggle.  doesn't have to be open.
String groupName="test";

if (gsMemberOf(CALLER,groupName)) {
  Integer response=gsElevatedAPIX(CALLER,"Groups.Remove",[groupName,CALLER]);
} else {
  Integer response=gsElevatedAPIX(CALLER,"Groups.Add",[groupName,CALLER]);
}