Advertisement
Thibstars

unleash_invisible_horde.js

Mar 25th, 2016
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Instantiate the horde
  2. var horde = gremlins.createHorde();
  3.  
  4. //Specify the gremlin species
  5. var clicker = gremlins.species.clicker().clickTypes(['click', 'dblclick', 'mouseover', 'mousedown', 'mouseup','mousemove', 'mouseout']);
  6. var scroller = gremlins.species.scroller();
  7.  
  8. hideAction(clicker);
  9. hideAction(scroller);
  10.  
  11. horde.gremlin(clicker);
  12. horde.gremlin(scroller);
  13.  
  14. //horde.gremlin(gremlins.species.clicker();       //Clicker
  15. //horde.gremlin(gremlins.species.scroller();      //Scroller
  16. //horde.gremlin(gremlins.species.formFiller());   //Make sure to run on a page with a form
  17. //horde.gremlin(gremlins.species.typer());        //Mobile inputs
  18. //horde.gremlin(gremlins.species.toucher());      //Mobile inputs
  19.  
  20. //Custom gremlin
  21. /*
  22. horde.gremlin(function() {
  23.     console.log("Test");
  24.   });
  25.   */
  26.  
  27. //Seed the randomizer (makes the attack repeatable)
  28. horde.seed(1234);
  29.  
  30. //Code executing before unleashing the horde
  31. horde.before(function startProfiler() {
  32.     console.profile('gremlins');
  33.  
  34.     if (hasInputField()) {
  35.         var formFiller = gremlins.species.formFiller();
  36.         hideAction(formFiller);
  37.         horde.gremlin(formFiller);
  38.     }
  39. });
  40.  
  41. //Code executing after unleashing the horde
  42. horde.after(function stopProfiler() {
  43.     console.profileEnd();
  44. });
  45.  
  46. //Set the strategy to be applied to the horde
  47. horde.strategy(gremlins.strategies.distribution()
  48.   //.delay(50) // wait 50 ms between each action
  49.   .distribution([0.3, 0.3, 0.3, 0.1]) // the first three gremlins have more chances to be executed than the last
  50. );
  51.  
  52. //horde.strategy(gremlins.strategies.allTogether());
  53.  
  54. //Unleash the horde
  55. horde.unleash({nb : 10000});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement