Skip to content
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

New script: prioritize - monitors job creation and boosts priority for configurable job types #317

Merged
merged 7 commits into from
Aug 19, 2021

Conversation

myk002
Copy link
Member

@myk002 myk002 commented Jul 31, 2021

The prioritize script sets the do_now flag on all of the specified types of jobs that are currently ready to be picked up by a dwarf. This will force them to complete the jobs as soon as possible. This script can also continue to monitor creation of new jobs and automatically boost the priority of newly created jobs of specific types.

This is most useful for ensuring important (but low-priority -- according to DF) tasks don't get indefinitely ignored in busy forts. The list of monitored job types is cleared whenever you load a new map, so you can add a line like the one below to your onMapLoad.init file to ensure important job types are always completed promptly in your forts:

    prioritize -a StoreItemInVehicle PullLever DestroyBuilding RemoveConstruction RecoverWounded FillPond DumpItem SlaughterAnimal

This implementation uses the eventful plugin to hook the creation of jobs so it can automatically modify new jobs. It cleans up after itself and unregisters the callbacks when no tracked job types remain (or when a map is unloaded).

@myk002
Copy link
Member Author

myk002 commented Jul 31, 2021

docs are failing because I pre-emptively refer to do-task-now from #316

edit: removed reference to #316 for now. I can add it back once both scripts are merged.

@myk002 myk002 changed the title New script: prioritize [WIP] New script: prioritize Aug 5, 2021
@myk002 myk002 changed the title [WIP] New script: prioritize New script: prioritize Aug 5, 2021
@myk002 myk002 changed the title New script: prioritize New script: prioritize - monitors job creation and boosts priority for configurable job types Aug 5, 2021
@lethosor lethosor merged commit 1bbe5e2 into DFHack:master Aug 19, 2021
@myk002 myk002 deleted the myk_prioritize branch August 19, 2021 02:54
lethosor added a commit that referenced this pull request Aug 21, 2021
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