diff --git a/.gitignore b/.gitignore index cf40b01..1d6e3fb 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,5 @@ com_crashlytics_export_strings.xml crashlytics.properties crashlytics-build.properties fabric.properties -.idea/httpRequests +.idea/httpRequests +*.zip diff --git a/README.MD b/README.MD index 975aa77..00cc220 100644 --- a/README.MD +++ b/README.MD @@ -1,17 +1,2 @@ -*Bot Reacaller* - -Original mod was made by [cpeosphoros](https://forums.factorio.com/memberlist.php?mode=viewprofile&u=33391) and can be found [here](https://mods.factorio.com/mods/cpeosphoros/CpeBotRecaller) - -All i did was updating the config. :) i Even copied the Readme. - -Bots are collect from roboports to the Robot Recaller Chest. Good for upgrading bots. - -Should work with all modded bots and roboports, as long as their modder didn't change the internal name of those entities. - -Just build a Robot Recaller Chest and set one of its request slots to any kind of logistic bot. - -It will pull 1 bot of that kind per second from roboports in the same logistic network into the chest. - -If you set more than one kind to be requested, it will only pull the second kind if none of the first is available in the network. - -Both limits were set with balancing in mind. If you want a higher output, or to pull more than one kind at a time, just build more chests. \ No newline at end of file +# Purpose +This is a fork of the "Bot Recaller" mod meant to add a configurable option to control how fast the bots are recalled. diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..5db4616 --- /dev/null +++ b/build.bat @@ -0,0 +1,8 @@ +@echo off +rmdir /s /q "BotRecaller_0.17.3" +del /s /q "BotRecaller*.zip" +mkdir "BotRecaller_0.17.3" +robocopy /s /e . BotRecaller_0.17.3 /mt /xd "BotRecaller_0.17.3" ".git" ".idea" /xf ".gitignore" "build.sh" "build.bat" +7z a BotRecaller_0.17.3.zip "BotRecaller_0.17.3" +rmdir /s /q "BotRecaller_0.17.3" +pause \ No newline at end of file diff --git a/control.lua b/control.lua index 40184f1..3b98628 100644 --- a/control.lua +++ b/control.lua @@ -1,5 +1,3 @@ -require "config" - function checkRecallers() local recallers = {} for i, force in pairs(game.forces) do @@ -83,7 +81,7 @@ end script.on_event(defines.events.on_tick, function(event) - if event.tick % (seconds * 60) == 0 then + if event.tick % (settings.startup["recall-delay-per-robot"].value * 60) == 0 then checkRecallers() end end) diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index edc3299..c08d0f2 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -1,2 +1,8 @@ [entity-name] logistic-chest-botRecaller=Robot Recaller Chest + +[mod-setting-name] +recall-delay-per-robot=Recall delay per robot + +[mod-setting-description] +recall-delay-per-robot=Must result in a whole number when multiplied by 60 \ No newline at end of file diff --git a/settings.lua b/settings.lua new file mode 100644 index 0000000..4bc2be7 --- /dev/null +++ b/settings.lua @@ -0,0 +1,8 @@ +data:extend({ + { + type = "double-setting", + name = "recall-delay-per-robot", + setting_type = "startup", + default_value = 0.5 + } +}) \ No newline at end of file