Skip to content

Instantly share code, notes, and snippets.

@LinZap
Created January 18, 2015 14:46
Show Gist options
  • Save LinZap/6fe650ec04e319897ac0 to your computer and use it in GitHub Desktop.
Save LinZap/6fe650ec04e319897ac0 to your computer and use it in GitHub Desktop.
jQuery plugin - score bot
// var js = document.createElement('script');
// js.src="//code.jquery.com/jquery-1.11.2.min.js";
// document.body.appendChild(js);
$('.c2:eq(0)').remove();
var s = "999999999 80 wefnwefwiefwiuefewuf 999999999...";
var c2 = $('.c2');
var sp = s.split(" ");
for(var i=0;i<sp.length;i++){
var sk = sp[i].split(" ");
var k = sk[0].trim();
var sscore = sk[1].split(" ");
var score = sscore[0].trim();
var suggest = "";
for(var j=1;j<sscore.length;j++) suggest+=sscore[j];
c2.each(function(index, el) {
var innerTxt = $(el).children('a').text();
if(innerTxt.indexOf(k) > -1){
$(el).parent('tr').children('.c5').children('input').val(score);
if(parseInt(score)<70)$(el).parent('tr').children('.c11').children('textarea').val(suggest.trim());
return false;
}
});
}
$('.c5').children('input').each(function(index, el) {
if($(el).val()=="")$(el).val("0");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment