User-Defined Rank Cost Doesn't Update via Web Panel


PhantomBot Version: 2.3.8 (Revision: a3f7c51d)
OS Version: Windows 10
Java Version: 1.8
Browser and Version (for Panel Support): Chrome 61.0.3163
Stock PhantomBot: No, but the modifications are unrelated to this t
Any Recent Changes to Your System: No

Description of Issue: If you change the cost of user ranks through the web panel it doesn’t update the price of them fully.

The issue, per my review, seems to be that the script goes off the variable rankEligableCost, which is defined internally. The script also sets a similar value in the database, which the web panel updates. However, the web panel does not update the rankEligableCost variable.

I believe the code causing this issue starts around line 311 of ranksSystem.js:

            if (userTime >= rankEligableTime &&
                ($.bot.isModuleEnabled('./systems/pointSystem.js') && getUserPoints(sender) > rankEligableCost) || !$.bot.isModuleEnabled('./systems/pointSystem.js')) {
                $.say($.whisperPrefix(sender) + $.lang.get('ranks.set.success', customRank));
                $.inidb.set('viewerRanks', sender.toLowerCase(), customRank);
                if ($.bot.isModuleEnabled('./systems/pointSystem.js')) {
                    $.inidb.decr('points', sender.toLowerCase(), rankEligableCost);


Fixed in 936bd53


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.