Posted: Sun Jan 14, 2018 9:12 pm Post subject: Converting multiple dec numbers to 4 byte
So, I made a modding tool that outputs just dec numbers. like 256 200 600 6958 4995 and I need someway to convert every number quickly to 4 byte without doing it manually. Cheat engine does not help in anyway with the pasting function, even in 4 byte dec viewing mode. It just asks whether it's a string or not and each function does not do what I want. this is pretty important because the modding community needs this tool for editing vocals ok thanks byeeeeeeee _________________
noodles are the best no doubt can't deny taste better than water but don't ask me why
local dec = 100
local s = string.format('%08X', dec)
print(s)
local bytes ={}
for k in s:gmatch('(%x%x)') do
table.insert(bytes, tonumber(k, 16))
end
print(table.concat(bytes, ', '))
Code:
00000064
0, 0, 0, 100
Probably a better why but, must languages will do this fairly easily. _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum