Skip to content

Added Trade (T) (T+) system for NPC Exchange Resources - #112

Open
oGabrielFreitas wants to merge 1 commit into
adipiciu:mainfrom
oGabrielFreitas:main
Open

Added Trade (T) (T+) system for NPC Exchange Resources#112
oGabrielFreitas wants to merge 1 commit into
adipiciu:mainfrom
oGabrielFreitas:main

Conversation

@oGabrielFreitas

@oGabrielFreitas oGabrielFreitas commented Aug 21, 2026

Copy link
Copy Markdown

Summary

Added a new Trade memory system (T/T+) that works alongside the existing Market memory (M/M+), but stores the full resource cost of buildings instead of only what's missing.

  • (T) button on building pages saves the total resource cost (all 4 resources)
  • (T+) button accumulates costs from multiple buildings
  • On the NPC Exchange Resources page, a "T" button fills the inputs with the stored trade values and recalculates the troop distributor
  • "R" button on the NPC Exchange page allows manual refresh of the troop distributor after editing input values by hand

How it works

  1. Navigate to any building upgrade page
  2. Click (T) to save the full cost, or (T+) to add to a previous value
  3. Open the NPC Exchange Resources modal
  4. Click "T" to fill the exchange inputs with the accumulated values — troop distributor updates automatically
  5. Optionally edit values manually, then click "R" to refresh the troop distributor

Unlike the Market memory (M), which only stores what's missing (current resources minus cost), the Trade memory stores the complete cost regardless of current resources.

Usage Examples:

Usage 1:

  • Navigate through your secondary villages and keep adding the trades you want to perform (T+).
  • Go to your main 15-crop village.
  • Make a single large trade that distributes the exact resources.
  • Use the remaining resources for troop training.
  • Send the resources to the secondary villages.

Usage 2:

  • Add up several building upgrades you want to trade in a single village.
  • Make one trade and use the rest for troops.
  • Schedule the building upgrades (use the master builder if necessary).

@oGabrielFreitas

Copy link
Copy Markdown
Author

I love this script, I've been using it for a long time. I always felt that this option to make trades easier was missing.

I decided to implement it so I don’t have to use long and boring Excel tables anymore haha

@adipiciu

Copy link
Copy Markdown
Owner

Hi,
I don't know how many people are needing this function and I don't want to add more cryptic buttons. Maybe we can add it as an optional feature in the settings and let users enable it if they want it.

@oGabrielFreitas

oGabrielFreitas commented Aug 25, 2026

Copy link
Copy Markdown
Author

It would be really cool.

I can change the code to make this option as an optional feature.

I’ve been using the functionality quite a lot in the past few days, it’s working well, but I ended up finding some small improvements that could be made.

I can already open a new PR with these adjustments and the updated version.

@adipiciu

Copy link
Copy Markdown
Owner

It would be really cool.

I can change the code to make this option as an optional feature.

I’ve been using the functionality quite a lot in the past few days, it’s working well, but I ended up finding some small improvements that could be made.

I can already open a new PR with these adjustments and the updated version.

Ok, you can make a new PR and I will merge it in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants