diff --git a/app.py b/app.py
index 7f00984..ce0a9ff 100644
--- a/app.py
+++ b/app.py
@@ -364,7 +364,7 @@ class Handler(BaseHTTPRequestHandler):
once = body.get("once") or 0
if not isinstance(once, int) or not 0 <= once <= game.MAKE_MAX:
return f"1 to {game.MAKE_MAX:,}"
- return game.start_action(world, player, str(body.get("id")), now, once=int(once))
+ return game.start_action(world, player, str(body.get("id")), now, once=int(once), skip=body.get("skip") is True)
if path == "/api/queue":
qty = body.get("qty")
if not isinstance(qty, int) or not 1 <= qty <= game.MAKE_MAX:
@@ -384,6 +384,8 @@ class Handler(BaseHTTPRequestHandler):
if path == "/api/queue/clear":
player["queue"] = []
return None
+ if path == "/api/queue/then":
+ return game.set_then(player, None)
if path == "/api/queue/skip":
return game.skip_make(world, player, now)
if path == "/api/join":
diff --git a/game.py b/game.py
index fbfbacc..2b71f75 100644
--- a/game.py
+++ b/game.py
@@ -3225,6 +3225,19 @@ def queue_set(player: dict, index: int, qty: int) -> str | None:
return None
+def set_then(player: dict, action_id: str | None) -> str | None:
+ """What to go back to once the make and the queue are done: an action, or None to go idle."""
+ current = player["action"]
+ if not current or "left" not in current:
+ return "Not making anything"
+ current.pop("resume_plot2", None)
+ if action_id:
+ current["resume"] = action_id
+ else:
+ current.pop("resume", None)
+ return None
+
+
def skip_make(world: dict, player: dict, now: float) -> str | None:
"""Drop the make that's running: on to the next in the queue, or back to what you were doing."""
current = player["action"]
@@ -3951,8 +3964,10 @@ MAKE_MAX = 1000 # most you can ask for in one "Make X"
QUEUE_MAX = 5 # makes lined up after the current one
-def start_action(world: dict, player: dict, action_id: str, now: float, once: int = 0) -> str | None:
- """Start an action. `once` does it that many times, then goes back to what you were doing."""
+def start_action(world: dict, player: dict, action_id: str, now: float, once: int = 0, skip: bool = False) -> str | None:
+ """Start an action. `once` does it that many times, then goes back to what you were doing.
+ While a make is running, a plain start is what comes after it and the queue, not instead,
+ unless `skip`: then the make and the queue go and it starts now."""
action = ACTION_BY_ID.get(action_id)
if not action:
return "No such action"
@@ -3961,6 +3976,9 @@ def start_action(world: dict, player: dict, action_id: str, now: float, once: in
return reason
entry = {"id": action_id, "start": now}
current = player["action"]
+ if not once and not skip and current and "left" in current:
+ set_then(player, action_id)
+ return None
if once:
back = current and (current.get("resume") or current["id"])
entry["left"] = int(once)
@@ -6244,6 +6262,7 @@ PATCH_NOTES = [
("fix", "+Q button: rounded corners."),
("fix", "Make box: number field sits in front of +Q."),
("new", "Crafting queue menu: tap ⏳ in the top bar to reorder, change counts, skip or clear."),
+ ("new", "Updated crafting queue to be more intuitive"),
("new", "Bury on the spot: bones from combat turns into prayer points and 1/2 bury XP as they drop. Toggle in the Prayer menu."),
("balance", "Prayer costs adjusted."),
("balance", "Prayer potions now relevant for new costs."),
diff --git a/static/app.js b/static/app.js
index bfda724..6c0c1fe 100644
--- a/static/app.js
+++ b/static/app.js
@@ -806,7 +806,7 @@ function queuePanel() {
${now ? `
${now.icon}${esc(now.name)}${fmt(me.action.left)} left
` : ""}
${rows ? `${rows}` : `
Empty. +Q on a recipe adds to it.
`}
-
Then ${back ? `back to ${esc(back.name.toLowerCase())}` : "idle"}
+
`;
}
@@ -825,6 +825,15 @@ function queueRow() {
}).join(`→`)}`;
}
+// Start, or while a make runs: After Q sets what comes once it and the queue are done,
+// and on that one, Skip Q drops them and starts it now.
+function startButton(a, size, why) {
+ const making = S.me.action?.left, after = making && S.me.action.resume === a.id;
+ const [label, title] = !making ? ["Start", ""] : after ? ["Skip Q", "Skip queue: drop the make and queue, start this now"]
+ : ["After Q", "After queue: do this once the make and queue are done"];
+ return ``;
+}
+
// The recipe you're after, under the top bar on every page: have / need for each input.
function trackedBar() {
const me = S.me, a = me.tracked && C.actions.find((x) => x.id === me.tracked);
@@ -834,7 +843,7 @@ function trackedBar() {
return `