Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Tass on November 13, 2005, 05:03 PM

Title: hardcore = Asc(P(26)) And 4
Post by: Tass on November 13, 2005, 05:03 PM
I seen in many sources for d2 stat strings I see:

        Dim hardcore As Byte
        hardcore = Asc(P(26)) And 4

How does the And modify the byte? What does it do exactly? I can't find any help on google that's why I'm posting here.
Title: Re: hardcore = Asc(P(26)) And 4
Post by: Hdx on November 13, 2005, 05:26 PM
It praforms a bitwise and operation on it using 4 (00000100)
Information on how it works can be found Here (http://en.wikipedia.org/wiki/Bitwise_operation#AND)
It will only return 1 of 2 values. 0 or 4. If it returns 4 then the hardcore flag is set, and that charecter is hardcore.
~-~(HDX)~-~
Title: Re: hardcore = Asc(P(26)) And 4
Post by: Tass on November 13, 2005, 06:01 PM
Thanks man.