Advertisement
KK20

10 Bet

Sep 24th, 2019
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         10 Bet
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.0
  5. // @description  Adds 10-Bet buttons to Neofoodclub oldpage
  6. // @author       KK20
  7. // @match        http://neofoodclub.fr/oldpage.html*
  8. // @require      https://code.jquery.com/jquery-3.1.0.min.js
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. this.$ = this.jQuery = jQuery.noConflict(true);
  13.  
  14. function ten_bet(arena_id, pirate_row) {
  15.     $("tbody:eq("+arena_id+") tr:eq("+pirate_row+") input:radio").prop("checked", true).trigger("click");
  16. }
  17.  
  18. $(function() {
  19.     $('table:first tbody tr:not(:last) td:last-child:not([colspan])').after('<td><input class="ten-bet" type="button" value="10-Bet"/></td>');
  20.  
  21.     $("input.ten-bet").click(function(){
  22.         var id = $("input.ten-bet").index(this);
  23.         var arena_id = parseInt(id / 5);
  24.         var pirate_row = id % 5;
  25.         ten_bet(arena_id, pirate_row)
  26.     });
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement