tesu / PennyPincher

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

[Feature Request] Undercut by at least 1 when using Modulo setting #48

Open coredumperror opened 1 year ago

coredumperror commented 1 year ago

What I'm trying to do is make sure my prices always end in a multiple of 5, and are no more than 5 below the current minimum price.

However, if I set "Amount to undercut by" to 0, then set the Module setting to 5, that works great for every price except ones that already end in 5 or 0, as it ends up not undercutting them at all. If I set "Amount to undercut by" to 5, that does result in undercuts that always end in 5, but it undercuts too much in cases where the price doesn't end in a multiple of 5 (e.g. 1997 becomes 1990 instead of 1995).

I would like for there to be some way to ensure that an uncut is applied, and all prices end in 5 or 0, while being no more than 5 below the current minimum price on the MB. Perhaps have the internal math of the plugin always subtract an additional "modulo" value if it comes up with the same value it read from the MB?

tesu commented 1 year ago

Set Amount to undercut by to 1 and Multiple† to 5

coredumperror commented 1 year ago

That doesn't quite work. If the price you're undercutting ends in anything except 0, you'll undercut too far. With "Amount" set to 1, Modulo set to 5, and Multiple set to 5, 1099 becomes 1090, instead of 1095. 2082 becomes 2075, instead of 2080.

I want to undercut by at most 5, but using Multiple + Modulo makes me undercut by at least 5.

tesu commented 1 year ago

You don't need modulo here, set it to 1

coredumperror commented 1 year ago

Ahhhh, there we go!

I think the thing that threw me off is the description of the Multiple setting. "Multiple" doesn't really make a lot of sense as a name for this, and "This can be used to undercut by multiples of an amount" seems to be the wrong description. I'd rephrase that to "This can be used so that your copied prices are always multiples of, for example, 5."