FARMASSI

DS-FARMASSSI Extension

  1. // ==UserScript==
  2. // @name FARMASSI
  3. // @namespace DSFarmAssistentExtension
  4. // @include *die-staemme.de/game.php*screen=am_farm*
  5. // @author Dummbroesel
  6. // @description DS-FARMASSSI Extension
  7. // @version 1.4.2
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. document.onkeypress = function(event) {
  12. var eCode = (event.keyCode == 0)? event.charCode : event.keyCode;
  13. switch (eCode) {
  14. case 102: //f
  15. FARemove();
  16. break;
  17. case 81: //Q
  18. FAFirst();
  19. break;
  20. case 113: //q
  21. FAPrev();
  22. break;
  23. case 101: //e
  24. FANext();
  25. break;
  26. case 115: //s
  27. FASelect();
  28. break;
  29. default:
  30. break;
  31. }
  32. }
  33.  
  34. function FARemove() {
  35. if ($('a.farm_icon_a') != null){
  36. $('a.farm_icon_a').click(function() {
  37. $(this).closest("tr").remove();
  38. });
  39. }
  40. if($('a.farm_icon_b') != null){
  41. $('a.farm_icon_b').click(function() {
  42. $(this).closest("tr").remove();
  43. });
  44. }
  45. if ($('a.farm_icon_c') != null) {
  46. $('a.farm_icon_c').click(function() {
  47. $(this).closest("tr").remove();
  48. });
  49. }
  50. console.log('FARMASSI ACTIVE');
  51. }
  52.  
  53. function FAFirst() {
  54. var divCon = $('#am_widget_Farm');
  55. var allTd = divCon.find('td');
  56. var navTd = $('div#plunder_list_nav td');
  57. var navTdChilds = navTd.children();
  58. navTdChilds.each(function (index) {
  59. if (this.tagName.toLowerCase() == 'strong' && index > 0) {
  60. window.location = navTdChilds[0].href;
  61. }
  62. });
  63. }
  64.  
  65. function FAPrev() {
  66. var divCon = $('#am_widget_Farm');
  67. var allTd = divCon.find('td');
  68. var navTd = $('div#plunder_list_nav td');
  69. var navTdChilds = navTd.children();
  70. navTdChilds.each(function (index) {
  71. if (this.tagName.toLowerCase() == 'strong' && index > 0) {
  72. window.location = navTdChilds[index - 1].href;
  73. }
  74. });
  75. }
  76.  
  77. function FANext() {
  78. var divCon = $('#am_widget_Farm');
  79. var allTd = divCon.find('td');
  80. var navTd = $('div#plunder_list_nav td');
  81. var navTdChilds = navTd.children();
  82. navTdChilds.each(function (index) {
  83. if (this.tagName.toLowerCase() == 'strong' && index < navTdChilds.length -2) {
  84. window.location = navTdChilds[index+1].href;
  85. }
  86. });
  87. }
  88.  
  89. function FASelect() {
  90. var divCon = $('#am_widget_Farm');
  91. var allTd = divCon.find('td');
  92. var navSelect = $('div#plunder_list_nav select');
  93. navSelect.focus();
  94. }