Advertisement
EliteAnax17

test

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