[GC] - Kadoatery Details Helper

Checks if feeding a kad was successful and logs the results to pass through a Discord webhook.

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/485575/1330924/%5BGC%5D%20-%20Kadoatery%20Details%20Helper.js

  1. // ==UserScript==
  2. // @name [GC] - Kadoatery Details Helper
  3. // @namespace https://gf.qytechs.cn/en/users/1225524-kaitlin
  4. // @match https://www.grundos.cafe/games/kadoatery/feed_kadoatie/*
  5. // @version 1.4.6
  6. // @author Cupkait
  7. // @license MIT
  8. // @description Checks if feeding a kad was successful and logs the results to pass through a Discord webhook.
  9. // ==/UserScript==
  10.  
  11. function GrabKadoatieDetails() {
  12.  
  13. const errorPage = $('.errorpage');
  14. if (errorPage.length > 0) {
  15. const errorText = errorPage.text();
  16.  
  17. if (errorText.includes("has already been fed")) {
  18. console.log(
  19. 'Too slow, someone else got to that kad first.');
  20. } else if (errorText.includes("wait a bit")) {
  21. console.log('You already fed a kad, try again later.');
  22. }
  23. } else {
  24. const elementOne = $('.center p').eq(0);
  25. const elementTwo = $('.center p').eq(1);
  26. const elementThree = $('.center p').eq(2);
  27. const kadType = $('.center p').eq(3);
  28. const elementFive = $('.center p').eq(4);
  29.  
  30. const userName = /user=(.*?)"/g.exec(document.body.innerHTML)[
  31. 1];
  32. const kadImage = elementTwo.find('img').eq(0).attr('src');
  33. const kadName = elementOne.find('b').eq(0).text();
  34. const kadBlurb = elementTwo.find('strong').eq(0).text();
  35. const kadPaint = kadImage.split('/').pop().replace(
  36. '_happy.gif', '');
  37.  
  38. let relicStatus = false;
  39. let kadCount = kadType.find('strong').eq(0).text();
  40.  
  41. if (kadType.text().includes("particularly grateful")) {
  42. kadCount = elementFive.find('strong').eq(0).text();
  43. console.log(
  44. `${userName} fed ${kadName} the ${kadPaint} Kadoatie as number ${kadCount} and got a relic!`
  45. );
  46. relicStatus = true;
  47. } else {
  48. console.log(
  49. `${userName} fed ${kadName} the ${kadPaint} Kadoatie as number ${kadCount}!`
  50. );
  51. }
  52.  
  53. const colorMapping = {
  54. blue: "8758759",
  55. green: "10933110",
  56. island: "987592",
  57. pink: "16751565",
  58. rainbow: "13197820",
  59. spotted: "15842854",
  60. white: "14608883",
  61. yellow: "16777063"
  62. };
  63.  
  64.  
  65. const barColor = colorMapping[kadPaint.toLowerCase()] ||
  66. "#FFFFFF"; // Default to white if not found
  67.  
  68. return {
  69. userName,
  70. kadName,
  71. kadImage,
  72. kadBlurb,
  73. kadPaint,
  74. kadCount,
  75. relicStatus,
  76. barColor
  77. };
  78. }
  79. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址