#Advanced Automation
3771 messages Β· Page 4 of 4 (latest)
Ah. Lol.
Yes, this is a very good question π How do you want to set it?
Sounds like you want a kind of "district parameter". A limit that you can easliy adjust. Do I get it right?
yea, but it could be global too
but you could the UI on the district center for example,
One (awkward) way of doing it could be using a signal that is always "true". When you save such a rule, the custom signal gets updated, but it happens only once. No ticking. I'd suggest the Constructable.OnUnfinished.State one.
(and optionally make it a per-district value)
The custom signal value UI is what I'm considering. However, there are cases to be verified. Like, if you have a rule that constantly updates some signal value, what should the UI do with it? Obviously, all you changes via UI won't make sense.
yea, currently it only updates when you click off and back on to a building
which I think is fine
yea, that works,
where are import/export are they new?
Sorry, not sure I get the question 
was there a way to copy a set of rules as text?
ahh, yes the β¬οΈ and β¬οΈ outside the dialog
So this works: β¨```lisp
condition:(gt (sig District.Beavers) (sig Signals.BeaverLimit))
action:(act Pausable.Pause)
condition:(lt (sig District.Beavers) (sig Signals.BeaverLimit))
action:(act Pausable.Unpause)
condition:(eq (sig Constructable.OnUnfinished.State) 'finished')
action:(act Signals.Set 'BeaverLimit' 3000)
The last rule is only added to a single place (one of the breeding pods is the easiest way)
The Master Control Pod
heh, are you going to allow export/import in Python?
It's in my feature list. As usual, no ETA 
But you know, you actually gave me an impulse on this matter. I was skeptical on how it's useful (having a Python export/import). However, it's seems we have at least two people who likes it (me+you).
heh
I assume the hard work is done,
it's "just" a matter of replacing β¨condition:($lisp)β© with β¨if $python:β© and β¨action:$lispβ© with β¨ $pythonβ©?
heh, I was going to suggest moving the import/export into the dialog, and then I see you moved it out a couple of months ago π
I wish it was that simple. In fact, when I made the core system, I didn't consider the multi-lingual approach π€£ The core system is working on lisp 
UI was the easiest part to switch to a different syntax. It's a representational level.
E.g. the constructor UI is actually making Lisp expressions. Dynamites are also using Lisp to make new dynamites. Users of the mod don't need to know it, but I have to deal with it.
yea, so on export you could run it through the same lisp->python logic, and import run it through python->lisp logic?
Yup. This can definitely be done.
I just need to make the code 
ahh, import/export -- maybe have a single dialog for both?
sorry my brain is stuck on the icons,
I keep thinking they mean "move rule up and move rule down"
I was also looking at other options, eg
https://thenounproject.com/browse/icons/term/import-export/ has some other examples
You're my hero! I broke my brain trying to make a user friendly icon.
I like the suggestions! What are your preferences?
heh, I was amused by the discussion about what the arrow is relative to
export from server == download to client,
import to server == upload from client
In TB, all icons get scaled. Thin lines don't look nice after this.
no
https://thenounproject.com/browse/icons/term/upload-download/ are some more ideas
Haha. I've been through this. Most of the nice images there don't look good in the game π
But I like the idea with the bold up/down arrows
Let me try it.
where are they in git?
https://github.com/ihsoft/TimberbornMods/blob/main/Automation/Assets/SmallButtons.pdn
You would need Paint.net to open it.
ahh, the individual assets are not in git?
https://github.com/ihsoft/TimberbornMods/tree/timberborn-1.0/ModsUnityProject
It's the main Unity repo. There, all the assets are final.
Nope, it cannot. Unity works with PNG.
PDN is a kind of "adobe photoshop" file. You use it to make PNG.
ahh, but you have made the icons solid then?
Solid? 
Got it. Yes, I made them solid. The older version was not scaling good.
I'm still on mod version v3.3.0
which is the latest,
okay so maybe they will look nicer solid
agreed
Kowalski! Options?
It's for the import icon.
That one's non-free I think?
But do you want black?
But no go anyway.
No π€£
What you updated a week ago looks much nicer (at least looking at the commit diff)
But $3.33 per a month,. Given I only need ONE month. It may work.
where did you get the current icons?
ChatGPT
heh
7000px x 7000px for a set of 4 icons?!?!? What are you putting them in?
It looks like most of them have a bar or "container" of some sort at the bottom
and then some have it at the top πββοΈ
https://iconscout.com/icons/download has thousands of options
soem better than others
I think I actually prefer the sideways arrows going in and out of boxes
I'm partial to this style: https://iconscout.com/icon-pack/arrows-set-icon-pack_278450
needs some tweaking to make it fit the game colors,
I see a good candidate for importing, but not for exporting.
upload icons are on the bottom row, download on the top row,
export and import are next to each other
These are imports.
Ah, the blue color 
They look a bit thin smaller:
TB theme does't like coloring π
no, the color would need to be the existing yellowish color
How about this?
Like what?
Like the above, just in the yellow of TB
v3.4.0 (February 2nd, 2026):
- [Feature] The stock game "copy building settings" feature is now also copying the automation rules.
- [Feature] Rules can now be selectively enabled or disabled. The disabled rules stay on the building, but they won't be executed until enabled.
- [Feature] Rules order can now be changed via the rules editor dialog. Note that it doesn't affect the execution logic. It's a purely cosmetic function.
- [Feature] Added a template tool to enable/disdable all rules on the building(s).
- [Fix] Dynamite detonation doesn't work.
I will try this options in the next versions. For now, I'm going to release "something" and go to sleep π See you, folks, tomorrow!
Is it free? I like this link 
Digital (non-print) License seems to be
ahh, no, for $15/month
I assume you can do 1 month only?
maybe not even "Per user / month, Billed annually"
Some from Material Symbols by Google Fonts (free use?)
You can also adjust the weight and size easily
https://icon-sets.iconify.design/?query=import also has some nice export/import/download/upload icons
it also has a stroke/color adjuster
"open source vector icons"
the ones I liked were from Material Design Icons by Pictogrammers (Apache 2.0)
Options to pause individual rules?
That has only been requested... a few dozen times.
I must be blind but I don't see the option to pause the rules
there is an option but you need to click on the building, then click on the rules cog, then click on each rule
it would be great if the option was present in the building screen without having to open rules window
I have 4 badwater pumps, for example, and if I want to override all rules I need a total of 14 clicks before I override, and at the end of doing that I will probably need to unpause them all again π
Doesn't exist YET.
We were discussing a feature in development.
They said it's a template tool, check your automation tools
Which sounds like its better for that particular use than having to click on every building
yea, but it would be nice to have it easily available on the per-building panel too
oh thank you, I didn't think of looking there
since I've been using those little scripts I haven't touched the templates
I have to say, it is possible to automate the entire colony without having to do nothing but watch the beavers running around
the only thing needed is a surplus of workforce to avoid collapse when a few buildings kick in all together
I wish it was possible to assign a beaver to 2 diffewrent workplaces, so that when 1 closes down I can be sure the workers goes to the second place and nowhere else
Folks, I'm in a process of thinking on the full Python support. So far, it's more a brainstorm to figure out what we may want. Not even a design. What scripts do you see? Obviously, these should be examples that cannot be done today with using the existing templates. I made this, based on some old convo about reacting on the recipe changes. Any more ideas and examples?
from igorz.automation.buildings import Inventory
from igorz.automation.buildings import DistrictBuilding
from igorz.automation.buildings import Pausable
from igorz.automation.buildings import Workplace
from igorz.automation.core import Signals
class MyBuilding(DistrictBuilding, Inventory, Pausable, Workplace):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.init_recipes()
@event("Weather.Season")
def on_season_changed(self, value):
if value == "DroughtWeather": self._pausable.Pause()
else: self._pausable.Unpause()
@event("Workshop.Recipe")
def on_recipe_changed(self, value):
self.init_recipes()
def on_inventory_changed(self):
has_input = True
for good in self._inventory.InputGoods:
if (self._inventory.AmountInStock(good) == 0
and self._district_building.Signals.ResourceStock < self._district_building.Signals.ResourceCapacity * 0.1):
has_input = False
break
if has_input: self._workplace.AssignWorkers(self._workplace.MaxWorkers)
else: self._workplace.RemoveWorkers()
def init_recipes(self):
Signals.clear_listeners("recipe")
for good in self._inventory.InputGoods:
Signals.register_listener(f"Inventory.InputGood.{good}", self.on_inventory_changed, group: "recipe")
In theory, such approach even allows direct access to the game components methods. Which gives a great power... to destroy the game π
heh, did think about trying to bundle IronPython or Python.NET in a mod π
I did consider this, but so far I'm not convinced it's worth it. I hate the game being loading for minutes.
yea, my assetbundle cacher saves ~15 seconds, but that's a small amount compared to the full load cycle
What's the name of that mod?
large asset bundles (like factions) have load times of 7 or 8 seconds, caching them reduces it to fractions of a second
unpublished, but there's a dev version at: #πmod-users message
It's really just calling AssetBundle.RecompressAssetBundle and storing the result in a cache
So the cost is extra disk usage
Today, it's not that a big cost.
any way to make my loggers only unpause when theres both: no trees to plant OR 20 logs (max) in its output. heres what i have so far, but this just keeps unpausing them because there arent 20 logs inside and the output overrides the ready to plant:
i already tried using + like when you are trying to check for two outputs, but i dont know how to check for two different actions.
AND / OR
how do i write it?
where exactly do i put OR?
sorry im stupid
just had to write in lowercase
yep, works flawlessly now, thanks.
ok no, it doesnt work...
they dont pause if they have 20/20 logs stored because theres still trees that can be cut down which overrides the pause.
any way i can make it so that:
if no trees are available to be cut then pause BUT if log output is 20/20 then override first and pause.
ofc also resume if there are available ones and if there arent 20/20 logs stored
Use this script instead (via the import button). It (roughly) does what you want, but better (no dropped logs from gatherers).
condition:(eq (sig Collectable.Ready) 0)
action:(act Workplace.RemoveWorkers)condition:(ne (sig Collectable.Ready) 0)
action:(act Workplace.SetWorkers 100)condition:(eq (sig Inventory.OutputGood.Log) 2000)
action:(act Pausable.Pause)condition:(lt (sig Inventory.OutputGood.Log) 400)
action:(act Pausable.Unpause)
wtf... i didnt know the mod was that powerfull...
it can just set workplace slots to 0??
thanks btw
i wana wait a bit tough to see if it works or not, because i dont need logs rn and they are all paused.
gotta wait till i use some
This mod is incredible. I used to program so I can see all the potential it has.
yea. i mostly only use it for things like setting buildings to pause if their output slot is full so they dont just waste labour.
the seasons stuff and population stuff are things i dont need, but im curios as to what you could do with that.
One thing missing is power. I would love to be able to include BP(hp) in my scripts.
also, im curios if theres a way to set the "total stock of ... in settlemet" thing to make it active under the condition that there is for example:
i can store 80 planks but want my lumber mill to stop when it reaches 80, but i dont want to manualy adjust the stat everytime i add storage, any way to make it take the max stock and just take that as its number to stop?
There is global stock.
yea... too advanced for me, i dont know what you mean by that but cool.
horsepower. I'd love a reading of how much my power sources are making.
so idk if you need to manualy script that part.
i only use constructors cuz the actual coding stuff is too advanced for me
doesnt it tell you that in the first place?
do you mean like how much it makes in horsepower or if it displays how much power youre generating?
Ah. I see what you mean.
yes
Most of the time I do that as well.
works perfectly, thanks.
tried it and it does what i wanted.
yes to which one?
I would like to see both.
Right up until the most recent experimental update, it was impossible to consider due to how power networks worked.
It might be possible now, but most of the time, smart power is just going to be the better option for that.
but isnt the power already displayed in general? like even without mods?
This script might do the trick. It aims for a ratio of 2:1 (logs:planks). If the ratio is too low (too many planks & too few logs), it releases the logs from the lumber mill (e.g. pick up by builders).
condition:(and (eq (sig Inventory.OutputGood.Plank) 1300) (ge (sig District.ResourceStock.Plank) (sig District.ResourceCapacity.Plank)))
action:(act Workplace.RemoveWorkers)condition:(ge (sub (sig District.ResourceCapacity.Plank) (sig District.ResourceStock.Plank)) (sig Inventory.OutputGood.Plank))
action:(act Workplace.SetWorkers (getvalue Workplace.MaxWorkers))condition:(and (le (sig District.ResourceStock.Log) (sig District.ResourceCapacity.Log)) (le (add (sig District.ResourceStock.Log) (sig Inventory.InputGood.Log)) (mul 200 (sig District.ResourceStock.Plank))))
action:(act Pausable.Pause)condition:(or (gt (sig District.ResourceStock.Log) (sig District.ResourceCapacity.Log)) (ge (sub (add (sig District.ResourceStock.Log) (sig Inventory.InputGood.Log)) (mul 200 (sig District.ResourceStock.Plank))) 3900))
action:(act Pausable.Unpause)
Hmm... am I doign something wrong?
I have a Lumber Mill separate from my main mills that just has a manual power wheel on it, and I'm trying to set it to only be active in Drought/Badtide weather, but it keeps also changing the weather state for the other Lumber Mills (which were set to only "Temperate" weather.
It seem changing one (any) of the lumber mill weather settings is causing it to change the settings for all of them?
Expected, or bug?
youre a god-sent bro... thank you.
are you using a string to send that info or are you checking for the season in the lumbermill itself?
I'm actually an idiot, and it's from "Simple Workshop Control", not Automation - sorry! (Yes, I have both installed, I like some simple controls, but then also some more complex ones at times π )
all good, no ones an idiot just because they make one mistake.
Heh, I just feel silly "reporting" that here when it has nothing to do with this mod π All good tho
hmm, copying a breeding pod with rules to manage population ends up with the rule actions with a "parse error" for some reason
you still have to copy them using the rule copy tool
I have observed this too. π
and not just breeding pods, seem to happen to other buildings too
another idea for breeding pods: to have a completion percentage measurement
btw, these observations coming from Disturbed's TIMBERPUNK II | Episode 5
The Timberpunk map is awesome btw - altho I had started it on a semi-broken version of the map... I need to go back and re-try it on the latest release lol
another feature request: some sort of sound when applying a paste of rules to an item
I am crashing when trying to reorder items:
If I click the down arrow of the top item it works
Feature request: the copy rules button should be enabled when there are no rules, I want to copy that there are no rules instead of having to click "Clear all rules" on each building
There's already a tool to select buildings to clear rules down on the bottom bar?
You are right. Maybe the icon should also be a trashcan and the tootiptext "Clear all rules" to be consistent
Created a bug: https://github.com/ihsoft/TimberbornMods/issues/136
Created a bug: https://github.com/ihsoft/TimberbornMods/issues/135
@viscid eagle When creating rules, you need to be careful when the same building property is changed from multiple rules. The rule of thumb: the conditions on such rules must be mutual exclusive. Otherwise, you will get unpredictable behavior when one rule sets the state to one value, and the other rule resets it back. You may see it as "the rule doesn't work", but in fact there will be two rules triggeried, which actions overwrite each other.
Good example: Pause/Unpause. E.g. here is an example of mutual exclusive rules (pseudo code):
if ReadyToCollect > 1 and LogStock < 10 then Unpause
if ReadyToCollect == 0 or LogStock >=10 then Pause
Btw, this pair of rules can be made via "Invert" button in UI. Create one rule, and the inverted version will be made for you.
If you have more than two rules affecting the same state, then the logic becomes more complex.
I start thinking that some tracking system is needed to detect such cases. I've been though it a couple of times too.
I just spent too much time trying to make a sluice open and close using contamination level until I realized the contamination I use is multiplied by 100. No idea if this is a bug or its maybe documented somewhere. Have been using water height with no problem.
Ignore the "using depth" with no problem, I did not use it anywhere.
Found it
i already know that one overrides the other, i stated that in my messages, i just didnt know how to make one NOT override the other. thats what i was struggling with.
v3.4.1 (PREVIEW started on Fabruary 11th, 2026):
- [Change] On the building copy (construction or settings), the automation rules are now copied only if the buildings are the same.
- [Fix] Automation scripts copying results in the script parsing error on the copied building.
- [Fix] When building copied structures in the finished state, and with some automation rules on them, could crash the game.
It's a PREVIEW. Barely tested, but seems working. The stable version will be later.
(pardon my English, I will polish it with AI later)
Now, official.
v3.4.1 (February 12th, 2026):
- [Change] On the building copy (construction or settings), the automation rules are now copied only if the buildings are of the same type.
- [Fix #135] Game crash when trying reordering the rules #135.
- [Fix #136] Rule copying results in "parsing error" in the copied rules.
- [Fix] When placing a copied structure in finished state (dev mode), the game could crash.
"ready for collection" on lumberjacks does not appear to include stumps with remaining logs
the instant the circled tree was cut down the lumberjack flag's worker count was set to zero so the remaining logs never get collected
Automation 3.4.0
I forced an update and the issue persists in Automation 3.4.1
Yeah I noticed this, too. One of the other automation-like mods adds a delay (usually 2-5 in-game hours, user-adjustable) before pausing things like collectors to deal with this sort of thing. I'm not sure why that doesn't count as something "ready for collection" - I do know that if storage fills up before it's all collected, there will be stuff out to be picked up still, then you'd probably still want to pause until storage clears up, so there might be a weird edge case if you don't do something simple like just the several-hour delay?
I have this bug in the backlog: https://github.com/ihsoft/TimberbornMods/issues/130
Didn't have a chance to investigate yet.
A delay wouldn't necessarily fix it as it's not counting the stump with logs as a resource to be collected
Well, it "works" because it doesn't pause the lumberjack right away, it waits a couple hours, and so the beavers will finish cleaning things up for a little even after it hits "0" for ready for collection.
With my luck the tree is always cut down as the work day finishes
Heh, yeah, in that case, set the delay to 8 or 9 hours and you should be ok ... (well, assuming you only let them rest 8hrs π )
Loving the automation mod. I'm trying to figure out if there's a way to send a signal that has the in game time? If there isn't i'll gladly pay someone $20 to make it.
There is a signal Debug.Ticker, which can be used if you wan to execute some logic in every tick. But you need to understand that running anything in every tick will have performance impact.
Or do you need more specific things like "time of the day", "working hours", etc.?
What do you think?
Is there a way to change a farmhouse between plant and harvest? I didn't see anything in the constructor that would work for that.
There is no such action for now. It can be added, for sure. Out of curiosity, which rules do you see for this? In my setups, I ended up building two buildings: one for gathering, one for planting. For planting, you usually need just one worker, and you can disable it when no spots for planting. The harvesting bulding almost always has work to do.
I am playing Lapan's Water Beavers mod, and they only get 1 worker in the farmhouses. Being able to switch in reaction to the season really would help.
Of course simply building more farms wouldn't work because each farm adds housing space for 3 more beavers and in that mod they breed to fill all avaliable housing. π
It is a cool, but wicked mod.
Okay, I will think about it. I was going to revise the building "state" change approach anyway.
In my list, I have (had) at least 2 buildings: stockpile and sluice. Now we have farmhouse.
Many thanks for the consideration.
seems like a logic error in the rule constructor for buildings under construction: they list every item's stock condition except for the ones relevant to that building
tapper's shack construction ghost does not have an option for pine resin (or maple syrup)
once construction is finished, pine resin is an option
It's not a bug, more a compromise. If I will be showing all possible resources in the list, it will be hard to use constructor. So, I only show those for which the district has at least one inventory. When you build your first Tapper's Shack , there will be no resin in the output inventories until the construction is complete.
Btw, you still can go to the script mode and setup a rule from there.
Oh that makes perfect sense, thanks for explaining
@south wedge CustomTool is crashing with white paws.
Same. Just started.
@south wedge the name of the platforms in whitepaws are different.
"Buildings/Whitepaws Faction/Townstuff/Platforms/Platform_Simple.Whitepaws.blueprint", - 1 height
"Buildings/Whitepaws Faction/Townstuff/Platforms/Platform_Tall.Whitepaws.blueprint",- 2 height
There is no 3-height platform.
Wow! I wonder what's the name of the platforms for whitepaws
That's a bammer. Seems like the convinince tools need to be reconsidered in favor of a specific faction.
I will fix it later today.
I have sent you the names in above.
Thanks.
Well, this faction thing is not a good thing. Key bindings are not filtered by the faction suffix π
Oh no.
I don't want to even contemplate late-game WhitePaws without your automation. /laughs
I'm looking for a solution. So far, not many options.
Your efforts are greatly appreciated.
@south wedge Also I think levee and dam will also fail.
White paws have multiple levees and multiple dams.
"Buildings/Whitepaws Faction/Dams/FloodgateDam.Whitepaws.blueprint",
"Buildings/Whitepaws Faction/Dams/Loglevee.blueprint",
"Buildings/Whitepaws Faction/Dams/Loglevee2.blueprint",
"Buildings/Whitepaws Faction/Dams/primitivedam3x2.blueprint",
"Buildings/Whitepaws Faction/Dams/primitivedam3x2upgrade.blueprint",
"Buildings/Whitepaws Faction/Dams/primitivedam3x3.blueprint",
"Buildings/Whitepaws Faction/Dams/primitivedam3x3upgrade.blueprint",
"Buildings/Whitepaws Faction/Dams/primitivedam3x3Utility.blueprint",
"Buildings/Whitepaws Faction/Dams/primitivedam3x3UtilityUpgrade.blueprint",
"Buildings/Whitepaws Faction/Dams/primitivedam3x3variant.blueprint",
"Buildings/Whitepaws Faction/Dams/primitivedam3x3variantupgrade.blueprint",
It doesn't have a 1x1 dam.
and 2 levee
Loglevee- 1 height
Loglevee2 - 2 height
I don't yet have good solution. Will try today eveng more, but then I;m going to vacation for 3 days. A workaround which you can do on your side, is dropping the bad tools blueprints:
Tool.CustomTools.LeveePlusTool.blueprint.json
Tool.CustomTools.PlatformPlusTool.blueprint.json
I sure hope there isn't any mod-breaking updates then.
Thank you for this. I will enjoy having them back.
Aren't those scheduled for every other day? π
Verified that your workaround was good for me.
v1.3.1 (2/20/2026)
- [Fix] The game crashes if the non-stock game factions are in play.
@digital pebble @deft tulip Folks, I did my best. The "bad tools" should not appear for non-stock factions anymore. If it still fails, you know the workaround π My anniversary vacation starts at 10AM next day, so - good luck
You may see me online and even commenting, but no coding in the next 4 days 
I do hope you have a most wonderful and memorable time. Enjoy.
And thank you very much.
Working with whitepaws. Yay. And happy anniversary. Enjoy your trip. 
What building are you trying to apply this to, and is there any storage for gears in the entire district (including factories producing our consuming them)?
Yes. And gear work shop.
See this.
Have storage for logs.
and this is Large Lumber Mill
Import/export dialogs only support Lisp.
The error about not applicable seems a bit odd, though. I'd expect a parsing error.
If the documentation is not built into the mod, it's as if it doesn't exist.
Does the middle button at the bottom count? Or how do you see integration?
Does it open a link in the default browser, instead of opening the documentation in-game? Because if it's not inside the mod, it doesn't exist, for the users.
How about AI, YT and the internet in general? Do they exist for the users if not built-in into the game? C'mon, it's not a serious talk. People don't read documentation not because it's "improperly built-in", but simply because a regular person is lazy. Myself included
The only difference is when the person will finally go reading documentation on the confusing topic. Some will go sooner, some will go never. It's a personal choice.
They exist in genera, but they don't exist in the game. And if I want to play the game, I play the game, I don't watch youtube tutorials unless I'm specifically not playing the game, or any other game, for that matter.
So unless someone builds a youtube player or an AI as a mod for the game, the AI and YT in general don't exist in the game.
And yes, people will read the documentation on confusing topic, but there are easier ways to solve the same issue, like complaining in the mod's comments, as I did before someone suggested I complain in the Timberborn server.
Speaking about the easier ways. ChatGPT solved the case in 30 seconds. I spent more time to type the prompt. However, if Alt+Tab during playing Timberborn is not allowed, then this solution doesn't work 
Another issue I keep hitting is that Workplace.SetWorkers(0) doesn't work, so I have to rewrite it to Workplace.RemoveWorkers() every time, or duplicate, invert, edit script, copy, paste, save, discard the inverted-duplicated, and delete the inverted-duplicate.
And please understand me correctly, I'm not saying the mod is perfect and no improvements needed
I welcome all feedback, but not all feedback will result in code changes for various reasons. I'm just one dude working on the mod in my free time. No way everything will be addressed.
Also, trying to use District.ResourceStock.WheatFlour < 15 or District.ResourceStock.Bread > District.ResourceCapacity.Bread * 0.995 , after saving, shows it as District.ResourceStock.WheatFlour < 15 or District.ResourceStock.Bread > District.ResourceCapacity.Bread * 1 , but that's merely annoying.
I completely understand.
I'm just bringing suggestions I think are reasonable.
Hmm, this one sounds like a real bug. I will check it.
And I believe Workplace.SetWorkers(0) should be calling Workplace.RemoveWorkers() .
But editing the script will show the correct value.
This is what you cannot know without reading docs. And I see no good way to express it in the UI. If you are lazy to read full docs, use AI!
My guess is that you're rounding the value at 2 digits, instead of another number of digits, like 4. I think 4 digits should probably be enough, for most use-cases
I know why it happens, it's just that it migth confuse other people, too, like it confused me until I clicked the Edit button. If you're going to edit the rounding, maybe future-proof-it by adding up to 8 digits, since 0.90 is already rounded to 0.9, so it mens the system showing the digits is automatically hiding the trailing zeroes.
So it won't add the extra zeroes, but adding the extra digits could make the script more usable even in the thousands-of-beavers territory.
District.ResourceStock.Bread * 100 > District.ResourceCapacity.Bread * 99.5
Will solve your problem. And no, this is not going to change. The 2-digit fixed precision is the core of the scripting engine. It doesn't work with real numbers, only ints.
Gocha.
So no long-ints? Or unisgned ints? Or unsigned long ints?
After all, we cannot have negative water.
All values are stored as signed ints. They are standard 32-bit. I can't image you would need 64-bit in the game 
Gocha. That's unfortunate, but understandable.
And speaking about fixed precision, it becomes even more tricky on the long expressions. E.g. 1 / 3 * 3 = 0.99 and 3.07 / 2 * 2 = 3.08
I'm pretty sure AI will be able to explain it and suggest ways on how to avoid the rounding issue.
But, honestly, this rounding artefact should not affect the game. It's not the science calculation.
Oh, I understand why. π€£ I'm a programmer.
Oh it's beaver science that we mere humans will never understand:P
ChatGPT explained it very clear. Much better than I could even try to π€£ Btw, I spend extra efforts on making Wiki AI friendly. So, if you don't want to read the entire doc, at least try AI queries and report if it didn't work. This I will try to fix for sure (not AI, the Wiki).
I already use the Stock > Capacity * 0.99 a lot.
But good point about the ratios.
Even thoguh I'd likely never use it, either.
I tried to find a free AI API to attach to the game's dialog, but didn't find good options.
Not sure there are free versions.
Any chance you're going to add a signal for the power being transmitted?
It's a long debating topic. Personally, I'm strongly against it. I've spent enough time trying to make automation a good management tool for power distribution. However, it's not working. You can create some very basic rules, but they will cover at most 10% of what you really need. To properly manage power, you need to consider all generators and consumers in the network. Optimizations at the level of a single building won't work on even a small colony.
And that's why I created SmartPower. It does everything that I would want to make via automation, except no coding and no lags. The power based signals would be triggering very frequently, in some cases - every tick. If you only need to read power from a building, the getvalue operator can help.
Even if you did, I can't see it being anything but an adapter to bridge Automation and Smart Power.
What is doable, is propagating some signals from SmartPower. Like "building was resumed/suspended". Not sure how helpful it is, but why not. However, I would avoid affecting decisions that SmartPower does. The logic there is already complicated.
I understand.
Btw, whoever posted the PR (this) - thank you, mate!
I can be a douchebag in reviews (and I usually am - ask my colleagues
), but I value the effort. As a result, we will have new signals and actions! 
It's very motivating when people actively involve 
Oh, there's a github for the mod? Noice!
one bit of UI feedback: the arrows to move rules up and down suggest that order matters, i.e. that it will stop evaluating rules when one of them has its conditions met
Always! The fun of making proprietary software I have at my work 
The order is only for the UI appearance. Tell me how I can express it in UI, and will do. The rules are event driven. They don't care how they are being shown on the screen.
it's a difficult one, the only ideas I have are clunky things like a tooltip on the up/down buttons that says something like "Cosmetic only, rules are not evaluated in sequence"
I was thinking about it. It would be useful when you use it the first time, but seeing it every time every day? Here I stopped guessing and just implemented it as-is π
I use conditional formatting in Excel every day at work so I am used to rules evaluating in order and being able to optionally stop evaluating when a condition is met
but with an event-driven system I can see how that would be a pain in the arse to implement
and I can use scripting instead of the constructor to produce the results I need
Please check the pull requests again. You have two more. From me.
That's why I'm not happy with it as a solution. I will keep thinking about it.
Checkout my douchebag comments 
It's always nice to see a person who can file PRs 
Not gonna lie, Github is kind of messy, for ease of contributing. We can't even quick-PR by editing a file in the repositories we cannot commit to, or even in repositories we can commit to.
Copilot just suggested a comment to my new function (copy/paste as-is): "It's teh caller's responsibility to replace the old value". Do you see a problem? π
GitHub, honestly, is past century. Literally. But it still works fine for the open source.
Tbh, the best we have.
Yup. Too bad there isn't a better alternative.
By the way, when are you going to update the mod, with those new changes I made PRs for? π€£
Even if the constructor still uses the 30 instead of 0.3, for 30%.
This weekend. I want to add a new thing to ValueDef - the UI type. In the script, all percentiles will be normalized values - not negotiable. However, in UI, we may want 1-100%.
In that case, would it be possible to use floats with 4 digits? (I think I asked before, but I forgot the answer.)
Not without a full rework of the engine, which I will likely not approve π Give me an example when you need more than 2 digits, and I bet I offer a solution how you can live with just 2.
When you have 1000 beavers or obscene amounts of storage with 100 beavers, for droughts and badwater tides which last up to 100 days or more.
Hmm. And the expression looks like... what?
Fixed precision is not a curse. It's just an obstacle. It's avoidable. Multiply all your inputs by 10, and then de-normalize - you've just improve the precision of your calculations by order of magnitude! Multiply by 100, and you'll be a hero.
Being a programmer, you likely know why 0.1 + 0.2 may not always be 0.3, right? That's why automation doesn't deal with floats. Only integers.
when the storage of water is less than the capacity of water multiplied by 0.003, pause the building, applied to all the other buildings, maybe except a farmhouse or two.
You can't multiply by 0.003. And you know why π Multuply the left argument, then you can get your precission.
Or setting an extra pump to start when the water level is above 0.999 , meaning the dam is about to overflow.
Or a dam to open, to prevent overflowing.'
The game doesn't have anything beyond second digit after the period. So the script does. If you ever need to use more precision, the Math can help.
It's a very artificial example. Nowhere in the game you can see a third digit after the point.
Oh, I see. That's unfortunate, then.
Why? Multiply your left argument by 1,000,000 and you'll get (almost) infinite precision. The Math!
Fixed precision only limits what you can put AFTER the point. However, you can move the point as you wish.
a / b < 0.001 - BAD!
1000 * a / b < 1 - GOOD!
Even AI knows it 
If you didn't know, AI - is the new reality on the job market. Many IT related people will loose their job in the following 2 years. Which is sad.
However, the smart people say: "It will not be AI that takes the jobs out. It will be people, who know how to use AI in their job positions."
So, learn!
There are not enough good free online AI and local AI with github integration and local-files integration, at least that I know of.
Also, I sent you a DM/PM.
Agree. But my statement was in general. If you're looking for a job in IT, you have to know how to use AI. Like it or not.
True.
In my every day duty, I found AI useful for the routine tasks. In can start 2-4 tasks in background, and focus on one very human task (lol). It really speeds up the work. On the other hand, we don't need many programmers now 
Unfortunately, the lack of easy-to-use-and-set-up integration of both online AI and local AI, to popular online services as well as local files, is the thing holding AI back.
Also, I sent you a DM/PM on Discord.
I mean, using LM Studio is not bad, but it's also not as simple as pressing a button to give the current chat the context of a whole folder and all in it, from my (limited) experience so far.
I will check right now. But just FYI, I'm present on the Discord servers where private messages need a prior approval in the public channel 
Don't ask. I was neartly banned for asking 
No no. Sorry.
I din't mean you can't do it π
DO IT
My experience so far was that it's okay to send messages once, but not to insist if there was no reply or if asked to not DM again. But I might be one of the lucky ones. π€£
That's my stand also. Send a DM if you have a question. If the peer doesn't want to reply, they won't. Right? Not on every server, lol
Which is unfortunate.
When I was pointed out that I can't to DM people if they didn't agree in the public chat. I was surprised. To say the least.
But you all probably know the Discords rules by now. Every server, or even channel, is it's own world. With its own rules.
Which is very annoying.
The lack of standardization is very annoying.
Could you add a signal for the progress of each building's production? For example, if I want the breeding pods to stop at 99%, or the mulber production, or something else.
That would be very useful.
Also, the rule preview doesn't show the paranthesis. But that's not an issue, since in script-editing mode, it can be seen.
@south wedge Can you guess what's wrong with this code?
if
(Collectable.Ready > 0 and (District.ResourceStock.Berries < District.ResourceCapacity.Berries * 0.8 or District.ResourceStock.MangroveFruit < District.ResourceCapacity.MangroveFruit * 0.8) )
then Workplace.SetWorkers(1)
That's right! I have the berry storage full and berries ready to collect, but since I added the condition for mangroove storage, it keeps the job populated.
Is there a way to check what kind of collectable is ready? For exmple, Collectable.Berries.Ready and Collectable.MangroveFruit.Ready and Collectable.Carrots.Ready.
For breeding pods not yet feasible. The progress there is not ticking (as it happens for the construction progress), it's a timer that triggers when the breeding time elapses. I haven found a good way to track it without running a check on every tick. And, honestly, freezing pods at 99% seems a bid of cheating. I'd design this component so that it resets all the progress if paused or didn't have nutrients for too long time.
I get you, but it's how it currently works, so it works as intended.
Lots of people basically have a small army of beavers ready to spawn, just in case.
I was considering it when implementing the feature. Can't recall now why I decided not to gather stats per good type. I'll give it another try when is done with the other stuff. Btw, there is a simple workaround here: setup two gathering posts. Yes, it will eat extra space and sometimes consume more beavers, but in general it works fine.
In my plays, in the early game, I usually use gathering posts as "free" storages. They gather stuff until overflow, then stop. Once the initial stage passed, only few get activated at time.
Thanks!
But even that doesn't work, because there is something to gather by that building, even if it's not the preferred thing or the one used in the if-statements.
Hmm
True.
Same story for farmhouses.
Sounds like I need to give it a second thought 
@west mountain
Not exactly addressing your issue, but at least the error reporting is now better 
I wish I can express how I *REALLY * hate floats
Btw, it's the reason why Automation only works with integers.
0.99 may or may not be equal to 0.99. Sounds weird? Welcome to my world.
#π’announcements message π€―
oh wow
That's a big compliment π
2 lines of simple code... or an 8 x 2 construction on the map π€ noting I maybe suck at trying to construct with this logic vs writing code as I haven't done basic logic like this in 20 odd years.
I would prefer this automation over games automation.
Igor's automation I can have scripts saved and copy paste everything. With the game's default way it would be manually building the same logic every time.
Yeah me too, Igor's current automation also offers a lot more flexibility. I also think the average person will struggle a lot more with the logic required to do things in game. It took me a while to work out the really basic rules I used to run all my buildings and it take 7 blocks and use of the memory module so at least mid game resources.
but may allow this mod to get good triggers for information π
In particular, this mod could never trigger on science or rate of production before, and it had no good way to get a direct user input (i.e. levers)
Just now got a chance to read the announcement. Well, it's a really nice addition. Need to check the code to see how to integrate. Scripts+game automated buildings can be a good pair.
And we probably need to think about renaming the mod. Now, the used to be plain and clear name "Automation" is confusing. Ideas?
I would go for something like "Extended Automation."
Or "Auto Automation" hehe π
+1 for "Extended Automation"
The game's new automation is very ONI-like. I will use it, but I will definitely still use this mod.
keep the name "Automation"
you had it first
'Real automation'
One of my saves i dont plan to open until we have real automation back:)
To honour the terminology established by Knatte_Anka it should be Automation Extention π
Imo, extended automation implies that it's going to make use of the new automation buildings for implementation, which I hope isn't the case.
I hope that it functions like it did before, with perhaps a few new inputs to fetch.
even more guys will then complain that its missspelled π
"More Automation"? 
The original idea of this mod grew form the IFTTT concept. From the technical standpoint, it could be "IFTTT Automation", which would describe exactly what this mod does. However, I doubt many people can even spell IFTTT correctly, not to mention understand it π€£
It would also help if it wasn't an abbreviation.
Automasion Extension
Another update has just been released 
I had a feeling that rushing to the fix may not be the best strategy 
even if nothing else, I need the chained construction tool
forget the beavers getting injured in the explosives factory, I am taking psychic damage from how painful it is making underground power networks without this mod
One of my favorite too π
Beavers and bots, too, mainly when laying dynamite π§¨
I've decided that the detonator is proof that they looked at things this mod was commonly used to do when deciding about what to add for automation.
People are complaining that it makes no sense, but clearly it's perfectly logical.
FYI. The reason why there is no v11 compatible version so far is NOT because it's hard to fix. It was done yesterday, actually. The problem was that this version update caught me with my pants down. I made massive changes to the v1.0 branch with regard to UI constructor. Hoping I'll sort it out in the following week
Now, I just can't commit a big batch of incomplete code, even though it seems working. Call it a professional deformation 
If anyone is interested in a version that loads and hopefully works - let me know. You'll get it 
I was chatting with AI with not much expectations (I'm an old skeptic), and suddenly! What do you think?
π‘ Idea: Goal-Driven Automation
Right now automation usually works like this:
condition β action
or in vanilla automation something like:
sensor β logic β building
But there could be another layer on top:
Goals.
Instead of writing rules, the player defines what they want the colony to maintain.
Example
Player defines a goal:
Goal: Keep food β₯ 300
Priority: High
Automation then manages the system:
- enables/disables farms
- pauses mills or bakeries
- reacts to resource shortages
Another example
Goal: Maintain power surplus β₯ 200
Automation could:
- pause low-priority buildings
- enable backup generators
- balance batteries and consumers
Another one
Goal: Keep water tanks β₯ 70%
Automation could:
- enable pumps
- control floodgates
- manage water distribution
I'm not enthused
it seems like a great idea but when you think about how it would work it's just "if stock > x then pause"
and every player's setup is going to be at least slightly different
A somehow working version, in case you like get you game crashed
What's there:
v3.5.0 (started on February 27th, 2026):
- [Feature #128] New signal
Workplace.AssignedWorkersto track the number of workers assigned to the workplace. - [Feature] New action
Workplace.SetPriorityto set the workplace priority. - [Change] Update to game v1.0.11.
- [Change] No more automation tools in the map editor.
- [Change] Don't format percentile values of exported signals. Show them as-is: the normalized float values.
for instance I had three conditions on my water pump:
- if water intake level < 0.05 then set workers to zero
- else if water < [max stock - 100] then set workers to 3
- else set workers to 1
(the changelog doesn't cover all the features. there are many uncommitted changes π€£ )
That approach will definitely not work for the advanced players. But can it work for a regular player?
I think you should push the regular player to work things out instead of just saying "do it for me"
the rule construction system you have is quite good
although it does only seem to allow numbers for the second parameter
if I wanted to do stock >= capacity I had to use the script editor instead
honestly if anything your mod with the rule constructor is simpler than the automation engine added to the base game
I really invest into it. But I can't express how I hate it π Coding UI in Unity - it's like BDSM, except you're the victim 
I have three cats. They learned how to say meow, but it's not helping in the mod development π
Anyway, I'm signing off for today (tonight). See you, folks.
night night
I'm going to play for a couple of hours then go to bed for the night too
Does the priority coloring (green) confuse or is it fine? It's a pure cosmetics. Maybe not a green color to highlight? The idea is to distinguish the priority setting from the text.
May be white?
Would it be possible to give the text the five corresponding priority arrows colours?
Unfortunately, no. The text is assumed to be a constant.
Basically, the localization file.
IgorZ.Automation.Scriptable.Workplace.Action.SetPriority,"worker priority: <GreenHighlight>{0}</GreenHighlight>","Name of the action that sets the workplace priority level"
Like this.
The color can be anything, not required to be "green".
I kind of like the value/content of the action being green if the condition is met
eg in this case "remove" would be green
but if the ready for collection > 0 condition was met, then "assign 1" would be green
The green color only applies to the conditions (they have state). Actions are always statically colored. Usually, yellow.
in that case have the value/content of the action in yellow and the rest in white
Making the colour part of the variable {0} in the script?
or leave it the way it is
Hmm, the usual content of the action is YELLOW (it's a default). Are you suggesting to go to WHITE?
white/grey, same as "if" and "then"
Not possible, sorry.
"remove" or "assign 1" in yellow and "workers" in default colour (grey/white)
Still, not sure if I get it. The only default color is YELLOW. It's how the regular content is shown. For some static strings we can override the color.
Override statically. No way to apply any condition.
E.g. the "detonate dynamiate" template has some color schema. But it's static.
The gray color is reserved for the "information". Like "if" or "then", or anything else, which is not the rule.
Yellow as the way to distinguish rules from the service text.
Using a lighter yellow, e.g. 30% for the "Normal"?
Going to sleep now. Sorry, folks, I was trying to make a release today. It didn't happen 
In case of you're brave enough to use the untested versions π
@south wedge Is there any way to know the max worker of a building.
I am writing a script for all building and I don't want to have a static value for every building.
Example:
condition:(lt (sig Inventory.InputGood.TreatedPlank) 1000)
action:(act Workplace.SetWorkers 1000)
Instead SetWorkers 1000 can I use anything that is dynamic and will set the maxworker of that building?
Got it (act Workplace.SetWorkers {% (getvalue Workplace.MaxWorkers) %}) works. π
Should have read wiki more thoroughly. π
@south wedge Importing rules crashes the game.
;;;;ScrapMetal (TreatedPlank -> ScrapMetal)
condition:(or (lt (sig District.ResourceStock.TreatedPlank) 20000) (ge (div (sig District.ResourceStock.ScrapMetal) (sig District.ResourceCapacity.ScrapMetal)) 90))
action:(act Workplace.RemoveWorkers)
condition:(and (ge (sig District.ResourceStock.TreatedPlank) 20000) (lt (div (sig District.ResourceStock.ScrapMetal) (sig District.ResourceCapacity.ScrapMetal)) 90))
action:(act Workplace.SetWorkers {% (getvalue Workplace.MaxWorkers) %})
Automation is not compatible with game 1.0.12. You can use the preview version above or wait for the release.
To be more specific, the district signals are broken. If you don;t use them, you should be fine.
This also crashes.
;;;;ScrapMetal (TreatedPlank -> ScrapMetal)
condition:(or (lt (sig District.ResourceStock.TreatedPlank) 20000) (ge (div (sig District.ResourceStock.ScrapMetal) (sig District.ResourceCapacity.ScrapMetal)) 90))
action:(act Workplace.RemoveWorkers)
condition:(and (ge (sig District.ResourceStock.TreatedPlank) 20000) (lt (div (sig District.ResourceStock.ScrapMetal) (sig District.ResourceCapacity.ScrapMetal)) 90))
action:(act Workplace.SetWorkers {% (getvalue Workplace.MaxWorkers) %})
Anything that uses district resource signals will be crashing.
Hmm. Most of my rules uses that. Will wait for the fix then. No problem. π
After having played with the new built-in Automation for the last several days, I am almost certainly going to want to still have the flexibility that the Automation Mod provides.
Trying to set up "only turn on when you need stuff and have adequate input" is a headache to manage, and I cannot easily have different thresholds for different buildings without building a separate sensor for each one(!)
(among other things)
v3.5.0 (March 7th, 2026):
- [Feature #128] New signal
Workplace.AssignedWorkersto track the number of workers assigned to the workplace. - [Feature] New action
Workplace.SetPriorityto set the workplace priority. - [Feature] Big improvements to the rules UI consistency. Now, the numbers in the rule editor match the rule's description.
- [Feature] Show the expected number format in the constructor: whole, decimals, percent. And verify the value.
- [Feature] In the rules editor, give more verbose hints on the values of signals and action arguments.
- [Feature] Fully refactor the runtime script value verification. Now, it's fast and reliable. Don't disable it (you can, via the settings)!
- [Change] Update to game v1.0.11.
- [Change] Update the mod icons to make them more game compliant. And consistent!
- [Change] No more automation tools in the map editor.
- [Change] Don't format percentile values of exported signals. Show them as-is: the normalized float values.
I made it. Those game version changes can make a twist in the regular release schedule π
1.0.12 Is not supported right? It's still crashing for above rule.
My bad. It supposed to be 1.0.12
The very current version of the game is supposed to be supported.
(it's 1.0.12 as of my clock)
Anyway, just run it and give it a try 
@south wedge
Using 3.5.0 But still crashes.
Rule:
;;;;ScrapMetal (TreatedPlank -> ScrapMetal)
condition:(or (lt (sig District.ResourceStock.TreatedPlank) 20000) (ge (div (sig District.ResourceStock.ScrapMetal) (sig District.ResourceCapacity.ScrapMetal)) 90))
action:(act Workplace.RemoveWorkers)
condition:(and (ge (sig District.ResourceStock.TreatedPlank) 20000) (lt (div (sig District.ResourceStock.ScrapMetal) (sig District.ResourceCapacity.ScrapMetal)) 90))
action:(act Workplace.SetWorkers {% (getvalue Workplace.MaxWorkers) %})
This is something different
I will check it tomorrow.
Okay. π
I just gave it try, and it crashed
Indeed, it's a problem.
Reported via Discord: #1190169064383991858 message ;;;;ScrapMetal (TreatedPlank -> ScrapMetal) condition:(or (lt (sig District.Resource...
Good day/night folks. I'm out π
Good night. βοΈ
Crash clicking a building with already established rules, concerning versions 3.5.0 release on mod io and preview2. The first preview version is fine in this scenario.
v3.5.1 (March 7th, 2026):
- [Fix #143] Game crashes when importing rules.
@deft tulip @reef spire
what does this mean in the mod settings?
if I leave it unchecked does it evaluate the wrong value?
Maybe it means "right-hand-side" of a condition? (like, eval the RHS in case there are variables, etc?) I dunno, just a guess
yeah I assume it means RHS but I can't work out what the intended effect is
The right argument in the conditions can be shown as a calculated value or as an expression (if it's an expression). Different people prefer different approaches.
ah, got it, thanks
It works now. π₯³π₯³
Is there any way to read a vanilla automation signal, eg the value of a switch or relay?
Not yet. It's in the plans, but I haven't even started working on it.
However, some automation values can be accessible via getvalue
E.g. the lever building has property IsOn, which makes it possible to read it via:
getvalue("Lever.IsOn")
But it won;t be a signal. I.e. you won;t get updates if the value changed.
I can't use β¨Signals.Set("MySwitchSignal", getvalue("Lever.IsOn"))β©?
You can. But you would need some reliable signal in the condition.
E.g. you can't do this: if getvalue("Lever.IsOn") == 1 then ....action...
But you can add any signal to condition and it will work.. at some extent.
E.g.
if Debug.Ticker > 0 and getvalue("Lever.IsOn") == 1
then Debug.Log("Lever is ON")
if Debug.Ticker > 0 and getvalue("Lever.IsOn") == 0
then Debug.Log("Lever is OFF")
It will work, but the rules will be executed every tick.
Lever.IsOn in some form will become a signal in the future.
Just found this in the new Timberborn code:
public static float RoundToPrecision(float value, float precision)
{
return Mathf.Round(value / precision) * precision;
}
It's an explanation why automation doesn't use real numbers and has fixed precision.
Internally, the Automation engine works with integer numbers, so no need to round and suffer from the rounding issues.
Btw, when you calculate resource ratio you use formula: stock / capacity < 0.9. You can easily get division by zero here, if the stock in question has no inventories in the district. The safe variant is: stock < capacity * 0.9
Ohh. Yeah. I got them. It doesn't crash though. If I build my storage, then it goes away.
Anway will update my scripts. Thanks for the suggestion. 
Lol. I was going to give you an example of failing condition and... found out it doesn't happen
Now, it's me who needs explanations. My district doesn't have scrap metal, but your rule for it isn't crashing 
Huh. Right, something changed. Previously I used to get division by zero error in the rules tab. Now it doesn't show.
Probably it's changed because of how the storage is calculated now in game.
Anyway, here is the demonstration of how the "evaluate the right value in condition" settings work. @exotic hazel
It seems so. I'm using the stock components for the stats. They used to not return resource you don't have in the district.
Just checked it. Apparently, the game devs had my problem π And they solved it this way.
Yeah, now they do because they probably include input and output of a building.
That being said, disregard my comment about division by zero. However, if you use "evaluate right argument" setting, you better use the new form. It will be more compact and will give more data.
Yeah, changed all of my rules now.
Mamma mia! Even I don't have that big file for import 
All thanks to claude opus 4.6. π
Okay, the mod is not failing anymore. Time to go to expedition (33).
Thank you for getting this updated. really apprecaite the time you put in to this mod.
@south wedge This gives error
(ge (sig District.ResourceStock.Kimchi) (mul 85 (sig District.ResourceCapacity.Kimchi)))
Something is happening when calculating (mul 85 (sig District.ResourceCapacity.Kimchi))
mul 80 amd 100 works in the same condition.
ResourceCapacity = 625
This is strange. The district signals are only checked for the minimum value - it should not be less than 0. I can't see how it can happen in your condition. What does the log say? You may need to enable vebrose logging for the mod.
Ah, wait a minute. I managed to reproduce it. It triggers when the value checking is enabled.
IgorZ.Automation.ScriptingEngine.Core.ScriptError+ValueOutOfRange: Value must be an integer, found: 25.50
at IgorZ.Automation.ScriptingEngine.ScriptableComponents.ValueDef+<>c__DisplayClass31_0.<RangeCheckValidatorInt>b__0 (IgorZ.Automation.ScriptingEngine.Expressions.ScriptValue value) [0x0014c] in R:\TimberbornMods\Automation\ScriptingEngine\ScriptableComponents\ValueDef.cs:118
at IgorZ.Automation.ScriptingEngine.Expressions.ComparisonOperator+<>c__DisplayClass14_0.<.ctor>b__0 () [0x00007] in R:\TimberbornMods\Automation\ScriptingEngine\Expressions\ComparisonOperator.cs:109
at IgorZ.Automation.ScriptingEngineUI.RuleRow.GetDescription (IgorZ.Automation.ScriptingEngine.Expressions.IExpression expression) [0x00027] in R:\TimberbornMods\Automation\ScriptingEngineUI\RuleRow.cs:374
So, the signal value is integer (as per definition), but the formula gives a decimal. I think teh display number format should not be checked when validationg values. Will be fixed in the next release. In the meanwhile, either disable value checking or round the value.
Ok, I removed most of the runtime checks, but kept the percentile one. To let lazy people know that when you do scripting, the values can have format that is not expected by a regular human 
Let me know, folks, if you have better ideas how to educate users who want to start writing scripts, but don't want to spend time reading docs. It's not a sarcasm. Really: how the UI can be improved for this purpose?
Regardless to the mod, but just out of curiosity. Did you, folks, know that many modern language frameworks round value 2.5 to 2, and value 3.5 to 4? Any guesses why?
(one more reason for this mod to work in integers)
v3.5.2 (March 8th, 2026):
- [Change] Many runtime value validations were removed. They were not helping, but only adding frustration.
- [Change] Show the fractional part of the values when comparing against as signal that can only return a whole number. The math expressions can produce a decimal value, so its worth knowing it's actual value.
- [Change] Many small "changes here and there" to improve the rules UI behavior.
- [Fix] In the value checking mode, some valid expressions were marked as "bad value".
- [Fix] Disabling a rule in the rules editor doesn't mark it as disabled (grayed out).
@deft tulip
As matter of fact, yes.
The reason is actually outside programming, and has to do with statistics.
If you always round a value ending in 0.5 up, it artificially inflates the average when rounding.
So the statisticians went and convinced the computer programmers to make it alternate based on whether the preceding digit is even or odd. Even rounds down, odd rounds up.
In the end, it's all about money π
That being said, don't complain about the mod's fixed precision math having issues 
FYI, the statistics argument was minor here. If we have a program that favors 0.5, so what? The real problem comes when you make software for something that counts money. E.g. a bank software. Or a slot machine, for what it's worth.
That being said, if you see Automation making weird math, blame the capitalists 
D/S: "sometimes [automation] doesn't like * 0.95, so I have to use * 0.9", ref: https://youtu.be/azgDrVZL1GM?si=hqc4AsKuGaXybUWz&t=2465
Yeah, that was fixed in 3.5.2.
I haven't been playing experimental (or, in fact, at all for some time now), how do the 1.0 automation features compare to this mod in terms of functionality? I'd be shocked if they have scripting, so I figure this mod will still have a place, but I'd bet a lot of the simpler use cases can now be done in vanilla?
They offer about 80% of what this mod does, plus some additions (like monitoring science) that it doesn't offer, but most of what is missing is fine control (like shutting down a building without removing its contents).
do you plan on making any changes to this mod given the new vanilla functionality?
Yes. I plan to support vanilla signals in both ways: listening and triggering. I don't see any other things. Maybe some of the new signals (like science) will have own implementation in the mod, but not sure how useful it will be.
Science won't matter much for Folktails, but It could be extremely valuable for Iron Teeth players.
@south wedge Is there a signal to capture the number of unemployed beavers? Or even better, a list of all the available signals and actions? The "Some useful components and their properties" section on your Automation wiki made me wonder if there are things available that weren't specified in the document.
I'd also like to thank you for the work you've done on this mod. It's made the game even more fun for me to play!
For the unemployed beavers there was a PR made by one of the contributors. However, it was for the 0.7 version of the game π I keep this functionality in mind, but so far it's not supported.
As for the full list of signals and actions, the best place is Wiki: https://github.com/ihsoft/TimberbornMods/wiki/Automation-(scripting). It's not always up to date, but I try to update it with the new stuff as it get released.
Unemployed beavers is something you'll be able to pick up off of the base game automation signals.
I just updated Wiki to v3.5.2. Now, it's up to date.
Btw, many things can be done via Debug.Ticker. This signal triggers every tick, so you can use getvalue operator to fetch whatever you want (and know about
).
In v1.0 they made DistrictEmploymentStatisticsProvider which returns all the data out of the box. One day, I will make a signal on the district center, which will be exporting those values: EmployedWorkers + Vacancies. The reason why I didn't make it from the beginning was that the stats could only be obtained by scanning the whole district on every tick. Now, the game does it and caches the stats. Even though it's being updated in every ticks, it's not me who does it, so no blames if it's slow 
It took less than one year to implement multi-argument support, lol. I created the rule editor on March 7th, 2025 
Snap! Actually, more than a year
It's 03/13 today.
v3.6.0 (March 13th, 2026):
- [Feature] Allow configuring action
Signals.Setvia UI.
Folks, from now on I'm dropping the support of v0.7. The packages will not have that version anymore. v3.6.0 is the last one that has the legacy support.
Feature Request: A way to trigger automation (like fireworks) based on new highest wellbeing.
The "new higest" might be encodable as rules, and could also be used for "new highest" goods storage (like water, or food)
but the wellbeing would need to be a signal like season is
(or science would be?)
Seems doable. However, there will be an unavoidable effect: the fireworks will trigger on every rule save. It's because the rule state is sync'ed on save, andt here is no "previous value" to compare with.
for wellbeing, the previous max is saved, so might be avoidable,
for science, and goods, hmmm
isn't current signal value stored on save?
It's saved by the game, but not by the automation engine. Every fresh rule needs to initialize. Imagine it's not fireworks, but a floodgate. You need to set the height based on teh current value. Then, you adjust it based on the changes.
Only custom signals are saved, but it's irrelevant to the problem. When a new rule is created, it doesn't have state. To make it, the engine checks the current signal value and executes the rule if the condition met.
yea, I would have done it with a few rules:
- if current > saved_max: trigger logic
- if current > saved_max: set saved_max to current
(probably need something to reset the trigger too)
Hmm, this way it may work. But you would need to set it up manually. Out of the box it will trigger firewors always.
yes
I think this should be a suggestion for the base game
Regarding inventory automation, would it be possible to implement Inventory.StartSending() alongside Inventory.StartEmptying(), so only haulers and not the whole colony are starting delivering from this storage? Could use it on my current playthrough. For the fourth in-game state Inventory.StartReceiving() I hadn't yet the need for automation in any playthrough.
IIRC, the "supply" feature of the inventory is not about who deliver, it's about the overall delivery logic. The mod doesn't implement own delivery logic. The supply/receive options can be addded, but they won't do what you've described.
Something I wanted to convert to a script action for long time!
@south wedge you still have timberapi as req mod for automation
and its causing confusion
Updated! Thanks for pointing out.
Np π
A preview for the brave ones. It has some features, but I will not post the full list until the final version π
"Smart Automation" - out of the poll idea 
or Smart Scripts
Detecting script loops when you're in two worlds (the stock and mod automation) is a nightmare
It's what stops the v4 release for now.
condition:(eq (sig Automator.State) 100)
action:(act Lever.SetState 'off')
condition:(eq (sig Automator.State) 0)
action:(act Lever.SetState 'on')
Kills the game. And catching it is not that a trivial task.
So, I ended up with a full re-implementation of the error handling system. Expect to see more errors in V4, even though it sounds a bit contradictory 
Any idea why this doesn't work as intended? It eitehr keeps raisin the gate, or it keeps lowering the gate.
Nevermind, I figured it out.
The > and < signs in the IF statement had to be swapped. π€£
OR the + and - in the THEN statement had to be swapped. π€£
This does create waves, but it's better than without it.
Would be interesting if there was an option to set the frequency at which a structure's rules get applied. Or a global one, at least. That way, we could reduce the amount of processing done, by running the queue of IF-THEN statements less frequently.
You can reduce waves effect by adding hysteresis. E.g. close the gate at below 0.7 and open at above 0.8.
In your current setup, you try to keep the level at exact value 0.8, which is barely possible. Thus, the gate height is constantly changing.
I know, I did that after taking the screenshot. And the water meter is some 6-7 blocks away from where the water lands, and that also reduces the wave effect.
But it still ends up in some sort of constructive interference, sometimes, making the waves larger and larger, until I manually reset it.
And I see you change the height relatively to the current height. That's a dangerous approach. I'd use a constant height.
The final call for the new name of the mod:
13
29
1
Advanced Automation
you shouldn't bind yourself to polls
for instance that name manages to combine being over-long with being incredibly generic
the feature that makes your mod stand out from the base game's new automation features is the scripts, so the name of the mod should probably make reference to that
hell, even just "Scripting" would work as a name
"Script Doctor" if you want to be cute
Version 4.0.0preview1
Seems to me sensors 2 and 3 got the same ID (I assume automation signal (#) should be unique). So for the rules the query for sensor3 gets the value from sensor2.
"Automation signal" is the best string I managed to find for the term "This building current stock automation signal." One of the ideas was to use the name of the signal from the buildings, but didn't try it yet.
Tbh, I like the idea of having word "automation" in the name. When people browsing the mods, the expect the name to answer the question "what does it do?" The main idea of the mod is automation, so it gives a lot of context for a new player.
Suggestion: Edit the name of this post to "Automation (Mod)" at least until you change the name of the mod? I just posted here by mistake, instead of in automation
I liked Advanced Automation
It's interesting to see the split between Advanced and Extended
Advanced Automation
v4.0.0 (March 25th, 2026):
- [BIG CHANGE] The mod is now named "Advanced Automation" to better reflect its purpose and avoid confusion with the stock game automation system.
- [Feature] Add
SetNoticeIcon,SetStatusIcon, andSetStatusactions to show icons and status text on the buildings. - [Feature] Add new tool: Construction complete Notification. Once the buildings is completed, and icon and status text will be shown on it to notify the player.
- [Feature] Add signal
Automator.Stateto the automation buildings. If the building can be used as source of the stock game automation signal, then it will have this scripting signal. It can be used "as-is" in the conditions of that building, or be exported via the normal Advanced Automation signals feature. - [Feature] Add action
Lever.SetStateto set the state of the lever. - [Change] Show a wider input box for the string argument values.
- [Change] No more mod versions for the pre-1.0 game version. Use
v3.6.0or earlier for the older game versions. - [Fix] Don't show
SetRecipeaction in the rules editor if there are no more than one recipe in the workshop.
v4.0.0 runs on game version 1.0.12.6 for a short time than just crashes. Seems rubble piles are the culprit, clicking on one or getting picked up crashes the game.
And they also made a new experimental version that broke more stuff 
I think the consensus is to ignore the experimental updates and only deal with them when it hits release. Also probably this will be the only thing broken: #π€mod-creators message
v4.0.1 (March 25th, 2026):
- [Fix] Game crashes when selecting non-automatable buildings (like rubble piles).
For the main branch only. Will update Mod.IO later today.
You could go the stranger route, and call it "I Feel Like A Coder" π€£ or "I AM The Coder" π€£
Why not both? Advanced Automation Extended?
v4.0.2 (started on March 25th, 2026):
- [Update] Support game version
1.0.12.7.
Can you please add support for setting Fill Valve and Throttling Valve? Similar to how the height can be set for floodgate.
The base game only has two values (on/off), but sometimes I need to switch between three or four values, which is quite complicated.
v4.0.3 (March 26th, 2026):
- [Fix] Water flow control actions crash the game.
@south wedge Found one issue.
(eq (sig Inventory.OutputGood.Lotus_Flower) 200)
If there is a _ in the name the paser throws error.
It's supposed to. The identifiers don't allow "_".
How do you get this underscore? Some mod?
Lotus Flower is from Water Beavers
Hmm. Ok, I need to do something then.
yup, it's the id
When I made the core, I assumed nobody will make IDs with spaces. I forgot about underscores 
btw, Moddable Timberborn (one of the dependencies for Moddable Weather) now supports loading optional dlls. So you could get rid of the separate mod for Automation+ModdableWeather
Good to know. But honestly, optionally loading stuff is only a part of the problem. The real headache is using types from the optional library. I was experimenting with it and found some working approaches, but the code became a nightmare.
yea, you have to provide Interfaces, and use them from the optional library side
Did Workplace.MaxWorkers change name?
Every attempt to call it seems to fail.
As far as I can tell, the name is the same. How do you use it and what do you get?
Okay, it was just being really, really, really finicky.
I wonder if you folks have any cool ideas about a new mod for the contest? π It seems, almost everything is already done.
I started making mods 2 months ago, published 24 mods, have no more ideas, the modding competition is announced. As always, my timing and luck is flawless.
There should be a separate reward for 24 mods in 2 months 
i had to play some to think about some additions to add π
but looks like most i can do with codeless and other is not required for it to work
@south wedge I mentioned in the past that automating off Debug.Ticker had minimal effect on performance; it turns out that it's simply because the game's tick rate is incredibly slow; at 1x speed it seems to be just 2 ticks per second.
That said, it is possible to send a signal at the exact same frequency with a timer set to oscillator or a clutch connected to an inverted power meter.
Well, it has no visible impact as long as you don't have much logic on it π Add extensive logic, and you'll be surprised (depends on you system, though). My mojo is avoiding problems instead of solving them. "Every tick rules" is a good way to problems.
The stock game, processes automation every tick. But they do it per automation building. You can't make many of them. My mod's rules can run on any building, which is a big difference in the numbers.
I miss autorecipe, why is noone updating that? But that one actually tried bit too much. It would be sufficient that building rotates a recipe every morning, or when "unable to get all materials" , or when outputs are full. No need to check whole district. Simple and would solve most of the issues.
Or even dumber only one rule "every morning check if the building is at 0%, then rotate recipe" might be sufficient
Or a dumb order list like "two cycles of potatoes, one cycle of chestnuts"
Can you get a trigger on x time of day with AA? (Advanced automation)
Stock automation has a way to trigger event on time. You can export this signal and use it in AA rule.
v4.0.4 (April 28th, 2026):
- [Fix] Rules are not copied to all objects when using duplicate build tool.
- [Fix #130] Lumberjacks leaving left over Oak Logs when using Collectable.Ready != 0
When im trying to create a signal the game just crashes
additionally when im trying to reload the save during a badtide the game crashes as well
downgraded to 4.0.3 and its all good now
game version is v1.0.13.0
Thanks, I will take a look. I assume you were creating the very first signal?
nope
already made 2 on previous version
after update I tried to make another one and this issue has occurred
v4.0.5 (April 29th, 2026):
- [Fix] Game crashes when adding a new signal export.
- [Fix] Game may crash when loading certain saved games.
not sure if its happened for anyone else
have some automations setup on a lumberjack and clicked on base game automation and then it crashed
save as it happended again but i did not do the samething 
and have to say i do love the invert rule function
Hmm. The error comes from the mod. I''ll check it.
Interesting. I got some error with the same rule, but the error is different.
v4.0.6 (April 30th, 2026):
- [Fix] Game can crash on loading a state with "available for collection" rules.
v4.0.7 (Math 2nd, 2026):
- [Fix] Game can crash when a lumberjack with collectable rules is destroyed.
From the last game update: "Flow Sensors are now more precise and no longer claim that zero does not equal zero."
That's why AA has fixed precision from the beginning 
I'm honestly surprised that no programming class I have ever taken has mentioned it, given how easy it is to fall foul of the float != float problem.
... IsAlmostEqual
In fact, it's not even humor. Unity has method Mathf.Approximately. And it does exactly this: checks if the two float values are almost equal 
And if you wonder what it does under the hood. This:
return Abs(b - a) < Max(1E-06f * Max(Abs(a), Abs(b)), Epsilon * 8f);

Yeah, it's a thing. Because when you do == on a float, even if they're supposed to both be the same number, it may return false.
And if you do a == on a float vs a double or int, it'll pretty much always return false
so in theory, when doing a comparison between 2 floats, you want to do an Absolute (removes the negative symbol if it's a negative number) on A - B, and then do a Return result < some threashold, in many cases there used to be a < 0.01 or 0.001 in many places in code.
OMG! What is it?!
Ghost beavers faction coming soon? π
Now, when you said it. Hmm 
If you ever tried map "Pressure", you probably felt my pain 
The "ghost map" is the consequences of that painful experience 
Or this.
Looks like a foggy nighttime moor, very atmospheric.
Those were early screenshots from my now mod: X-Ray. Inspired by playing on the Oasis map. It has so many underground stuff that it's nearly impossible to learn it with the existing game mechanics of terrain layers.
How is it different from Transparent Terrain?
I didn't know about it
On the other hand, I plan to add "through terrain selection" feature.
Not to mention, I have much more cool settings
Kidding. Of course the original mod does all you would need.
Like this
Niiice
That would tend to make it superior to the Transparent Terrain, which still has normal occlusion for object selection.
What about building? Can you place a block in a cavern and use that to reference off of?
Tunnels would be hard without using a reference block, but being able to place a vertial line of them would be nice.
Still work in progress. Making the buildings selectable was an easy task. Allowing building in caverns or on top of underground building is another story. Trying to find a way to hack the checking logic.
Bad new is that this mod cannot be submitted to the contest
It was my only chance.
Better, but still too much noise.
Much better!
I spent only 2 hours chatting with AI. Lol.
It will be a new cover of the mod.
Did you know you can ask quetions to the AI agents today? Ha! It helps a lot.
This is the reference, btw
should it not be < 60 Run?
tho just edit in paint π
Actually, just checked it. It was "> 60"
The old save, who knows why I did it... 
Maybe (theoretically): "IF we have too much potatoes THEN start spending it"? 
noted the ladder down the drilled hole on the right? π
Which one? π
An idea for a mod?
That's the drilling shaft in the original image, it got mutated into a ladder
AI also added a 0.6.9.1-rc version in the bottom right (nice)
Any chance we will get Signals like District.ResourceStorageFilled.Log (for example), so we can use it like the logic gates?
Your ladders made it into the AI image. π€£
Granted, not in the way you made them, but still.
Also, placing a water alarm crashes my game. Google AI Mode says it's your mod's fault. π€£
I'm testing now without your mod, to see if your mod is the issue.
i do not see why Advanced automation would affect Timberborn.BlockObjectPickingSystem.PickedCoordinates 
Nope, crashes even without this mod.
Thanks! Now I know it's not this mod, but no idea what other mod it could be.
will verify my water extention that it do not crash for me
worked for me to place water alarm
To be fair, have you checked how many mods I have enabled? π€£
Out of curiosity, what AI did you use to make that? Thank you!
Are you expecting a ratio here or what? Today, there are signlas for capacity and stock, you can make ratio of that by a simple condition: if capacity * target_ratio > stock then ...
I use ChatGPT. Not the best for that stuff, but I used to work with it.
Yes. A ratio, with a value between 0 and 1. And the reason would be so people could use the GUI builder instead of the code builder, to set up basic commands, like turning off the building when there is no more free space to store the output, or if there is too little output to be worth turning it on.
Free, or paid?
Would also allow for compound conditions to be easier to read and modify (i.e. when there is free space for the output, when there is enough stored input, when there's a drought, and when there isn't another specific resource from the production chain in low quantities, for example).
For example:
if District.ResourceStorageFilled.Log > 0.99
would replace
if District.ResourceStock.Log > District.ResourceCapacity.Log * 0.99
or
if District.ResourceStock.Log / District.ResourceCapacity.Log > 0.99
Easier to write, and easier to debug. Now imagine having 3 or 4 of those in a row, and you can probably see why such a thing would be such a good idea.
Plus that the signal already exists (almost certainly), since it's being used by the built-in sensor-blocks.
Hmm. Yes, there is a point here. Formula is not supported by GUI as of now.
Paid. Free is good to ask some thing occasionally, but if you plan to do any sensible work, the free quota gets exhausted very quick.
The stock signals are very specific thing. Most of the time they are not reusable. AA would need to have own implementation anyway.
Plus, the percentage stock signals given by vanilla automation are completely broken, so copying them would not be wise.
This is one of a few cases where I think reducing the syntax would cause more problems than it would solve.
It's already been reduced massively from the previous iteration, where every single warehouse had to broadcast its stock and capacity separately so you could calculate the sum.
To my shame, I still had no chance to play with the stock automation
What's wrong there with the ratios?
The contour mesh was a challenge.
that looks awesome, you stop follow automation for a bit and come back to xray vision
The capacity seems to be including things that can't be filled, and seems to drift over time, which makes the percent fill option unpredictable and thus unusable.
just as a clarifying question with the constructor. Is there like a default state you can put on a building, or do you need to have both pause and resume functions?
like, can I have a farmhouse be paused by default but only when there's more than like 3 things to be gathered it gets resumed, or do I need to add both say "if less than 2 then pause" and "if more than 5 resume"?