MCPcopy Create free account
hub / github.com/DFHack/dfhack / df_autonestbox

Function df_autonestbox

plugins/autonestbox.cpp:140–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138struct_identity autonestbox_options::_identity(sizeof(autonestbox_options), &df::allocator_fn<autonestbox_options>, NULL, "autonestbox_options", NULL, autonestbox_options_fields);
139
140static command_result df_autonestbox(color_ostream &out, vector<string> &parameters) {
141 if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) {
142 out.printerr("Cannot run {} without a loaded fort.\n", plugin_name);
143 return CR_FAILURE;
144 }
145
146 autonestbox_options opts;
147 if (!Lua::CallLuaModuleFunction(out, "plugins.autonestbox", "parse_commandline", std::make_tuple(&opts, parameters))
148 || opts.help)
149 return CR_WRONG_USAGE;
150
151 if (opts.now) {
152 did_complain = false;
153 autonestbox_cycle(out);
154 }
155 else {
156 out << "autonestbox is " << (is_enabled ? "" : "not ") << "running" << std::endl;
157 }
158 return CR_OK;
159}
160
161/////////////////////////////////////////////////////
162// cycle logic

Callers

nothing calls this directly

Calls 2

CallLuaModuleFunctionFunction · 0.85
autonestbox_cycleFunction · 0.85

Tested by

no test coverage detected