From 293ce0ba5c2fa8504fe70854a6a824b94250da22 Mon Sep 17 00:00:00 2001 From: Zevell Date: Mon, 15 Jun 2020 18:49:34 +1000 Subject: [PATCH 1/6] Settings added Added settings menu option (under startup tab) with an adjustable value for "recall delay per robot" this essentially increase the robots grabbed per second by creasing the delay between each run of the script. --- control.lua | 4 +--- locale/en/locale.cfg | 6 ++++++ settings.lua | 8 ++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 settings.lua diff --git a/control.lua b/control.lua index 40184f1..16d0a51 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.data.default_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 From aa9ee04d268e25b6687bc7c533cc6b606b0c7b98 Mon Sep 17 00:00:00 2001 From: Zevell Date: Mon, 15 Jun 2020 19:40:07 +1000 Subject: [PATCH 2/6] Create build.bat Batch file to cleanly build the mod from source on windows --- build.bat | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 build.bat 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 From dfe4f55401102252813f452554fbabc9c812544a Mon Sep 17 00:00:00 2001 From: Zevell Date: Mon, 15 Jun 2020 19:41:19 +1000 Subject: [PATCH 3/6] ignore *.zip --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From eb1c1e07e6565cd43ef75f0eb9264c078231a330 Mon Sep 17 00:00:00 2001 From: Zevell Date: Mon, 15 Jun 2020 20:51:04 +1000 Subject: [PATCH 4/6] Fixed setting causing crash the code was written wrong due to a misunderstanding of the Factorio API, it has now been fixed and the setting now affects in game entity (robot recaller chest) --- control.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/control.lua b/control.lua index 16d0a51..3b98628 100644 --- a/control.lua +++ b/control.lua @@ -81,7 +81,7 @@ end script.on_event(defines.events.on_tick, function(event) - if event.tick % (settings.data.default_value * 60) == 0 then + if event.tick % (settings.startup["recall-delay-per-robot"].value * 60) == 0 then checkRecallers() end end) From 912d1c3e6ca50c03247ea264874266984228cf44 Mon Sep 17 00:00:00 2001 From: Zevell Date: Sat, 4 Dec 2021 02:53:56 +1000 Subject: [PATCH 5/6] Update README.MD --- README.MD | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/README.MD b/README.MD index 975aa77..c1e0a9c 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 configurable speed option for how fast the bots are recalled. From 409c6aa272d25d9712ce557bd5242cd497f8d387 Mon Sep 17 00:00:00 2001 From: Zevell Date: Sat, 4 Dec 2021 02:54:39 +1000 Subject: [PATCH 6/6] Update README.MD --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index c1e0a9c..00cc220 100644 --- a/README.MD +++ b/README.MD @@ -1,2 +1,2 @@ # Purpose -This is a fork of the "Bot Recaller" mod meant to add configurable speed option for how fast the bots are recalled. +This is a fork of the "Bot Recaller" mod meant to add a configurable option to control how fast the bots are recalled.