From 62c2c8b032cdc1bc0084ac2dead93dc4a5baf88e Mon Sep 17 00:00:00 2001 From: Cristobal Dabed Date: Thu, 31 Mar 2022 13:59:20 +0200 Subject: [PATCH 1/2] Make simultaneous attack compatible with v0.6.5 --- content/productivity/simultaneous-attack/index.md | 2 +- content/productivity/simultaneous-attack/plugin.js | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/content/productivity/simultaneous-attack/index.md b/content/productivity/simultaneous-attack/index.md index ff1b65c9..1e47db5e 100644 --- a/content/productivity/simultaneous-attack/index.md +++ b/content/productivity/simultaneous-attack/index.md @@ -2,5 +2,5 @@ title: Simultaneous attack date: 2021-07-16 subtitle: Attack or reinforce a planet by automatically scheduling up to 6 moves to arrive at the same time -version: 0.6.4 +version: 0.6.5 --- diff --git a/content/productivity/simultaneous-attack/plugin.js b/content/productivity/simultaneous-attack/plugin.js index 3afcba7c..b82012b1 100644 --- a/content/productivity/simultaneous-attack/plugin.js +++ b/content/productivity/simultaneous-attack/plugin.js @@ -1,15 +1,14 @@ // Simultaneous attack // // Attack or reinforce a planet by automatically scheduling up to 6 moves to arrive at the same time - +import { + getPlanetName +} from "https://cdn.skypack.dev/@darkforest_eth/procedural"; // User configurable parameters const DEFAULT_ENERGY_PERCENT = 75; const RECALCULATION_INTERVAL_SECONDS = 15; - -var pg = df.getProcgenUtils(); - // removes all the child nodes of an element var removeAllChildNodes = (parent) => { while (parent.firstChild) { @@ -22,7 +21,7 @@ var removeAllChildNodes = (parent) => { var planetLink = (locationId, clickable = true) => { const planet = df.getPlanetWithId(locationId); const planetElement = document.createElement(clickable ? "button" : "span"); - planetElement.innerText = `L${planet.planetLevel}R${planet.upgradeState.reduce((a, b) => a + b, 0)} ${pg.getPlanetName(planet)}`; + planetElement.innerText = `L${planet.planetLevel}R${planet.upgradeState.reduce((a, b) => a + b, 0)} ${getPlanetName(planet)}`; planetElement.title = locationId; planetElement.style.textDecoration = "underline"; planetElement.style.background = "none"; From 0c3ab6fa7d91096a03401df32585865d63ed18de Mon Sep 17 00:00:00 2001 From: Cristobal Dabed Date: Thu, 31 Mar 2022 14:03:47 +0200 Subject: [PATCH 2/2] Make simultaneous attack compatible with v0.6.5 --- content/productivity/simultaneous-attack/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/productivity/simultaneous-attack/index.md b/content/productivity/simultaneous-attack/index.md index 1e47db5e..ff1b65c9 100644 --- a/content/productivity/simultaneous-attack/index.md +++ b/content/productivity/simultaneous-attack/index.md @@ -2,5 +2,5 @@ title: Simultaneous attack date: 2021-07-16 subtitle: Attack or reinforce a planet by automatically scheduling up to 6 moves to arrive at the same time -version: 0.6.5 +version: 0.6.4 ---