Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fixBadges()
- local int n=memory.readdwordunsigned(0x020264A2) --retrieves the value from that address, example is 31, which is 00011111
- local s = ("%03o"):format(n);
- local a, b, c = n:match("(.)(.)(.)");
- local lookup = { ["0"] = 0; ["1"] = 1; ["2"] = 1; ["3"] = 2; ["4"] = 1; ["5"] = 2; ["6"] = 2; ["7"] = 3 };
- return lookup[a] + lookup[b] + lookup[c];
- end
- print(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement