The Witcher 3

File information

Last updated

Original upload

Created by

JupiterTheGod

Uploaded by

JupiterTheGod

Virus scan

Safe to use

AutoLoot 1.3 - How to Use Filters (27 comments)

  1. JupiterTheGod
    JupiterTheGod
    • member
    • 55 kudos
    Sticky
    How to customize mod after downloading and installing:
    Navigate to The Witcher 3 Wild Hunt \ Mods \ modAutoLoot \ Content \ Scripts \ mod \ AutoLoot \ AutoLootBase.ws

    Edit it with Notepad or, even better, Notepad++.

    Find the following lines:


    and uncomment (remove the "//" thing) the filters you want, like this:


    Important info on && (AND) and on || (OR)
    Use && before filters to only AutoLoot items with ALL the filters active.
    Use || before filters to AutoLoot items that have at least one of those filters active

    Examples:
    Herbs OR armor:
    Herb(...) || Armor(...) ...

    No accidental stealing AND only Armor that is more expensive than 100 coins:
    NoAccidentalStealing(...) && PriceFilter(...) && Armor(...)

    Now you have your custom version! Just open the game and play!
    1. sweeper21
      sweeper21
      • member
      • 0 kudos
      pls help me this problem i have after starting game
      Error [modautoloot]game\player\playerinput.ws(123: Could not find function 'FlipSelectedPotion'
      Error [modautoloot]game\player\playerinput.ws(1254): Could not find function 'FlipSelectedPotion'
      Error [modautoloot]game\player\playerinput.ws(1270): Could not find function 'OnPotionDrinkInput'
      Error [modautoloot]game\player\playerinput.ws(1281): Could not find function 'IsPotionDoubleTapRunning'
      Error [modautoloot]game\player\playerinput.ws(1283): Could not find function 'SetPotionDoubleTapRunning'
      Error [modautoloot]game\player\playerinput.ws(128: Could not find function 'SetPotionDoubleTapRunning'
      Error [modautoloot]game\player\playerinput.ws(1289): Could not find function 'FlipSelectedPotion'
      Error [modautoloot]game\player\playerinput.ws(1317): Could not find function 'OnPotionDrinkKeyboardsInput'
      Error [modautoloot]game\player\playerinput.ws(1346): Could not find function 'OnPotionDrinkKeyboardsInput'
      Error [modautoloot]game\player\playerinput.ws(136: Could not find function 'OnPotionDrinkKeyboardsInput'
      Error [modautoloot]game\player\playerinput.ws(136: I dont know any 'EES_Potion3'
      Error [modautoloot]game\player\playerinput.ws(1392): Could not find function 'OnPotionDrinkKeyboardsInput'
      Error [modautoloot]game\player\playerinput.ws(1392): I dont know any 'EES_Potion4'
      Error [modautoloot]game\gameplay\containers\container.ws(454): Cannot access private property 'keyItemName' in class 'W3LockableEntity' here.
      Error [modautoloot]game\gameplay\containers\container.ws(454): Cannot access private property 'removeKeyOnUse' in class 'W3LockableEntity' here.
      Error [modautoloot]game\gameplay\containers\container.ws(555): Function 'GenerateItemLevel' does not take 2 param(s)
    2. thecoolman001
      thecoolman001
      • supporter
      • 0 kudos
      NVM, Im stoopid
    3. Badboyz9472
      Badboyz9472
      • premium
      • 0 kudos
      These make zero sense, no matter what combination I do either it loots everything, or loots nothing. Which I guess is the point?

      How do you make it so it loots everything BUT the weapons/armor? This mod is great but your instructions are just confusing and I'm sick of my inventory getting 20 maces and axes.
    4. NoMaDhOoK
      NoMaDhOoK
      • member
      • 0 kudos
      A simple way would be to add a ! (its a not operator) operator before armor and weapons, or you can uncomment every line except armor and weapon while changing the operators to ||

      Method 1: // Pick up if not weapons and not armor

      AL_NoAccidentalStealing( container )

      //&& AL_NumberOfItemsInContainerFilter( length )
      //&& AL_WeightFilter( container, ContainerAllItems[i] )
      //&& AL_PriceFilter( container, ContainerAllItems[i] )

      //&& AL_Herb( container )
      && !AL_Armor( container, ContainerAllItems[i] )
      && !AL_Weapon( container, ContainerAllItems[i] )
      //&& AL_Foodstuff( container, ContainerAllItems[i] )
      //&& AL_ItemQuality( container, ContainerAllItems[i] )

      Method 2:

      AL_NoAccidentalStealing( container )

      //&& AL_NumberOfItemsInContainerFilter( length )
      //&& AL_WeightFilter( container, ContainerAllItems[i] )
      //&& AL_PriceFilter( container, ContainerAllItems[i] )

      || AL_Herb( container )
      //&& AL_Armor( container, ContainerAllItems[i] )
      //&& AL_Weapon( container, ContainerAllItems[i] )
      || AL_Foodstuff( container, ContainerAllItems[i] )
      //&& AL_ItemQuality( container, ContainerAllItems[i] )

      Please note that I am not the author and I haven't actually tried it yet but hopefully this will work
    5. Valamyr
      Valamyr
      • supporter
      • 13 kudos
      Its a little complicated for me, just to be sure, if we leave all these lines commented as they are by default, it means we will be looting everything, right? Because I left them all commented and except torches, autoloot seems to pick up everything like I want, but just wanna make sure. Thanks
    6. Zukoi
      Zukoi
      • supporter
      • 0 kudos
      To help out others I use this:

      AL_NoAccidentalStealing( container )
      &&
      ( AL_Herb( container )
      || AL_Foodstuff( container, ContainerAllItems[i] )
      || AL_ItemQuality( container, ContainerAllItems[i] )
      )

      First, check if I am not accidentally stealing. If so, then auto loot items that are either herbs, foodstuffs, or item quality above common.

      The added parenthesis are very important to the code. If you remove them and only use ||, the code wouldn't work right. The code could also be read as this:

      AL_NoAccidentalStealing( container ) && ( AL_Herb( container ) || AL_Foodstuff( container, ContainerAllItems[i] ) || AL_ItemQuality( container, ContainerAllItems[i] )

      If AL_NoAccidentalStealing fails then the statement is false right out of the gate. The first statement must be true for the rest to be considered. With the parenthesizes and ||, any of the conditions could be true for that statement to be true.

      If you want to know more, follow this link https://en.wikipedia.org/wiki/Short-circuit_evaluation . This is a not essential for this logic, but it is a important feature to understand to read Boolean statements.
    7. kelvendiv
      kelvendiv
      • member
      • 0 kudos
      As I have to leave to get everything, less books and without stealing?
  2. MistakenMystic
    MistakenMystic
    • supporter
    • 48 kudos
    Keep in mind these instructions are now out-of-date.
    The file to edit is not the one listed above:
    The Witcher 3 Wild Hunt \ Mods \ modAutoLoot \ Content \ Scripts \ Game \ mod \ AutoLoot \ AutoLootMod.ws
    but rather:
    The Witcher 3 Wild Hunt \ Mods \ modAutoLoot \ content \ scripts \mod \ AutoLoot \ AutoLootBase.ws
    1. illtrick
      illtrick
      • member
      • 0 kudos
      I'm trying to get ranged autoloot to work for monster containers and general boxes and stuff. I have herbs working on the range thing, but I can't get it to work on non herbs. (IK_Pad_A_CROSS=(Action=AutoLootRadius))

      Ultimately i would love
      ALL Herbs OR Foodstuff
      AND ONLY Armor OR Weapons over 100

      Here's what I have now and it's not picking up anything (again but herbs) on Autoloot or Ranged. Additionally -where do things like mutagens, monster bits, etc fall?


      NoAccidentalStealing( container )
      //&& NumberOfItemsInContainerFilter( length )
      //&& WeightFilter( container, ContainerAllItems[i] )
      || Herb( container )
      || Foodstuff( container, ContainerAllItems[i] )
      &&PriceFilter( container, ContainerAllItems[i] )
      ||Armor( container, ContainerAllItems[i] )
      ||Weapon( container, ContainerAllItems[i] )
      //&& ItemQuality( container, ContainerAllItems[i] )
    2. NeoFryboy
      NeoFryboy
      • member
      • 0 kudos
      This is what I set it to:

      NoAccidentalStealing( container ) && (WeightFilter( container, ContainerAllItems[i] ) || (PriceFilter( container, ContainerAllItems[i] ) && Armor( container, ContainerAllItems[i] )) || (PriceFilter( container, ContainerAllItems[i] ) && Weapon( container, ContainerAllItems[i] )) || (ItemQuality( container, ContainerAllItems[i] ) && !Armor( container, ContainerAllItems[i] ) && !Weapon( container, ContainerAllItems[i] )))

      More legible format:
      NoAccidentalStealing( container )
      && (
      WeightFilter( container, ContainerAllItems[i] )
      || (PriceFilter( container, ContainerAllItems[i] ) && Armor( container, ContainerAllItems[i] ))
      || (PriceFilter( container, ContainerAllItems[i] ) && Weapon( container, ContainerAllItems[i] ))
      || (!ItemQuality( container, ContainerAllItems[i] ) && !Armor( container, ContainerAllItems[i] ) && !Weapon( container, ContainerAllItems[i] )) )

      Note: Notice the ! signs to be used as a NOT operand. This switches the filters.

      Explanation:
      This should pick up ALL Items, but leave Armor and Weapons under 100 and avoid stealing accidentally. For those without programming experience, I'll run through the beginner's explanation of how it works. It helps to have taken algebra.

      It's set up to evaluate as a system of true and false. Each of those statements just runs a check and returns either true or false. So, for example we have (in dumbed down terms):
      NoAccSteal && ( weight || (Price && armor) || (Price && weapons)|| (! item qual && ! armor && ! weapon))

      Let's simplify this a little: && becomes 'and' , the || becomes 'or', and the ! becomes 'not'
      NoAccSteal & ( weight or (Price & armor) or (Price & weapons) or (not item qual & not armor & not weapon))

      1) Now, let's say we have a common longsword. Let's simplify these filters to true or false statements based on the common longsword, and for ease let's just assume it's not at risk of being stolen:
      True & ( false or (false & false) or (false & true ) or (not false & not false & not true))

      Now the not statements will make a false into a true and vice versa.
      True & ( false or (false & false) or (false & true ) or (true & true & false))

      Okay, now we need to simplify the parentheses. An '&' will compare everything in the parentheses and return a true if all statements are true. If anything in an & is false it all goes false. An 'or' will result in a true if there is at least one true.
      True & ( false or (false & false) or (false & true ) or (true & true & false)) becomes:
      True & ( false or (false) or (false) or (false))
      True & ( false or false or false or false)
      True & (false)
      True & false
      False - Do not pickup the common longsword.

      2) Let's look at how a book evaluates:
      NoAccSteal & ( weight or (Price & armor) or (Price & weapons) or (not item qual & not armor & not weapon))
      true & ( false or (false & false) or (false & false) or (true & true & true))
      true & ( false or (false) or (false) or (true))
      true & ( true)
      True - pickup the book

      3) Let's look at how an herb evaluates:
      NoAccSteal &( weight or (Price & armor) or (Price & weapons) or (not item qual & not armor & not weapon))
      true & ( true or (false & false) or (false & false) or (true & true & true))
      true & ( true or (false) or (false) or (true))
      true & ( true)
      True - pickup the herb. Even if the herb is of a high quality it still evaluates as true under the weight filter and for the group of 'or's we only need one true to okay the loot.

      Hope this helped someone.
    3. EnixLHQ
      EnixLHQ
      • premium
      • 0 kudos
      I've copy/pasted your code and don't have any autoloot action at all. Never did stock or modified, either. Am I missing an enable function somewhere?
    4. joelthezombie15
      joelthezombie15
      • supporter
      • 0 kudos
      So im using this set up

      NoAccidentalStealing( container )
      && (
      WeightFilter( container, ContainerAllItems[i] )
      || (PriceFilter( container, ContainerAllItems[i] ) && Armor( container, ContainerAllItems[i] ))
      || (PriceFilter( container, ContainerAllItems[i] ) && Weapon( container, ContainerAllItems[i] ))
      || (!ItemQuality( container, ContainerAllItems[i] ) && !Armor( container, ContainerAllItems[i] ) && !Weapon( container, ContainerAllItems[i] )) )

      And it works but i was hoping it would make it so that it just auto loots everything without me having to mash the U key. Is there a way to set this up? Ive looked and looked and done everything the mod author said but nothing has made it work. If someone could give me a basic run down on how to do that id love it.
    5. tommyrocket
      tommyrocket
      • member
      • 0 kudos
      If I understood what this mod does correctly, it just auto-loots items in a radius on a key-press, but not in an automated way as you run around. While that would be nice, I'm not sure if it's even possible.
    6. Striken7
      Striken7
      • member
      • 0 kudos
      Thought I would add my own tweaks as well. I find this method to be the most useful, and others might as well.

      First, I had to add a new filter to the AutoLootFilters file. I called it GearQuality, which I made by copy/pasting the ItemQuality filter and just changing the name. The point is that it functions identical to ItemQuality but I can set them to different values. I use the following in AutoLootBase (broke up lines to improve readability):

      NoAccidentalStealing( container )
      //&& NumberOfItemsInContainerFilter( length )
      //&& WeightFilter( container, ContainerAllItems[i] )
      //&& Foodstuff( container, ContainerAllItems[i] )
      //&& Herb( container )

      && (

      (Armor( container, ContainerAllItems[i] ) && (PriceFilter( container, ContainerAllItems[i] )) || GearQuality( container, ContainerAllItems[i] ))

      ||

      (Weapon( container, ContainerAllItems[i] ) && (PriceFilter( container, ContainerAllItems[i] )) || GearQuality( container, ContainerAllItems[i] ))

      ||

      (ItemQuality( container, ContainerAllItems[i] ) && !Armor( container, ContainerAllItems[i] ) && !Weapon( container, ContainerAllItems[i] ))

      )


      ItemQuality is set to 1 or better. GearQuality is set to 3 or better.

      This way I will automatically loot everything that is not weapons or armor.

      If it is weapons or armor, always loot it if it is Magic/Relic/Witcher quality.

      If it Common or Mastercraft quality weapons or armor, only loot it if it is worth >100 crowns.

      I will not loot anything if it would be considered stealing.

    7. Zerschmetterlink
      Zerschmetterlink
      • member
      • 0 kudos
      @Striken7

      Thank you very much. Your instuctions helped me a lot. I'm finally able to pick up all my desired loot with a single click =)

      For the lazy ones that want to use Striken7's cfg's:
      AutoLootBase.ws

      AutoLootFileters.ws
    8. Irkolak
      Irkolak
      • member
      • 0 kudos
      @Zerschmetterlink

      Trouble with this custom filter

      Error [modautoloot]mod\autoloot\autolootfilters.ws(6): Unknown base class 'AutoLootUserConfig'
    9. Gladry
      Gladry
      • supporter
      • 1 kudos
      I have borrowed from Striken7's code but one small problem - Red Mutagens of any kind dont get looted.\
      Well perhaps once you are into Wine and Roses you don't care much...but I do still

      So I added the following code to AutoLootBase.ws


      ||
      AL_RedMutagen( container, ContainerAllItems[i] )


      And (&& I added the following code to the end of AutoLootFilters.ws

      Must admit it took me a while to decode how the elements of objects and whether there already existed code to check for mutagens and also color.

      Found this "GetSkillMutagenColor" eventually.


      // --- Only Red Mutagen items
      function AL_RedMutagen( container : W3Container, ItemID : SItemUniqueId ) : bool
      {
      // Only Red Mutagen items
      if( container.GetInventory().GetSkillMutagenColor( ItemID ) == SC_Red)
      return true;

      return false;
      }
    10. Ashotep
      Ashotep
      • premium
      • 5 kudos
      I went into my input.settings file in your ...\documents\witcher 3\... folder and set the autoloot strings that you can customize to my movement keys. so now it just loots as I move...no issues.
    11. Jimmus
      Jimmus
      • member
      • 0 kudos
      Brilliant. I hate running and holding shift, and continuously hitting the key I mapped for radius looting.
    12. STuRoK83
      STuRoK83
      • supporter
      • 13 kudos
      @Ashotep
      constantly running this script hasn't caused any issues for you?because yes, mapping it to W is a perfect way to set and forget, ty
      Also, does it work continuously if you're holding down W?
      I feel like when I press mine too much that it breaks and I have to reload my game... seems odd, maybe some script error
  3. Mrryan6262
    Mrryan6262
    • member
    • 0 kudos
    How would I change it so it will loot everything except for any weapons or armor?
  4. johnnydirteen
    johnnydirteen
    • member
    • 0 kudos
    This mod is awesome just i have one question! When i go to the city Geralt can pick up all item from the vendors. How i disabled this?

    THX
  5. requiredspam
    requiredspam
    • member
    • 0 kudos
    To anyone trying to use the item count filter, you need to either replace "length" with "ContainerLength", like so:
    AL_NumberOfItemsInContainerFilter( ContainerLength )

    or just compare the ContainerLength variable directly, e.g.:
    AL_NoAccidentalStealing( container ) && ContainerLength < 3
  6. theniwo
    theniwo
    • member
    • 1 kudos
    Can some one help me on editing the filters in the Autolootbase.ws file?
    I want to loot everything except for weapons or armor below a certain price or level.
    I came up with this:

    NoAccidentalStealing( container )

    && (PriceFilter( container, ContainerAllItems[i] ) || ItemQuality( container, ContainerAllItems[i] )) // price is 100 and level is 2 <
    && (Armor( container, ContainerAllItems[i] ) || Weapon( container, ContainerAllItems[i] ) )

    || Foodstuff( container, ContainerAllItems[i] )
    || Herb( container )
    || WeightFilter( container, ContainerAllItems[i] ) // is currently set to 0.99


    Is there a way to filter out weapons and armor for other filters, like:

    || WeightFilter( container, ContainerAllItems[i] ) && (!Armor( container, ContainerAllItems[i] ) || !Weapon( container, ContainerAllItems[i] ) )

    I tried the above line, but some lesser weapons still get autolooted after combat.

    In addition to that id like to know whats the identifier for alchemy and crafting stuff. Like IsItemFood stands for consumables I want to insert my own functions for alchemy or other stuff.
  7. killerz298
    killerz298
    • member
    • 0 kudos
    .............
    1. Skywalker2019
      Skywalker2019
      • member
      • 0 kudos
      The loot algo does check every item. If the Item pass the filters it will be auto loot. But if a container has still remain items (e.g. items they do not pass trough the filter will cause a popup of the Lootpanel, which could be really annoying in the cities)

      Simple solution is to always return false in AutoLootBase.ws in function LootContainer(..). Just type 'StillHasItems = false' before the last line 'return StillHasItems;'. This will always disable the Lootpanel for the auto loot.

      But if u still want a popup of the loot panel by special conditions you have to do something else.
      Still in the same function define a variable 'StillHasItemsOfInterest : bool'.

      ...
      var StillHasItems : bool;
      var StillHasItemsOfInterest: bool;
      var ContainerAllItems : array<SItemUniqueId>;
      ...

      Set this variable to false at the same place where variable 'StillHasItems' is set to true.
      ...
      // we check if the container isn't already empty
      if (ContainerInventory.GetAllItemsQuantity() > 0)
      {
      StillHasItems = true;
      StillHasItemsOfInterest = false;
      }
      else
      {
      return false;
      }
      ...

      During the Iteration of the items, where you have to disable or enable different filters. You have to check for items which should cause an loot panel. e.g. in my case i auto loot everything automatically except stealing items. But if the container contains stealing item with higher quality i want the popup of the loot panel. Only common stealing item should not end with a popup of the loot panel. In this case is every filter set possible.

      ...
      // we go through each item and try to loot them if they match the filters
      for( i = 0; i < ContainerLength; i+=1 )
      {
      ...

      //Here your modifications at the end of the iteration
      if( !NoAccidentalStealing( container )
      &&ItemQuality( container, ContainerAllItems[i] ) ) {
      StillHasItemsOfInterest = true;
      }
      }
      ...


      Now you have to put at the end of the function the last check. If we do not found any additional item, which was not auto looted, and not of interest, should the function act like they is no item left.

      ...
      if(StillHasItemsOfInterest == false) {
      StillHasItems = false;
      }

      if(StillHasItems == false)
      {
      container.AutoLootCleanup();
      }

      return StillHasItems;
      }

      I hope this could help