Thibstars

unleash_visible_horde.js

Mar 25th, 2016
289
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. horde.gremlin(clicker);
  9. horde.gremlin(scroller);
  10.  
  11. //horde.gremlin(gremlins.species.clicker();       //Clicker
  12. //horde.gremlin(gremlins.species.scroller();      //Scroller
  13. //horde.gremlin(gremlins.species.formFiller());   //Make sure to run on a page with a form
  14. //horde.gremlin(gremlins.species.typer());        //Mobile inputs
  15. //horde.gremlin(gremlins.species.toucher());      //Mobile inputs
  16.  
  17. //Custom gremlin
  18. /*
  19. horde.gremlin(function() {
  20.     console.log("Test");
  21.   });
  22.   */
  23.  
  24. //Seed the randomizer (makes the attack repeatable)
  25. horde.seed(1234);
  26.  
  27. //Code executing before unleashing the horde
  28. horde.before(function startProfiler() {
  29.     console.profile('gremlins');
  30. });
  31.  
  32. //Code executing after unleashing the horde
  33. horde.after(function stopProfiler() {
  34.     console.profileEnd();
  35. });
  36.  
  37. //Set the strategy to be applied to the horde
  38. horde.strategy(gremlins.strategies.distribution()
  39.   //.delay(50) // wait 50 ms between each action
  40.   .distribution([0.3, 0.3, 0.3, 0.1]) // the first three gremlins have more chances to be executed than the last
  41. );
  42.  
  43. //horde.strategy(gremlins.strategies.allTogether());
  44.  
  45. //Unleash the horde
  46. horde.unleash({nb : 10000});
Add Comment
Please, Sign In to add comment