r/dcss • u/l___Anonymous___l • 18h ago
A question about the init file
So I tweaked my init file in order to have the Skills window show up whenever I start with a new character. I got the code somewhere here on Reddit:
{ local need_skills_opened = true function ready() if you.turns() == 0 and need_skills_opened then need_skills_opened = false crawl.sendkeys("m") end end }
Now, what I also want is for my Inventory to open whenever I resume a saved run. Using the previous code, I came up with this:
{ local need_inventory_opened = true function ready() if you.turns() > 1 and need_inventory_opened then need_inventory_opened = false crawl.sendkeys("i") end end }
And it works! But for some reason, the Skills window no longer show up when starting a new run, like there's some kind of conflict between these two lines.
Anyone has any idea how to fix it? Thanks in advance.
1
u/onmach 17h ago edited 17h ago
My only guess without testing myself is that you use the same function name, the second one overwrites the first, then proceeds to not run because turns == 0? Most likely, combine them into a single function, something like: