Misc Groups looper script

iDisbelieve

Active Member
Reaction score
32
Author
iDisbelieve
Contributors
N/A
Quickbar Entry
javascript:
var event = new Event('change');
var openGroups = document.getElementById('open_groups');
// open groups popup instead of looping if this is not yet opened
if (openGroups.style.display !== 'none') {
openGroups.click();
} else {
var groupsDropdown = document.getElementById('group_id');
groupsDropdown.selectedIndex += 1;
// Skip over line separators
if (!groupsDropdown.value) {
groupsDropdown.selectedIndex += 1;
}
groupsDropdown.dispatchEvent(event);
}
Public?
Public
Name of the script:
Groups looper

Demo:

Functionality:
- If the Groups popup is opened:
Goes to the next village group of the player on execution
- If the groups popup is not opened:
Opens the group popup on execution

How to use:
Simply execute the script by clicking on the quick-bar link (or using a shortcut). No extra actions are required

Short explanation
As you can see, 2 paths are possible in this script: (1) open the groups popup & (2) go to the next group. I decided to split it up this way cause it looked strange if the popup opened AND went to the next group in the same execution.
 
Changelog
05/01/2021 - skip line separators in the looping
02/06/2020 - groups looper script version 1.0
Upvote 1
Top