Merge remote-tracking branch 'PeridexisErrant/autobutcher-export' into develop

develop
lethosor 2015-02-27 23:13:06 -05:00
commit cdf211d437
2 changed files with 13 additions and 17 deletions

@ -1899,8 +1899,8 @@ Options:
default target count. default target count.
:noautowatch: Stop auto-adding new races to the watchlist. :noautowatch: Stop auto-adding new races to the watchlist.
:list: Print the current status and watchlist. :list: Print the current status and watchlist.
:list_export: Print status and watchlist in a format which can be used :list_export: Print the commands needed to set up status and watchlist,
to import them to another savegame (see notes). which can be used to import them to another save (see notes).
:target fk mk fa ma R: Set target count for specified race(s). :target fk mk fa ma R: Set target count for specified race(s).
fk = number of female kids, fk = number of female kids,
mk = number of male kids, mk = number of male kids,
@ -1949,11 +1949,11 @@ add some new races with 'watch'. If you simply want to stop it completely use
Settings and watchlist are stored in the savegame, so that you can have Settings and watchlist are stored in the savegame, so that you can have
different settings for each world. If you want to copy your watchlist to different settings for each world. If you want to copy your watchlist to
another savegame you can export and then import them with ``list_export``: another savegame you can export the commands with ``list_export``:
To export them, open a terminal in the DF directory, and run To export, open an external terminal in the DF directory, and run
``dfhack-run autobutcher list_export > autobutcher.bat`` (or ``.sh`` on OSX or ``dfhack-run autobutcher list_export > filename.txt``. To import, load your
Linux). To import, load your new save and run the script you created. new save and run ``script filename.txt`` in the DFHack terminal.
autochop autochop
--------- ---------

@ -2806,21 +2806,17 @@ command_result df_autobutcher(color_ostream &out, vector <string> & parameters)
if(list_export) if(list_export)
{ {
string run = "dfhack-run autobutcher ";
#ifdef LINUX_BUILD
run = "./dfhack-run autobutcher ";
#endif
// force creation of config // force creation of config
out << run << "start" << endl; out << "autobutcher start" << endl;
if(!enable_autobutcher) if(!enable_autobutcher)
out << run << "stop" << endl; out << "autobutcher stop" << endl;
if (enable_autobutcher_autowatch) if (enable_autobutcher_autowatch)
out << run << "autowatch" << endl; out << "autobutcher autowatch" << endl;
out << run << "sleep " << sleep_autobutcher << endl; out << "autobutcher sleep " << sleep_autobutcher << endl;
out << run << "target" out << "autobutcher target"
<< " " << default_fk << " " << default_fk
<< " " << default_mk << " " << default_mk
<< " " << default_fa << " " << default_fa
@ -2833,7 +2829,7 @@ command_result df_autobutcher(color_ostream &out, vector <string> & parameters)
df::creature_raw * raw = world->raws.creatures.all[w->raceId]; df::creature_raw * raw = world->raws.creatures.all[w->raceId];
string name = raw->creature_id; string name = raw->creature_id;
out << run << "target" out << "autobutcher target"
<< " " << w->fk << " " << w->fk
<< " " << w->mk << " " << w->mk
<< " " << w->fa << " " << w->fa
@ -2841,7 +2837,7 @@ command_result df_autobutcher(color_ostream &out, vector <string> & parameters)
<< " " << name << endl; << " " << name << endl;
if(w->isWatched) if(w->isWatched)
out << run << "watch " << name << endl; out << "autobutcher watch " << name << endl;
} }
return CR_OK; return CR_OK;
} }