[0.17]AutoTrash 4.1.5

Topics and discussion about specific mods
Raz1ell
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Jul 07, 2016 2:59 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by Raz1ell »

Hi , since 0.13.6 i have this string error ( do local var={element={_ _ self="userdata: 00000000713C4800"},name=1,player_index=1,tick=3805508}return var end )

that show up every time i click any of those top-left bottons "only" when i have your mod enabled (i'm using the 0.1.0 versionn btw) , if i disable it i don't get that string error. There is a way to fix it? thx ;)
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by Nexela »

That is just a debug output, you can ignore it for now until Choumiko updates or you can comment out line 432 in control.lua
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by siggboy »

The debugDump function should check a global "debug" flag and return immediately unless it is set. That would avoid spurious debug info being printed.

Right now I run into the issue of mods printing debug info and then I have to find out which one of the 30 mods is causing it... which is very annoying, especially in Windows where I don't have a useful "grep".
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by Choumiko »

siggboy wrote:The debugDump function should check a global "debug" flag and return immediately unless it is set. That would avoid spurious debug info being printed.

Right now I run into the issue of mods printing debug info and then I have to find out which one of the 30 mods is causing it... which is very annoying, especially in Windows where I don't have a useful "grep".
Yeah, but that's no use if i do something stupid like:

Code: Select all

function debugDump(var, force)
  if false or force then
    for _, player in pairs(game.players) do
      local msg
      if type(var) == "string" then
        msg = var
      else
        msg = serpent.dump(var, {name="var", comment=false, sparse=false, sortkeys=true})
      end
      player.print(msg)
    end
  end
end

debugDump(element.name, true) --line 432
Guess i really should stop abusing debugDump to display non-debug messages to players (or add a debug flag and then use it) :mrgreen:
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by siggboy »

If you do

Code: Select all

function debugDump(var, force)
  if global_debug_flag == false then return end
  player.print(debug_msg)
end
Then line 432 is not a problem if "global_debug_flag" is disabled by default. The debugDump function becomes a NOOP in all cases (even if you abuse it) unless the flag is set.

Logging libraries (like log4j) work exactly like that.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by Choumiko »

Updated to AutoTrash 0.1.1
  • added option to trash all unrequested items from the main inventory
  • GUI uses sprite buttons instead of checkboxes
  • removed debug output
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by siggboy »

Choumiko wrote:[*]added option to trash all unrequested items from the main inventory
This is really good, I was missing that option :mrgreen:

Feature request #1:

I've found myself pausing and unpausing auto trash quite often. Also I've toggled the option "autotrash above logistic requests" rather often.

Would it be possible to add triggers to the top-level UI, so it can be directly accessed without opening the AT config window? Or maybe add a little toolbar that contains these checkboxes, which the player can keep open (in the top level display), if you find yourself changing these flags frequently.

Feature request #2:

I'd like to be able to activate auto trash only for certain logistic networks. I want it to be active when I'm inside my main base, but I want it to be disabled when I'm in other logistic networks, such as auxiliary networks that are in outposts for maintenance and building.

Maybe the easiest way to implement this would be a button: "Activate for current logistic network"; you could even have more than one, but then of course that would require additional UI to edit the existing list of enabled networks.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by Nexela »

Code: Select all

Feature request #1:

I've found myself pausing and unpausing auto trash quite often. Also I've toggled the option "autotrash above logistic requests" rather often.

Would it be possible to add triggers to the top-level UI, so it can be directly accessed without opening the AT config window? Or maybe add a little toolbar that contains these checkboxes, which the player can keep open (in the top level display), if you find yourself changing these flags frequently.
but but we have hotkeys for pausing now!
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by siggboy »

Yeah I missed that we have hotkeys. Sorry.

It would still be great if I could make it work only inside of my main base, or maybe "auto pause" as soon as I'm not inside my main base.

So we should be able to select a "master logistic network" outside of which AT goes into auto pause. I don't want any logi bots in my smelting area to take half of the furnaces from my inventory when I'm trying to build an expansion. That's one of the scenarios that I have in mind with this feature request.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by Choumiko »

siggboy wrote:I've found myself pausing and unpausing auto trash quite often. Also I've toggled the option "autotrash above logistic requests" rather often.

Would it be possible to add triggers to the top-level UI, so it can be directly accessed without opening the AT config window? Or maybe add a little toolbar that contains these checkboxes, which the player can keep open (in the top level display), if you find yourself changing these flags frequently.

Feature request #2:

I'd like to be able to activate auto trash only for certain logistic networks. I want it to be active when I'm inside my main base, but I want it to be disabled when I'm in other logistic networks, such as auxiliary networks that are in outposts for maintenance and building.

Maybe the easiest way to implement this would be a button: "Activate for current logistic network"; you could even have more than one, but then of course that would require additional UI to edit the existing list of enabled networks.
#1: something like that? Image

#2: That would certainly be nice. The simplest solution would probably be: Enable in every network by default (when updating to a version that has that feature). From then on the Config UI would show a button to toggle between active/inactive when you are in a network. As for additinal UI: i hate UI work :mrgreen:
siggboy wrote:So we should be able to select a "master logistic network" outside of which AT goes into auto pause. I don't want any logi bots in my smelting area to take half of the furnaces from my inventory when I'm trying to build an expansion. That's one of the scenarios that I have in mind with this feature request.
Sounds even better (as in quicker to add). For a start you can define one main network, if you are outside of it, Autotrash will pause. If no main network is defined it works just like now
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by siggboy »

Choumiko wrote:#1: something like that? Image
Yes, pretty much, and this should not be visible by default, but there should be a little button that makes it appear and disappear (so you won't have it in your face if you don't use it or are not interested in it at the moment). Or instaed of the little button add an option "Display quick option toggle toolbar", so you can hide this if you don't want it.
#2: That would certainly be nice. The simplest solution would probably be: Enable in every network by default (when updating to a version that has that feature). From then on the Config UI would show a button to toggle between active/inactive when you are in a network. As for additinal UI: i hate UI work :mrgreen:
Yes, UI work is pretty annoying, especially in an environment that is not stable yet and does not provide a lot of infrastructure for user interfaces.
siggboy wrote:So we should be able to select a "master logistic network" outside of which AT goes into auto pause.
Sounds even better (as in quicker to add). For a start you can define one main network, if you are outside of it, Autotrash will pause. If no main network is defined it works just like now
Yeah, the main network will be your main factory. Just make a button that captures the network you're standing in right now, and makes that the main network. Then display the network number in the UI, or maybe the coordinates where it was captured. Something that makes at least some sense when looked at.

And add an option: "Automatically pause AT when outside of this logistic network"

If you can easily add this then we'll see how it plays out in practice.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by Nexela »

I think more hotkeys with console messages are the answer versus additional gui elements. I already have too many.


IE

CTRL-Shift-T will toggle trash all,
Ctrl-Shift-L will toggle trash above
And have both of these change the trash Icon maybe overlay a little up arrow on logistics for trash above, and a big up arrow on trash for trash all.
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by siggboy »

Too many UI elements are a problem because they're spamming your screen. That's why I proposed to make this "easy access UI" an option so you can hide it if you don't want it.

Hotkeys are nice and all, but not everybody likes them as they can be difficult to remember, especially if you only rarely use the associated functions.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Raz1ell
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Jul 07, 2016 2:59 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by Raz1ell »

Uhm, i've updated to the last version 0.1.1 but i keep getting this error when loading a save file

"Notice
_ _AutoTrash_ _ /control.lua:537:Unknown
custom imput name:autotrash_pause"
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by Choumiko »

Raz1ell wrote:Uhm, i've updated to the last version 0.1.1 but i keep getting this error when loading a save file

"Notice
_ _AutoTrash_ _ /control.lua:537:Unknown
custom imput name:autotrash_pause"
Just double checked, loads fine for me, and the zip on the portal has the correct filecontents. How did you update? Ingame or manual? Try redownloading the zip or make sure data.lua looks like this: https://github.com/Choumiko/AutoTrash/b ... a.lua#L252 (only the last 10 lines are relevant)
Nexela wrote:I think more hotkeys with console messages are the answer versus additional gui elements. I already have too many.
CTRL-Shift-T will toggle trash all,
Ctrl-Shift-L will toggle trash above
And have both of these change the trash Icon maybe overlay a little up arrow on logistics for trash above, and a big up arrow on trash for trash all.
siggboy wrote:Too many UI elements are a problem because they're spamming your screen. That's why I proposed to make this "easy access UI" an option so you can hide it if you don't want it.

Hotkeys are nice and all, but not everybody likes them as they can be difficult to remember, especially if you only rarely use the associated functions.
Right now i tend to prefer Hotkeys, but mainly because they don't require graphics work (instead of changing the icon i could add/change a tooltip) :mrgreen:
I'll probably go for both options though.
Raz1ell
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Jul 07, 2016 2:59 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.0

Post by Raz1ell »

Choumiko wrote: Just double checked, loads fine for me, and the zip on the portal has the correct filecontents. How did you update? Ingame or manual? Try redownloading the zip or make sure data.lua looks like this: https://github.com/Choumiko/AutoTrash/b ... a.lua#L252 (only the last 10 lines are relevant)
I used the option "update mods" Ingame, now i've just downloaded it manually from the portal and all is fine, dunno what was the problem but thx so much ;)
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.2

Post by Choumiko »

Updated to Autotrash 0.1.2
  • added option to only trash items when the player is in a specific network (WIP)
  • only trash items from the main inventory, cursor and quickbar are not touched
  • added quicksettings to the top buttons, can be toggled by the "gear button"
Not 100% sure if i keep the change that the quickbar isn't cleaned, but i'm not really playing Factorio so i can't say if it's actually a good change.

And the WIP feature is as WIP as it gets, no indication what network you are in, the button just shows "Unset main network" when one is set. Autotrash isn't really paused, it's just inactive. So you can still pause it when in the network. While writing i realized that if your main network get's changed (placing/removing/destroying a roboport) it won't be recognized as the network you set. Fix incoming in a bit :D
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.2

Post by siggboy »

Choumiko wrote:Not 100% sure if i keep the change that the quickbar isn't cleaned, but i'm not really playing Factorio so i can't say if it's actually a good change.
I think it should be limited to slots that are locked (blue background, middle mouse clicked) -- because otherwise the "quickbar" slots are simply additional inventory slots, and there's no reason why AT should not treat them as such.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.2

Post by Choumiko »

Updated to Autotrash 0.1.3
  • update main network when a roboport gets mined/destroyed
  • don't trash blueprints/books (clears the blueprint)
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.x|0.13]AutoTrash 0.1.2

Post by Choumiko »

Updated to Autotrash 0.1.5
  • temporary trash gets removed from main inventory, quickbar and cursor
Post Reply

Return to “Mods”