Greasy Fork

Greasy Fork is available in English.

FARMASSI

DS-FARMASSSI Extension

当前为 2014-07-10 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name           FARMASSI 
// @namespace      DSFarmAssistentExtension
// @include        *die-staemme.de/game.php*screen=am_farm*
// @author         Dummbroesel
// @description    DS-FARMASSSI Extension
// @version		   1.3.0
// ==/UserScript==

//table row remove after inner button got clicked, activate with anykey
document.onkeypress = function(event) {
  console.dir(event);
  console.log(event.keyCode);
  if (event.keyCode == 102) { //f
    FARemove();
  } else if(event.keyCode == 113) { //q
    FAPrev();
  } else if(event.keyCode == 101) { //e
    FANext();
  } else if(event.keyCode == 115) { //s
    FASelect();
  } else if (event.keyCode == 32) {
    FAAuto();        
  }
  
  console.log(event.keyCode);
}

function FARemove() {
  if ($('a.farm_icon_a') != null){
    $('a.farm_icon_a').click(function() {
      $(this).closest("tr").remove();
    });
  }
  if($('a.farm_icon_b') != null){
    $('a.farm_icon_b').click(function() {
      $(this).closest("tr").remove();
    });
  }
  if ($('a.farm_icon_c') != null) {
    $('a.farm_icon_c').click(function() {
      $(this).closest("tr").remove();
    });
  }
  console.log('FARMASSI ACTIVE');
}

function FAPrev() {
  var divCon = $('#am_widget_Farm');
  var allTd = divCon.find('td');
  var lastTd = allTd[allTd.length -1];
  var lastTd = $(lastTd);
  var lTdChilds = lastTd.children();
  lTdChilds.each(function (index) {
    if (this.tagName.toLowerCase() == 'strong' && index > 0) {
      window.location = lTdChilds[index - 1].href;
    }
  });
}

function FANext() {
  var divCon = $('#am_widget_Farm');
  var allTd = divCon.find('td');
  var lastTd = allTd[allTd.length -1];
  var lastTd = $(lastTd);
  var lTdChilds = lastTd.children();
  lTdChilds.each(function (index) {
    if (this.tagName.toLowerCase() == 'strong' && index < lTdChilds.length -2) {
      window.location = lTdChilds[index+1].href;
    }
  });
}

function FASelect() {
  var divCon = $('#am_widget_Farm');
  var allTd = divCon.find('td');
  var lastTd = allTd[allTd.length -1];
  var lastTd = $(lastTd);
  lastTd.find('select').focus();
}

var trCount = 0;
function FAAuto() {
  var FApause = Math.floor(Math.random() * 100) + 200;
  var FAnext = 0;
  var divCon = $('#am_widget_Farm');
  var allTr = divCon.find('tr');
  
}