[MOD 0.12.x] Autofill

Topics and discussion about specific mods
Ratzap
Filter Inserter
Filter Inserter
Posts: 371
Joined: Sun Aug 16, 2015 11:15 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by Ratzap »

rk84 wrote:
Ratzap wrote:Autofill is giving me an error with 12.5. Presumably if everyone else is having similar trouble we'll get a fix soon?
What does the error message say?
I haven't played since, I just updated to 12.6 and tried again - my save loads, I put down a burner inserter and this pops up

Image
P1h3r1e3d13
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Sep 02, 2015 1:16 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by P1h3r1e3d13 »

Ratzap wrote:
rk84 wrote:
Ratzap wrote:Autofill is giving me an error with 12.5. Presumably if everyone else is having similar trouble we'll get a fix soon?
What does the error message say?
I haven't played since, I just updated to 12.6 and tried again - my save loads, I put down a burner inserter and this pops up

...
I'm on 1.6 and AutoFill 1.3.4 and no such error.

It is refusing to fill furnaces, though, when I have coal in inventory. I'm new to this mod, so I don't know whether that's a new bug.
Last edited by P1h3r1e3d13 on Mon Sep 07, 2015 12:33 am, edited 1 time in total.
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by rk84 »

Ratzap wrote:
rk84 wrote:
Ratzap wrote:Autofill is giving me an error with 12.5. Presumably if everyone else is having similar trouble we'll get a fix soon?
What does the error message say?
I haven't played since, I just updated to 12.6 and tried again - my save loads, I put down a burner inserter and this pops up
...
its possibly compatibility issue between autofill versions. Sorry.
This might help

Code: Select all

/c remote.call("af", "default")
or you could try load&save your game without autofill and then load the game with autofill active again.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Ratzap
Filter Inserter
Filter Inserter
Posts: 371
Joined: Sun Aug 16, 2015 11:15 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by Ratzap »

rk84 wrote: or you could try load&save your game without autofill and then load the game with autofill active again.
That worked thanks. I disabled autofill, loaded the save, saved it to a fresh file, quit game, restart, enable autofill and on loading the new files it's working.
User avatar
StoneLegion
Filter Inserter
Filter Inserter
Posts: 687
Joined: Fri Sep 05, 2014 7:34 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by StoneLegion »

Fresh time install. When I'm inside a tank and place a turret down I get the following error:
Image
Tritano
Burner Inserter
Burner Inserter
Posts: 17
Joined: Tue Sep 22, 2015 5:12 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by Tritano »

Doing a quick grep in the lua code of factorio says that there is no function getlocalisedentityname but one that is named get_localised_entity_name. It's probably a leftover code part from factorio 0.11

How to fix

Open the zip of autofill, edit control.lua, change the word getlocalisedentityname in line 173 to getlocalised_entity_name
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by rk84 »

Sorry for wait the "getlocalised_entity_name" is fixed and new release is in first post.
I also changed code and interface a bit. There is now one table holding settings, but players can still have personal settings in separated table.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
User avatar
StoneLegion
Filter Inserter
Filter Inserter
Posts: 687
Joined: Fri Sep 05, 2014 7:34 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by StoneLegion »

Thanks mate.
khozmo
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Aug 12, 2015 10:25 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by khozmo »

I am having no luck getting autofill to fill bobs turrets and gun turrets.

This is the command I have seen on a couple other posts. I press ~ (tilde) and paste the command below and it does not seem to do anything. I know I am missing something (probably very simple). I have also tried the command below and put in gun-turret to modify the existing limit on gun turrets but alas nothing.

/c remote.call("af","insertset","","bob-gun-turret-2",{priority=1,group="turrets",limits={20},"ammo-bullets"})

Any help would be greatly appreciated.
User avatar
irbork
Fast Inserter
Fast Inserter
Posts: 246
Joined: Fri Jul 04, 2014 1:17 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by irbork »

khozmo wrote:I am having no luck getting autofill to fill bobs turrets and gun turrets.

This is the command I have seen on a couple other posts. I press ~ (tilde) and paste the command below and it does not seem to do anything. I know I am missing something (probably very simple). I have also tried the command below and put in gun-turret to modify the existing limit on gun turrets but alas nothing.

/c remote.call("af","insertset","","bob-gun-turret-2",{priority=1,group="turrets",limits={20},"ammo-bullets"})

Any help would be greatly appreciated.
You should try to put your user name from settings in the "". And if it won't help run reset af command and then try to run custom insert commands.
MalwareByDesign
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Oct 01, 2015 8:39 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by MalwareByDesign »

khozmo wrote:I am having no luck getting autofill to fill bobs turrets and gun turrets.

This is the command I have seen on a couple other posts. I press ~ (tilde) and paste the command below and it does not seem to do anything. I know I am missing something (probably very simple). I have also tried the command below and put in gun-turret to modify the existing limit on gun turrets but alas nothing.

/c remote.call("af","insertset","","bob-gun-turret-2",{priority=1,group="turrets",limits={20},"ammo-bullets"})

Any help would be greatly appreciated.
It's a bug in 1.3.5.
Replace the isValidSet function in control.lua with this one:

Code: Select all

function isValidSet(set)
	if (set == nil) or (set == 0) then
		globalPrint("autofill.isValidSet: set is nil or 0 (success)")
		return true -- supported for clearing sets
	elseif type(set) == "table" then
		globalPrint("autofill.isValidSet: set is a table")
		for i = 1, #set do
			if set[i] == "fuels-all" then
				set[i] = global.fuels.all
				globalPrint("autofill.isValidSet: accepted preset: fuels-all")
			elseif set[i] == "fuels-high" then
				set[i] = global.fuels.high
				globalPrint("autofill.isValidSet: accepted preset: fuels-high")
			elseif set[i] == "ammo-bullets" then
				set[i] = global.ammo.bullets
				globalPrint("autofill.isValidSet: accepted preset: ammo-bullets")
			elseif set[i] == "ammo-shells" then
				set[i] = global.ammo.shells
				globalPrint("autofill.isValidSet: accepted preset: ammo-shells")
			elseif type(set[i]) == "table" then
				globalPrint("autofill.isValidSet: no preset used, checking item prototypes (might still cause errors)")
				for j = 1, #set[i] do
					if game.item_prototypes[set[i][j]] == nil then
						globalPrint( {"autofill.isValidSet: invalid item: ", tostring(set[i][j])} )
						return false
					end
				end
			end
		end
		return true -- table handled
	end
	globalPrint("autofill.isValidSet: unknown set format")
	return false
end
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by rk84 »

Thanks for report. Sorry for typo.
khozmo wrote:/c remote.call("af","insertset","","bob-gun-turret-2",{priority=1,group="turrets",limits={20},"ammo-bullets"})
Seems its missing item array, but I will make it handel single items in next release.

Edit:sorry I missread that command.
Last edited by rk84 on Fri Oct 02, 2015 9:03 pm, edited 1 time in total.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
khozmo
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Aug 12, 2015 10:25 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by khozmo »

MalwareByDesign wrote:
khozmo wrote:I am having no luck getting autofill to fill bobs turrets and gun turrets.

This is the command I have seen on a couple other posts. I press ~ (tilde) and paste the command below and it does not seem to do anything. I know I am missing something (probably very simple). I have also tried the command below and put in gun-turret to modify the existing limit on gun turrets but alas nothing.

/c remote.call("af","insertset","","bob-gun-turret-2",{priority=1,group="turrets",limits={20},"ammo-bullets"})

Any help would be greatly appreciated.
It's a bug in 1.3.5.
Replace the isValidSet function in control.lua with this one:

Code: Select all

function isValidSet(set)
	if (set == nil) or (set == 0) then
		globalPrint("autofill.isValidSet: set is nil or 0 (success)")
		return true -- supported for clearing sets
	elseif type(set) == "table" then
		globalPrint("autofill.isValidSet: set is a table")
		for i = 1, #set do
			if set[i] == "fuels-all" then
				set[i] = global.fuels.all
				globalPrint("autofill.isValidSet: accepted preset: fuels-all")
			elseif set[i] == "fuels-high" then
				set[i] = global.fuels.high
				globalPrint("autofill.isValidSet: accepted preset: fuels-high")
			elseif set[i] == "ammo-bullets" then
				set[i] = global.ammo.bullets
				globalPrint("autofill.isValidSet: accepted preset: ammo-bullets")
			elseif set[i] == "ammo-shells" then
				set[i] = global.ammo.shells
				globalPrint("autofill.isValidSet: accepted preset: ammo-shells")
			elseif type(set[i]) == "table" then
				globalPrint("autofill.isValidSet: no preset used, checking item prototypes (might still cause errors)")
				for j = 1, #set[i] do
					if game.item_prototypes[set[i][j]] == nil then
						globalPrint( {"autofill.isValidSet: invalid item: ", tostring(set[i][j])} )
						return false
					end
				end
			end
		end
		return true -- table handled
	end
	globalPrint("autofill.isValidSet: unknown set format")
	return false
end
I can finally stop sitting in the corner rocking back and forth muttering! Thanks for this fix. I see that RK has already posted as well!
The Lone Wolfling
Long Handed Inserter
Long Handed Inserter
Posts: 97
Joined: Tue Oct 28, 2014 3:33 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by The Lone Wolfling »

Useful mod. Does anyone have a complete config set for Bob's mods, by any chance?

(Also: I would appreciate it if autofill read from a config file for default settings when starting a new world. As-is, you have to add per-world or edit the source, which gets old quickly.)

Also, personally, the default limit of 10 for gun turrets is too low.
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by rk84 »

The Lone Wolfling wrote:Useful mod. Does anyone have a complete config set for Bob's mods, by any chance?
Thanks. I'm hoping to improve the interface for modders, so they can edit the default settings. Current version has get&set -method for the table at least.
The Lone Wolfling wrote:(Also: I would appreciate it if autofill read from a config file for default settings when starting a new world. As-is, you have to add per-world or edit the source, which gets old quickly.)
Seems like good idea. I have to think if there is any desync pitfalls. Another way could be custom scenarior script that edits settings on init.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
User avatar
HeilTec
Filter Inserter
Filter Inserter
Posts: 258
Joined: Tue Jul 08, 2014 1:14 pm
Contact:

Re: [MOD 0.12.x] Autofill bobwarfare

Post by HeilTec »

The Lone Wolfling wrote:Useful mod. Does anyone have a complete config set for Bob's mods, by any chance?(...)
I have played a bit with bobs and autofill.
I am unsure where the glue between the mods should be placed.

As an intermediate solution I placed a config.lua in the bobswarfare mod for the autofill of turrets.
control.lua
Last edited by HeilTec on Tue Oct 06, 2015 4:52 pm, edited 1 time in total.
Google is my friend. Searching the forum and the wiki is always a first.
User avatar
HeilTec
Filter Inserter
Filter Inserter
Posts: 258
Joined: Tue Jul 08, 2014 1:14 pm
Contact:

Re: [MOD 0.12.x] Autofill boblogistics

Post by HeilTec »

boblogistics
Google is my friend. Searching the forum and the wiki is always a first.
User avatar
HeilTec
Filter Inserter
Filter Inserter
Posts: 258
Joined: Tue Jul 08, 2014 1:14 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by HeilTec »

This mod has already been a great feature.
I would like to contribute.
Is this on github?

Looking at the new code I now think the "glue" belongs inside the autofill mod.
Google is my friend. Searching the forum and the wiki is always a first.
User avatar
HeilTec
Filter Inserter
Filter Inserter
Posts: 258
Joined: Tue Jul 08, 2014 1:14 pm
Contact:

Re: [MOD 0.12.x] Autofill

Post by HeilTec »

Autofill for boblogistics, bobpower and bobwarfare.

Here is how I envision the glue placed in autofill control.lua
autofill_1.3.6.zip
patched for bob
(44.14 KiB) Downloaded 341 times
Partially tested - no gamebreaker.
Last edited by HeilTec on Thu Oct 08, 2015 2:31 pm, edited 1 time in total.
Google is my friend. Searching the forum and the wiki is always a first.
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: [MOD 0.12.x] Autofill

Post by rk84 »

HeilTec wrote:This mod has already been a great feature.
I would like to contribute.
Is this on github?
Actually yes... oh I havent updated it for 2 years :oops:
HeilTec wrote:Looking at the new code I now think the "glue" belongs inside the autofill mod.
In some degree I feel it should be outside, but I'm open for both.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Post Reply

Return to “Mods”