GOS scraper Alternate

try to take over the world!

  1. // ==UserScript==
  2. // @name GOS scraper Alternate
  3. // @namespace https://www.gatesofsurvival.com
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author Opal
  7. // @match https://www.gatesofsurvival.com/game/*
  8. // @grant none
  9. // @require http://code.jquery.com/jquery-latest.js
  10. // ==/UserScript==
  11. extraButtonCode = "<div id=\"extra2\" class = \"classy\"><li class=\"btn2\">Opal's Addons</li></div>";
  12. outputButtonCode ="<div id=\"output2\" class = \"classy\"><li class=\"btn2\">---</li></div>";
  13. outputButton2Code ="<div id=\"output3\" class = \"classy\"><li class=\"btn2\">---</li></div>";
  14. $("#change_character2").after(extraButtonCode);
  15. $("#extra2").after(outputButtonCode);
  16. $("#output2").after(outputButton2Code);
  17. $("#extra2").click(function(){
  18. var textNodes = $("tr").children('*').contents();
  19. var arr = ["0"];
  20. var skillTitles = [];
  21. var skillValues = [];
  22.  
  23.  
  24.  
  25. var transferIndex = 0;
  26. $.each(textNodes, function(index, value){
  27.  
  28. var zoop = $(value);
  29. if (value.nodeType === 1 && (zoop.html().indexOf('Level') > -1))
  30. {
  31. arr.push(zoop.text());
  32. console.log(transferIndex);
  33. transferIndex=transferIndex+1;
  34. skillTitles.push(zoop.text());
  35. } else if (value.nodeType === 3 ){
  36. //&& (arr[arr.length-1].indexOf('Level') > -1)
  37. zoop = zoop.text().split(",").join("");
  38. var maxValue = /\s\d+\s(?!\/)/;
  39. var found = zoop.match(maxValue);
  40. if (found){
  41. zoop = found[0];
  42. }
  43. skillLevel = zoop.replace(": ","");
  44. arr.push(skillLevel);
  45. skillValues.push(skillLevel);
  46. }
  47. });
  48. var outputForm = "<form><input type = \"text\" id=\"outputform\" value=\"\">";
  49. var outputForm3 = "<form><input type = \"text\" id=\"outputform3\" value=\"\">";
  50. arr.splice(0, 1);
  51. var output = skillValues.join(",");
  52. $("#output2").html(outputForm);
  53. $("#output3").html(outputForm3);
  54. $("#outputform").val((skillValues.join("\t")));
  55. console.log(skillTitles);
  56. console.log(skillValues);
  57. $("#outputform3").val((skillTitles.join("\t")));
  58. });
  59.  
  60.  
  61.  
  62.