Guest User

Anonfagola's Showdown Move Bot

a guest
Jul 29th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Anonfagola's Move Bot
  2. //Randomly picks a move
  3. //5% chance of switching
  4. //No formulas or any of that shit
  5.  
  6. $(document).ready(function(){
  7.     //also anonfagolas cool random object finer
  8.     $.fn.random = function(){
  9.         return this.eq(Math.floor(Math.random() * this.length));
  10.     }
  11.    
  12.     $(document).bind('DOMNodeInserted', function(e){
  13.         var obj = $(e.target);
  14.        
  15.         if(obj.attr("class") == "controls"){
  16.             var rand = Math.random() * 100;
  17.            
  18.             if(rand > 0.95 && $("[name=chooseMove]").length != 0 || $("[name=chooseSwitch]").length == 0){
  19.                 $("[name=chooseMove]").random().click();
  20.             }else{
  21.                 $("[name=chooseSwitch]").random().click();
  22.             }
  23.         }
  24.     });
  25. });
Advertisement
Add Comment
Please, Sign In to add comment