QuickSort

Adds a GUI that allows players to quickly sort items into containers

Total Downloads: 14,542 - First Release: Jul 26, 2015 - Last Update: Mar 31, 2017

5/5, 44 likes
  1. Wulf

    Wulf Community Admin

    Already fixed locally, will be in the next snapshot.
     
  2. How can i make it work for only group, or group rank needed for it to work?
    Like now im using better chat to set ranks on groups, and i want it to be used only for vip+.
     
  3. [Oxide] 1:47 PM [Warning] 'QuickSort v0.1.0' plugin is using deprecated hook: OnPlayerLoot

    What is the problem?
     
  4. Wulf

    Wulf Community Admin

    No, it's just a warning.
     
  5. So there is no problem with the plugin or server right?
     
  6. It means the plugin uses a function that may/will be removed in future versions of api.
     
  7. help please

    [Oxide] 12:39 PM [Warning] 'QuickSort v0.1.0' plugin is using deprecated hook: OnPlayerLoot
     
  8. This currently broken? think the new update has broken it?
     
  9. Does this even work anymore? Nevermind. Disregard this or better yet if someone could delete this
     
  10. Plugin seems to have been broken overtime with unupdated code to match oxide changes, i tried to update it and managed to get it to show up again but it would never go away after closing chests etc, this is the broken code if someone could please look into it :


    private void OnPlayerLoot(PlayerLoot lootInventory, BaseEntity targetEntity)
    {
    BasePlayer player;
    if((player = lootInventory.GetComponent<BasePlayer>()) == null)
    return;

    if(targetEntity.GetComponent<LootableCorpse>() != null || targetEntity is BasePlayer || targetEntity is ResearchTable)
    return;

    lootInventory.entitySource.gameObject.AddComponent<UIDestroyer>();
    CommunityEntity.ServerInstance.ClientRPCEx(new Network.SendInfo() { connection = player.net.connection }, null, "AddUI", new Facepunch.ObjectList(translatedJson, null, null, null, null));
    }


    I have tried changing the OnPlayerLoot etc line to the updated part Oxide has but the line in bold seems to be causing a ton of issues I just dont understand.
     
  11. Code:
    [Oxide] 10:19 AM [Warning] 'QuickSort v0.1.0' plugin is using deprecated hook: OnPlayerLoot
    Does anyone know how to fix this error?
     
  12. still broken. we need a fix! we miss this plugin so bad!
     
  13. Wulf

    Wulf Community Admin

    Aside from the hook warning, what is broken about it? Are you getting any other errors?
     
  14. Nvm previous comments, works fine with latest version of oxide without any changes.
     
    Last edited by a moderator: Feb 5, 2016
  15. When you press All button shouldnt it move all the items (including your belt/clothes)?
    if anyone wants it like that then go into QuickSort.cs and add these lines:
    Underneath (line 56):
    Code:
    ItemContainer playerMain = player.inventory.containerMain;
    Insert:
    Code:
    ItemContainer playerBelt = player.inventory.containerBelt;
                ItemContainer playerWear = player.inventory.containerWear;
    Then at line 76:
    Code:
    ItemContainer playerMain = player.inventory.containerMain;
    Add these lines underneath:
    Code:
    itemsSelected.AddRange(CloneItemList(playerWear.itemList));
                        itemsSelected.AddRange(CloneItemList(playerBelt.itemList));
     
  16. tried to do that, but not succeeded:
    [Oxide] [Error] QuickSort plugin failed to compile!
    [Oxide] [Error] QuickSort.cs(138,62): error CS0103: The name `playerBelt' does not exist in the current context
     
  17. Did you instert the :
    Code:
    ItemContainer playerBelt = player.inventory.containerBelt;
     
  18. i tried this as well and got back

    [Oxide] 1:54 PM [Error] QuickSort plugin failed to compile!
    [Oxide] 1:54 PM [Error] QuickSort.cs(81,19): error CS0136: A local variable named `playerMain' cannot be declared in this scope because it would give a different meaning to `playerMain', which is already used in a `parent or current' scope to denote something else
     
  19. The whole code should look like this:
    Code:
    private void AutoDeposit(ConsoleSystem.Arg arg)
            {
                if(arg.Player() == null)
                    return;
           
                BasePlayer player = arg.Player();
           
                List<Item> itemsSelected;
                List<Item> uselessItems;
                ItemContainer container = GetLootedInventory(player);
                ItemContainer playerMain = player.inventory.containerMain;
                ItemContainer playerBelt = player.inventory.containerBelt;
                ItemContainer playerWear = player.inventory.containerWear;
               
                if(container != null && playerMain != null)
                {
                    if(arg.Args != null && arg.Args.Length == 1)
                    {
                        if(arg.Args[0].Equals("ex"))
                        {
                            itemsSelected = GetExistingItems(playerMain, container);
                        }
                        else
                        {
                            ItemCategory category = StringToItemCategory(arg.Args[0]);
                            itemsSelected = GetItemsOfType(playerMain, category);
                        }
                    }
                    else
                    {
                        itemsSelected = CloneItemList(playerMain.itemList);
                        itemsSelected.AddRange(CloneItemList(playerWear.itemList));
                        itemsSelected.AddRange(CloneItemList(playerBelt.itemList));
                    }
                   
                    uselessItems = GetUselessItems(itemsSelected, container);
                    foreach(Item item in uselessItems)
                    {
                        itemsSelected.Remove(item);
                    }
                   
                    itemsSelected.Sort((item1, item2) => item2.info.itemid.CompareTo(item1.info.itemid));
                    MoveItems(itemsSelected, container);
                }
            }
    Works for me
     
  20. Would it be possible for you to upload the whole QuickSort.cs file with your next reply?

    Check out my .cs file