Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Auto Game
- // @namespace http://tampermonkey.net/
- // @version 2024-05-02
- // @description try to take over the world!
- // @author You
- // @match https://ascensiontree.semenar.am/
- // @icon https://www.google.com/s2/favicons?sz=64&domain=semenar.am
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- function autoTick() {
- for (const layer of player.layers) autoLayer(layer);
- }
- function isAllUpgradeBought(layer) {
- return Object.values(layer.upgrades).every(upgrade => upgrade.bought)
- }
- function autoLayer(layer) {
- if (
- layer.left_branch &&
- layer.right_branch &&
- isAllUpgradeBought(layer)
- ) return;
- if (!layer.left_branch) layer.buyLeft();
- if (!layer.right_branch) layer.buyRight();
- const production = layer.calculateProduction(0);
- if (
- layer.canPrestige() &&
- isAllUpgradeBought(layer.parent_layer) &&
- (
- layer.points.eq(0) ||
- layer.prestigeGain().div(production.max(1)).gte(3) && Math.random() > 0.5 ||
- production.eq(0)
- )
- ) {
- layer.prestige();
- }
- for (const upgradeKey in layer.upgrades) {
- const upgrade = layer.upgrades[upgradeKey];
- if (!upgrade.canBuy() || upgrade.bought) continue;
- upgrade.buy();
- }
- }
- setInterval(autoTick, 50);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement