Skip to content

Instantly share code, notes, and snippets.

@AlinaNova21
Last active June 27, 2016 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlinaNova21/533fa1af488fcc67f4e052e7c2245aac to your computer and use it in GitHub Desktop.
Save AlinaNova21/533fa1af488fcc67f4e052e7c2245aac to your computer and use it in GitHub Desktop.
script.on_init(function()
firstrun = true
end)
script.on_event(defines.events.on_tick, function(event)
if(firstrun) then
firstrun = false
autocapture(1)
end
end)
function autocapture(player_index)
game.daytime = 0
game.players[player_index].print("Capturing...")
for coord in game.get_surface(1).get_chunks() do
local position = { coord.x*32, coord.y*32 }
local resolution = { 1024, 1024 }
local pathtext = "Map/10/"..coord.x.."/"..coord.y..".png"
game.take_screenshot{position=position, resolution=resolution, zoom=1, path=pathtext, show_entity_info=true}
end
game.players[player_index].print("Captured!")
end
#!/bin/bash
FACTORIO=factorio/bin/x64/factorio
HOST=172.17.0.3
PORT=34197
SAVE=""
[[ $FACTORIO_HOST != "" ]] && HOST=$FACTORIO_HOST
[[ $FACTORIO_PORT != "" ]] && PORT=$FACTORIO_PORT
REMOTE=$HOST:$PORT
[[ $FACTORIO_SAVE != "" ]] && SAVE=$FACTORIO_SAVE
[[ $SAVE == "" ]] && SAVE=$(ls -t /tmp/factorio_test/saves/ | head -1)
cp player-data.json factorio/
cp /tmp/factorio_test/saves/$SAVE factorio/saves/_snapshot.zip
$FACTORIO --load-game _snapshot.zip --autosave-interval 0 --autosave-slots 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment