Loot Droop

Auto click the enter lootdrop modal and close it on vulcun.com

  1. // ==UserScript==
  2. // @name Loot Droop
  3. // @description Auto click the enter lootdrop modal and close it on vulcun.com
  4. // @match https://vulcun.com/user/lobby
  5. // @version 0.0.1.20160409220213
  6. // @namespace https://greasyfork.org/users/37930
  7. // ==/UserScript==
  8. /* jshint -W097 */
  9. 'use strict';
  10.  
  11. $('.modal:not(#lootEnterModal)').on('shown.bs.modal', function() {
  12. setTimeout(closeModal, randomBetween(2000,5000));
  13. });
  14.  
  15. $('#lootEnterModal').on('shown.bs.modal', function() {
  16. setTimeout(clickLootdrop, randomBetween(5000,15000)); //5s - 15s
  17. });
  18.  
  19. function clickLootdrop() {
  20. $('#enter-lootdrop')[0].click();
  21. var interval = setInterval(function() {
  22. if($('#dropped-state:visible').length > 0) {
  23. clearInterval(interval);
  24. setTimeout(closeModal, randomBetween(2000,5000));
  25. }
  26. }, 1000);
  27.  
  28. }
  29.  
  30. function randomBetween(min, max) {
  31. return Math.random()*(max-min) + min;
  32. }
  33.  
  34. function closeModal() {
  35. $('.modal').modal('hide')
  36. }