Skip to content

Commit

Permalink
Add code
Browse files Browse the repository at this point in the history
  • Loading branch information
djungelorm committed Sep 13, 2018
1 parent 1fa9b34 commit 841ef8b
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
*.zip
quick-charge-personal-bots_*
10 changes: 10 additions & 0 deletions Makefile
@@ -0,0 +1,10 @@
.PHONY: all

VERSION=0.1.0

all:
rm -rf quick-charge-personal-bots_$(VERSION)
mkdir quick-charge-personal-bots_$(VERSION)
cp *.lua *.json LICENSE quick-charge-personal-bots_$(VERSION)/
rm -f quick-charge-personal-bots_$(VERSION).zip
zip quick-charge-personal-bots_$(VERSION).zip quick-charge-personal-bots_$(VERSION)/*
23 changes: 23 additions & 0 deletions control.lua
@@ -0,0 +1,23 @@
script.on_nth_tick(
30,
function (e)
for index, player in pairs(game.connected_players) do
if player.character then
inventory = player.get_inventory(defines.inventory.player_armor)
for i=1, #inventory do
grid = inventory[i].grid
if grid ~= nil then
for x=1, grid.width do
for y=1, grid.height do
item = grid.get({x, y})
if item ~= nil and item.type == 'roboport-equipment' then
item.energy = item.max_energy
end
end
end
end
end
end
end
end
)
2 changes: 2 additions & 0 deletions data-final-fixes.lua
@@ -0,0 +1,2 @@
data.raw['roboport-equipment']['personal-roboport-equipment'].charging_energy = "100MW"
data.raw['roboport-equipment']['personal-roboport-mk2-equipment'].charging_energy = "100MW"
10 changes: 10 additions & 0 deletions info.json
@@ -0,0 +1,10 @@
{
"name": "quick-charge-personal-bots",
"version": "0.1.0",
"title": "Quick Charge Personal Bots",
"author": "djungelorm",
"homepage": "https://github.com/djungelorm/factorio-quick-charge-personal-bots",
"factorio_version": "0.16",
"dependencies": ["base >= 0.16"],
"description": "This mod adds quick recharging for personal bots, removing the need to 'mine' your bots to collect and recharge them quickly. It increases the recharge rate of bots from 1MW to 100MW, and charges the personal robotports energy buffer from the 'aether' (it will no longer drain your solar panel/fusion reactor equipment or batteries). This could be considered cheating, as your personal bots recharge for free, however manually mining your bots when they need to charge does the same thing..."
}

0 comments on commit 841ef8b

Please sign in to comment.