nicologies / OctopusGuidedModeAutoIgnore

// ==UserScript==
// @name         OctopusGuidedModeAutoIgnore
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Automatically exclude tentacle if failed in guided mode
// @author       You
// @match        https://odeploy.embedcard.com:81/*
// @grant        none
// @license      MIT
// ==/UserScript==


function assignToMe(){
    var buttons = window.document.querySelectorAll("button[title='Assign to me']");
    for(var bt of buttons){
        if(bt.disabled){
            continue;
        }
        console.log("assigning to me");
        bt.click();
        break;
    }
    setTimeout(assignToMe, 10000);
}

function excludeFromDeployment(){
    var buttons = window.document.querySelectorAll("button[title='Exclude machine from deployment']");
    for(var bt of buttons){
        if(bt.disabled){
            continue;
        }
        console.log("excluding from deployment");
        bt.click();
        break;
    }
    setTimeout(excludeFromDeployment, 10000);
}
(function() {
    'use strict';
     setTimeout(assignToMe, 1000);
     setTimeout(excludeFromDeployment, 2000);

    // Your code here...
})();