BVS Scratchy Helper

Makes obtaining a Claymore ergonomic!

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           BVS Scratchy Helper
// @namespace      kaz
// @description    Makes obtaining a Claymore ergonomic!
// @include        http://www.animecubed.com/billy/bvs/partyhouse.html
// @version        0.2
// @grant          none
// ==/UserScript==

// This script requires that you are S2+ Legacy to work!
// Hotkeys: d - take action

function clickSuperBilly() {
   var images = Array.prototype.slice.apply(document.getElementsByTagName('img'));
   var length = images.length;
   for(var i = 0; i < length; ++i) {
      if(images[i].src == "http://www.animecubed.com/billy/layout/scratchJackpotX.jpg") {
        images[i].onclick();
        return;
      }
   }
}

function clickRandomSpots() {
  var randomSpots = document.querySelectorAll("a[href^='javascript:quickcheck']")[0].href.substring(21).replace(/%20|\(|\)|;|'/g,"").split(',');
  quickcheck(randomSpots[0], randomSpots[1], randomSpots[2]);
}

function processEvent(event) {
  var input = event.keyCode;
  var supupd = null;
  if (input == 68) {
    var supupd = document.getElementById("supupd");
    if (supupd != null) {
      supupd.checked = true;
      document.scratch.submit();
    } else {
      clickRandomSpots();
      clickSuperBilly();
      document.mainform2.submit();
    }
  }
}

window.addEventListener("keyup", processEvent, false);