Greasy Fork is available in English.
Checks if feeding a kad was successful and logs the results to pass through a Discord webhook.
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/485575/1316652/%5BGC%5D%20-%20Kadoatery%20Details%20Helper.js
// ==UserScript==
// @name [GC] - Kadoatery Details Helper
// @namespace http://greasyfork.icu/en/users/1225524-kaitlin
// @match https://www.grundos.cafe/games/kadoatery/feed_kadoatie/*
// @version 1.3
// @author Cupkait
// @license MIT
// @description Checks if feeding a kad was successful and logs the results to pass through a Discord webhook.
// ==/UserScript==
function GrabKadoatieDetails() {
var fullText = $('.center').html();
const elementOne = $('.center p').eq(0);
const elementTwo = $('.center p').eq(1);
const elementThree = $('.center p').eq(2);
const kadType = $('.center p').eq(3);
const elementFive = $('.center p').eq(4);
const userName = /user=(.*?)"/g.exec(document.body.innerHTML)[1];
const kadImage = elementTwo.find('img').eq(0).attr('src');
const kadName = elementOne.find('b').eq(0).text();
const kadBlurb = elementTwo.find('strong').eq(0).text();
const kadPaint = kadImage.split('/').pop().replace('_happy.gif', '');
let relicStatus = false;
let kadCount = kadType.find('strong').eq(0).text();
if (kadType.text().includes("particularly grateful")) {
kadCount = elementFive.find('strong').eq(0).text();
console.log(`${userName} fed ${kadName} the ${kadPaint} Kadoatie as number ${kadCount} and got a relic!`);
relicStatus = true;
} else {
console.log(`${userName} fed ${kadName} the ${kadPaint} Kadoatie as number ${kadCount}!`);
}
return {
userName,
kadName,
kadImage,
kadBlurb,
kadPaint,
kadCount,
relicStatus
}
}
// BASIC EXPLANATION OF EACH ELEMENT/VARIABLE:
// userName = User who fed kad... aka you
// kadImage = Kad that was fed
// kadName = Name of kad that was fed
// kadBlurb = Flavor text said by the kad
// relicStatus = If true, the kad gave you a relic. If false, they did not
// kadCount = The total number of kads you have fed
// kadPaint = Color of kad that was fed