Skip to content

Varbit.getValue() giving wrong value

Summary

The result of Varbit.getValue() does not always give a correct result.

Steps to reproduce

Specifically the Achievement Diary completion varbits largely give a wrong value of -1 even though the respective diary has been completed. After some additional research it appears this only happens to accounts which have obtained the Achievement Diary cape as a result of finishing all Achievement Diaries.

Example Code

Varbits.load(4470).getValue(); //Ignore potential NPE

What is the current behavior?

Me and others have tested this, accounts which have obtained the Achievement Diary cape will get -1 as a result.

What is the expected correct behavior?

Value equals A + 2B + 4C + 8*D, where: A = 1 if easy Wilderness diary completed, else 0. B = 1 if medium Wilderness diary completed, else 0. C = 1 if hard Wilderness diary completed, else 0. D = 1 if elite Wilderness diary completed, else 0.

In our case this should return 15.

Upon further investigation trough RuneLite dev mode I've confirmed this is indeed the correct value of the Varbit.getValue().

Relevant logs and/or screenshots

Result of varbit values trough RL-dev mode image

Result of varbit values trough RM image

Result of checking trough the Achievement API class: image image

Possible fixes

I have no idea, otherwise I would've fixed this. Sorry...