Created
January 18, 2015 14:46
-
-
Save LinZap/6fe650ec04e319897ac0 to your computer and use it in GitHub Desktop.
jQuery plugin - score bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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