Raw Source
eileen12 / HaremHeroes Auto Salary Collect

// ==UserScript==
// @name         HaremHeroes Auto Salary Collect
// @namespace    JDscripts
// @version      0.4
// @description  Turned into Harem Heroes Automatic. Visit https://openuserjs.org/scripts/eileen12/HaremHeroes_Automatic
// @author       JD
// @match        http*://nutaku.haremheroes.com/*
// @updateURL    https://openuserjs.org/install/eileen12/HaremHeroes_Automatic.user.js
// @homepage     https://openuserjs.org/scripts/eileen12/HaremHeroes_Automatic
// ==/UserScript==

var getSalary = function () {
  try {
    if ($("#breadcrumbs span").last().text() === "Harem") {
      console.log("Detected Harem Screen. Fetching Salary");
      $("#harem_whole #harem_left .salary:not('.loads') button").each(function (index) {
        $(this).click();
      });
      setTimeout(getSalary, 2 * 1000);
    }
  }
  catch (ex) {
    setTimeout(getSalary, 2 * 1000);
  }
};
$('document').ready(getSalary);