Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Converting multiple dec numbers to 4 byte

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
TeTETE121
How do I cheat?
Reputation: 0

Joined: 15 Sep 2017
Posts: 5

PostPosted: Sun Jan 14, 2018 9:12 pm    Post subject: Converting multiple dec numbers to 4 byte Reply with quote

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 Very Happy
_________________
noodles are the best no doubt can't deny taste better than water but don't ask me why
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sun Jan 14, 2018 9:32 pm    Post subject: Reply with quote

In Lua:
Code:

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.

_________________
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites