Sell Fence items by Quantity (after Quality-sort)#7
Open
mihawk90 wants to merge 2 commits intoiFedix:masterfrom
Open
Sell Fence items by Quantity (after Quality-sort)#7mihawk90 wants to merge 2 commits intoiFedix:masterfrom
mihawk90 wants to merge 2 commits intoiFedix:masterfrom
Conversation
This implements a new function which not only sorts by Quality, but also by Quantity in each individual stack. This is useful for Vendors with limited transactions (i.e. Fences), and can be used to sell both the highest quality goods (which is already the case), as well as freeing as many bag slots as possible by prioritising smaller stacks in the inventory. Dustman already handles selling parts of larger stacks so "leftover" stacks are not a concern.
Author
|
Used this for a couple days now and didn't run into any issues. |
Author
|
Hm so I have used this for a week with no issues, even yesterday, and suddenly today I am getting an error that makes no sense to me... 554 table.insert(arrayQuality[data.quality], data)But the for i = 1, 5 do
arrayQuality[i] = {}
endSo I don't know how that can be edit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements a new function which not only sorts by Quality, but also by Quantity in each individual stack.
This is useful for Vendors with limited transactions (i.e. Fences), and can be used to sell both the highest quality goods (which is already the case), as well as freeing as many bag slots as possible by prioritising smaller stacks in the inventory. Dustman already handles selling parts of larger stacks so "leftover" stacks are not a concern.
If you have any pointers on how this may be achieved more elegantly/efficiently, I'll be happy to work on this more. I'm just not very experienced in LUA (I dabbled back in the WoW days but that was 10 years ago...), but from preliminary testing it seems to work just fine.
I'm putting this in Draft until I had some time to actually test in game (I wrote this overnight when my Fence limit was already reached), but from the debug dumps I was logging it seems to all be working as expected.
Although this should be working just fine with any vendor, I deliberately implemented a new function so as to not interfere with other functionality I may not be aware of, and only adopted it for selling at a fence.
edit:
One day and a full bag of stolen goods later...
I'd say it works pretty well :)