tesu / PennyPincher

XIVLauncher plugin for undercutters
MIT License
16 stars 21 forks source link

[Feature Request] Undercut by multiples of a number #20

Closed rikai closed 2 years ago

rikai commented 2 years ago

Hello, I have a preference for undercutting by multiples of five, Ie, multiples of 5 or so.

Would it be possible to implement an option to undercut by certain multiples or something of the sort?

saltybrackets commented 2 years ago

The new Modulo feature would theoretically allow for this, but the math is a little off.

Currently it's using this:

var price = listing.ItemListings[i].PricePerUnit - (listing.ItemListings[i].PricePerUnit % configuration.mod) - configuration.delta;

An additional step to apply the modulo adjustment after the delta subtraction I think would fix it. Eg:

var price = listing.ItemListings[i].PricePerUnit - configuration.delta;
price = price - (price % configuration.mod);

A temporary workaround would be to set Modulo to 5, and Amount to Undercut By to 0. However, if the lowest price is already a multiple of 5, then you wouldn't actually undercut.

tesu commented 2 years ago

Fixed by #31

rikai commented 1 year ago

Thank you so much for this. :)