Skip to content

Add z_instrument_all script and documentation #1468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

unboundlopez
Copy link

z_instrument_all.lua

Automatically queue work orders for all discovered instruments in Dwarf Fortress using DFHack.

Features

  • Detects all valid, craftable instruments via instruments command
  • Normalizes and filters instrument names for compatibility
  • Automatically places a work order for each instrument without having to manually input order and name

Usage

Run with a number to place that many orders per instrument (defaults to 1 if omitted):

::

z_instrument_all 5

This example queues 5 of each discovered instrument.

Acknowledgments

This script utilizes the DFHack instruments command to retrieve and process instrument definitions.

@unboundlopez
Copy link
Author

pre-commit.ci autofix

Copy link
Member

@ab9rf ab9rf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in addition to the specific comments already made, i can't approve of the name. a z_ prefix offers no actionable information to players, and i do not want the situation of individual script developers fighting over who has "prefix rights" within the script namespace

i go back to the idea that this should be an added option to the instruments script rather than a script of its own

Comment on lines +52 to +54
local success, err = pcall(function()
dfhack.run_command("instruments", "order", name, tostring(order_count))
end)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would also prefer to invoke instruments directly instead of running this through run_command

it might make more sense to implement this PR as an extension to instruments

@unboundlopez
Copy link
Author

unboundlopez commented Jul 3, 2025

I made a new pull request. I hope I did it properly. #1473

1 similar comment
@unboundlopez
Copy link
Author

I made a new pull request. I hope I did it properly. #1473

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