Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Suggestion for dfhack script or request for workaround  (Read 1324 times)

PopTart

  • Bay Watcher
    • View Profile
Suggestion for dfhack script or request for workaround
« on: June 09, 2020, 11:16:09 pm »

I love auto collect webs. But I want dwarfs to collect the precious Giant Cave Spider silk from my silk farm and ignore the ordinary Cave Spider silk from the caverns. Currently I have to autodump destroy the ordinary webs every 5 minutes, 400 webs! It would be nice if a script could kill those pesky spiders (which no script can currently do, since they're vermin, I think), or auto-forbid or auto-autodump destroy the ordinary webs.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Suggestion for dfhack script or request for workaround
« Reply #1 on: June 10, 2020, 01:10:48 am »

It's probably possible to remove ordinary cave spiders from the cavern regions (so the species is not included in the lists), but I'm unsure what would happen if you did that in an existing fortress rather than pre embark.

It may be possible to have a script specify the type of webs to collect (there are fields for the job for that, although I don't know if they can be applied). Failing that, it ought to be possible to specify exactly which webs to collect, and thus select only GCS webs.

Although I've never used them, it sounds like workshop burrows should work, at least of you skip the manager and issue the web collection order (on repeat) manually in a workshop dedicated to the task (and thus located close to the web farm).

I use the following script every decade or so to remove webs for FPS preservation reasons:
Code: [Select]
function web_buster ()
  local count = 0
 
  for i, item in ipairs (df.global.world.items.all) do
    if item.flags.spider_web then
      item.flags.garbage_collect = true
      count = count + 1
    end
  end
 
  dfhack.println ("Webs busted " .. tostring (count))
end

web_buster ()
For your purposes, you'd probably want to add a check so you exclude GCS webs from the removal. It should also be possible to modify the script to run automatically every month or so if you really hate webs.
Logged

PopTart

  • Bay Watcher
    • View Profile
Re: Suggestion for dfhack script or request for workaround
« Reply #2 on: June 10, 2020, 03:31:17 pm »

I made a burrow for the silk farm and put all my looms in there and restricted the workshops to the burrow. We'll see if that works.

PopTart

  • Bay Watcher
    • View Profile
Re: Suggestion for dfhack script or request for workaround
« Reply #3 on: June 10, 2020, 03:34:15 pm »

wow, it's working like a charm, and my weavers are emptying out those webs at a heroic clip!

knutor

  • Bay Watcher
  • ..to hear the lamentation of the elves!
    • View Profile
Re: Suggestion for dfhack script or request for workaround
« Reply #4 on: June 11, 2020, 06:50:49 pm »

autojustice -
interogates everyone for every crime - toggle on/off
selects and filter results by word count
removes short(no lead responses)or canned actor responses
also reorganize possible perp list
puts criminal element ontop, instead of under the entire list of civ
remove nonnamed pets from possible perp list
cheat and divulge syndicate locations
Logged
"I don't often drink Mead, but when I do... I prefer Dee Eef's.  -The most interesting Dwarf in the World.  Stay thirsty, my friend.
Shark Dentistry, looking in the Raws.

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Suggestion for dfhack script or request for workaround
« Reply #5 on: June 12, 2020, 06:31:54 pm »

autojustice -
interogates everyone for every crime - toggle on/off
selects and filter results by word count
removes short(no lead responses)or canned actor responses
also reorganize possible perp list
puts criminal element ontop, instead of under the entire list of civ
remove nonnamed pets from possible perp list
cheat and divulge syndicate locations

[SUGGESTIONS] for DFhack plugins
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?