New script - key-drop.com

15/08/2022, 16:46:46

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/scripts/450791/1090058/New%20script%20-%20key-dropcom.js

  1. // ==UserScript==
  2. // @name New script - key-drop.com
  3. // @namespace Violentmonkey Scripts
  4. // @match https://key-drop.com/*/case-battle/list
  5. // @grant none
  6. // @version 1.0
  7. // @author wdsa#6952
  8. // @description 15/08/2022, 16:46:46
  9. // ==/UserScript==
  10.  
  11. const TARGETS = ['TOXIC', 'DIABLO','ICE BLAST', 'ROCKET RACCON','1% PROFIT','1% KNIFE'];
  12. (async () => {
  13. while (true) {
  14. await new Promise(r => setTimeout(r, 100));
  15. try {
  16. const caseName = document.querySelector('p.max-w-full.px-1.overflow-hidden').textContent;
  17. const casePrice = document.querySelector('div.flex.items-center.justify-center.rounded-tl-lg').textContent;
  18. if (TARGETS.includes(caseName) && casePrice === 'FREE') {
  19. const btn = document.querySelector('a.button.ml-1.mr-5');
  20. btn.click();
  21. }
  22. } catch {null;}
  23. }
  24. })();