您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add shortcuts to own Villagers with Animal Husbandry career when transferring animals.
当前为
// ==UserScript== // @name FVToolkit-AnimalTrafficking // @namespace CuteHornyUnicorn // @version 0.1a1 // @description Add shortcuts to own Villagers with Animal Husbandry career when transferring animals. // @author CuteHornyUnicorn // @include /^https?://www\.furvilla\.com/career/breeder/[0-9]+$/ // @grant none // ==/UserScript== /*jshint multistr: true */ var getPage = function(url, callback) { var req = new XMLHttpRequest(); req.onload = function() { if ( callback && typeof(callback) === 'function' ) { callback( this.responseXML ); } }; req.open( 'GET', url ); req.responseType = 'document'; req.send(); }; getPage( '/profile', function(response) { var listVillagers = response.querySelector( '.villagers-list' ); var ulStore = listVillagers.querySelectorAll('ul > li'); setInterval(function() { if (document.getElementsByClassName('modal-open')[0]) { var modal = document.querySelector('#modalLabel').textContent.trim(); if (modal == 'Animal Transfer') { var position = document.querySelector('#modalLabel'); for (var liContent of ulStore) { var VilID = parseInt(liContent.querySelector('a[href^="http://"]').toString().match(/\d+/)); var CurrentID = parseInt(window.location.href.toString().match(/\d+/)); var VilName = liContent.querySelector('.villager-name').textContent.trim(); var VilImg = liContent.getElementsByTagName("img")[0].getAttribute("src"); var VilCareer = liContent.querySelector('.villager-info'); if (VilCareer !== null) { VilCareer = VilCareer.textContent.trim().toLowerCase(); if (VilCareer == 'animal husbandry' && VilID != CurrentID) { // alert(VilID+' '+CurrentID); var addbreeder = document.createElement('div'); addbreeder.innerHTML = '<a href="#" style=" margin: 0 10px; float: left; font-size: 12px; font-weight: normal;" onClick="javascript:document.getElementsByName(\'recipient_id\')[0].value='+VilID+'"><img style=\'width: 50px;\' src='+VilImg+' /><br />'+VilName+'</a>'; position.appendChild(addbreeder); } } } } } }, 1000); });