Separate names with a comma.
Discussion in 'Client & Site Support' started by Hazard, Jun 12, 2015.
Whats the difference between Varps and Varpbits? Both have different values too by the way. @Cloud
This is the wrong section for this but I'll go ahead and answer it anyways.
Varps stands for player varps. They are the raw integers that contain many pieces of player specific information. They can often be used by themselves, but often multiple pieces of information get packed into a single varp. This is where Varpbits come into play.
When multiple pieces of information are packed into a single varp, you have two options. The way things have previously been done in the scene would require the bot author to manually unpack the values they want using shifts and masks, but that's not really convenient and leaves a lot of room for error. The solution to this is to use the game client's varpbits. Varpbits are used to isolate individual pieces of information from varps for access within the game's client scripts bots. A varpbit is like a 1 to 1 mapping to a specific value. It does this by specifying a most and least significant bit internally and then extracting it.
When a varp contains one piece of information, use the raw varps.
When a varp has multiple pieces of information packed within it, use varpbits for easy extraction.
Api wise what does this involve?
What do you mean? There is both a Varps class and a Varpbits class. You use the index you see in the dev toolkit and call the respective api methods to get there values.
tbh I never really noticed varpbits until now
I never saw the varpbits tab until now, too. It must have been a recent addition.
It was added less than a week ago in response to me not wanting to extract all the bits from a varp after the resizable oldschool update. Internally we've had them for a while but I added them in the developer toolkit to make it easier for me to debug and it's useful for you guys too.
I didn't notice the varpbits class apparently
Varpbits seems so much easier to deal with xD
Maybe it would be wise to announce to developers the addition of a significant new feature so we can notice and make use of it quickly.
Varpbits would have solved ALL of my problems with runecrafting pouches... would have saved so much frustration and time caused by the inadequacy of varps... aargh.
Nice i noticed it but also did not know the difference... geez i should really start coding again maybe when i get my new pc
@Cloud @Hazard What IDE do you guys use to make a script bot? I heard alot about IntellJ or how is it called, but i always used eclipse ( i am refering to RSBot in 2009 xd )
I manually found the shift and worked out a mask to deal with that xD also there was a pattern between the ordinal of the enum and the bit corresponding to if it contains essence
Varpbits would have been even easier though xD
Still using Eclipse over here
You didn't ask me but I use IntelliJ and have been for a long time. I highly recommend it
@Cloud can the Varpbit class be added to the Jdocs as it's not there just yet
(That's kinda the reason I opened this topic too)
Ill check it out sorry that i did not ask you while your one of my favorite bot authors on here haha