Primitive bulk sacrifice script

Discussion in 'General Discussion' started by LoganMkv, Mar 22, 2014.

  1. LoganMkv

    LoganMkv I need me some PIE!

    I still hope devs are going to make a normal bulk sacrifice feature, so I only spent 5 minutes for a temporary solution.
    It's not handling any exceptions therefore not supposed to work with locked runes, but works fine with nonchamps or champs you don't have in bgs.

    How to use:

    Open forge.
    Click rune you want to sac, rightclick the popup and select "open frame in new tab".
    Open browser console in that newly opened tab and run the following code:
    Code:
    (function ($) {
       var el = $.fn['show'];
       $.fn['show'] = function () {
         this.trigger('show');
         return el.apply(this, arguments);
       };
    })(jQuery)
    
    var toSac = 0;
    
    function bindChain(){
      $('#sacrifice-result-success').bind('show', function(){
      toSac--;
      fakeForge(true);
      });
    }
       
    function fakeForge(chain){
       if(currentType == 'c' && chain){     
        $.get($('#result-okay').attr('href'), function(r){
          var scr = r.match(/(\$(.|\n)+?)<\/s/)[1];
          var bo = r.replace(/^[\s\S]*<body.*?>|<\/body>[\s\S]*$/g, '');
          $('body').html(bo);
          eval(scr);
          bindChain();
          fakeForge();
         });
       }else{
      $('#result-okay:visible').click();
      console.log(toSac);     
      if(toSac > 0){
      $("#sacrifice-link").click();
      $("#confirm-link").click();
      }
       }
    }
    var current = parseInt($('#rune-count').text());
    toSac = parseInt(prompt('How much?', current-2));
    bindChain();
    fakeForge();
    
    you'll be prompted with amount you want to sac (all you have -2 by default), then just sit and watch.
     
    Last edited: Mar 22, 2014
    Capitulator, Boozha, Zenity and 3 others like this.
  2. Poxbrothers

    Poxbrothers Devotee of the Blood Owl

    It doesn't seem to work for me, it only sacrifices one rune and than it stops.
    Thank you for writing something to shard en mass though.


    Sincerely,

    Josh753
     
  3. LoganMkv

    LoganMkv I need me some PIE!

    Just checked, yes, it stops on champs, but works fine for nonchamps (and I was testing it on nonchamps). Will fix it soon.
     
  4. Poxbrothers

    Poxbrothers Devotee of the Blood Owl

    Alright, thanks for the clarification, will start using it on my non-champs.
    Cheers!


    Sincerely,

    Josh753
     
  5. LoganMkv

    LoganMkv I need me some PIE!

    Updated the code, now works for champs (however still won't work for locked champs).
     
  6. Pedeguerra

    Pedeguerra I need me some PIE!

    Yeah, this was a very nice initiative, kudos to you Logan!
     
  7. Nemorga

    Nemorga I need me some PIE!

    Didn't work with Chrome (at least for me), but Firefox did the trick... you must have Owl blood running through your veins, man!!

    AWESOME!!
     
    DarkJello likes this.
  8. Zenity

    Zenity Devotee of the Blood Owl

    This is awesome. I had to use Web Console though, not Browser Console (in Firefox).
     
  9. stfn

    stfn Member

  10. davre

    davre The Benevolent Technofascist

  11. Lushiris

    Lushiris I need me some PIE!

Share This Page