Critter Mound Auto Level

Basic Script to Automate Critter Mound

当前为 2020-03-17 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Critter Mound Auto Level
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.9.1
  5. // @description Basic Script to Automate Critter Mound
  6. // @author You
  7. // @match https://crittermound.com/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. var first, mother, father;
  14. var test = function() {
  15. if (game.femaleMound().length > 0) {
  16. first = game.femaleMound()[0];
  17. mother = game.mother();
  18. if (first.traits[0].trueValue > mother.traits[0].trueValue && first.traits[1].trueValue > mother.traits[1].trueValue && first.traits[2].trueValue > mother.traits[2].trueValue && first.traits[3].trueValue > mother.traits[3].trueValue && first.traits[4].trueValue > mother.traits[4].trueValue) {
  19. game.Move("Mate", "Female", game, game)
  20. console.log("New Queen");
  21. } else {
  22. if (Math.random() >= 0.5) {
  23. if (game.maxArmyMoundSize() > game.armyMound().length) {
  24. game.Move("Army", "Female", game, game)
  25. console.log("New Female Army");
  26. } else {
  27. console.log("To many Army")
  28. }
  29. } else {
  30. game.Move("Worker", "Female", game, game)
  31. console.log("New Female Worker");
  32. }
  33. }
  34. }
  35.  
  36. if (game.maleMound().length > 0) {
  37. first = game.maleMound()[0];
  38. mother = game.father();
  39. if (first.traits[0].trueValue > mother.traits[0].trueValue && first.traits[1].trueValue > mother.traits[1].trueValue && first.traits[2].trueValue > mother.traits[2].trueValue && first.traits[3].trueValue > mother.traits[3].trueValue && first.traits[4].trueValue > mother.traits[4].trueValue) {
  40. game.Move("Mate", "Male", game, game);
  41. console.log("New King");
  42. } else {
  43. if (Math.random() >= 0.5) {
  44. if (game.maxArmyMoundSize() > game.armyMound().length) {
  45. game.Move("Army", "Male", game, game)
  46. console.log("New Male Army");
  47. } else {
  48. console.log("To many Army")
  49. }
  50. } else {
  51. game.Move("Worker", "Male", game, game)
  52. console.log("New Male Worker");
  53. }
  54. }
  55. }
  56. }
  57.  
  58.  
  59. setInterval(test,500);
  60. })();