View previous topic :: View next topic |
Author |
Message |
InfinityLuaMan How do I cheat? Reputation: 0
Joined: 15 Jun 2022 Posts: 6
|
Posted: Thu Jun 16, 2022 6:17 am Post subject: How To Format A Hex Calculator ,Number To Hex?Seem Like This |
|
|
How to make a hex calculator seem like (1005=>3ED)
And Also Hello Everyone, i'm newbie of this Site!
Description: |
|
Filesize: |
15.5 KB |
Viewed: |
1996 Time(s) |
|
Description: |
|
Filesize: |
16.29 KB |
Viewed: |
1996 Time(s) |
|
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Thu Jun 16, 2022 6:25 am Post subject: |
|
|
You can use string.format for this.
Code: |
local value = 1005
print(string.format("%X", value))
|
Flags:
%d : Decimal number
%X : Hexadecimal
%o : Octal
%f : Floating-point number
%s : Strings
|
|
Back to top |
|
|
InfinityLuaMan How do I cheat? Reputation: 0
Joined: 15 Jun 2022 Posts: 6
|
Posted: Thu Jun 16, 2022 7:52 am Post subject: |
|
|
LeFiXER wrote: | You can use string.format for this.
Code: |
local value = 1005
print(string.format("%X", value))
|
Flags:
%d : Decimal number
%X : Hexadecimal
%o : Octal
%f : Floating-point number
%s : Strings |
Thanks!The code is work,thanks for your answer.
And is there an array byte in that format?
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Thu Jun 16, 2022 9:51 am Post subject: |
|
|
You mean like this? "10 05 10 05" for example.
|
|
Back to top |
|
|
InfinityLuaMan How do I cheat? Reputation: 0
Joined: 15 Jun 2022 Posts: 6
|
Posted: Thu Jun 16, 2022 8:47 pm Post subject: |
|
|
LeFiXER wrote: | You mean like this? "10 05 10 05" for example. |
Yes!
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4299
|
Posted: Fri Jun 17, 2022 12:09 am Post subject: |
|
|
If you have an array of numbers, you can convert it to a hex AoB like so:
Code: | function numbers_to_aob_string(t)
local t2 = {}
for i,v in ipairs(t) do
v = assert(tonumber(v)) & 0xFF
t2[i] = ('%02X'):format(v)
end
return table.concat(t2, ' ')
end
local numbers = { 123, 68, 0, 32 }
print(numbers_to_aob_string(numbers)) |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
InfinityLuaMan How do I cheat? Reputation: 0
Joined: 15 Jun 2022 Posts: 6
|
Posted: Mon Jun 20, 2022 2:13 am Post subject: |
|
|
ParkourPenguin wrote: | If you have an array of numbers, you can convert it to a hex AoB like so:
Code: | function numbers_to_aob_string(t)
local t2 = {}
for i,v in ipairs(t) do
v = assert(tonumber(v)) & 0xFF
t2[i] = ('%02X'):format(v)
end
return table.concat(t2, ' ')
end
local numbers = { 123, 68, 0, 32 }
print(numbers_to_aob_string(numbers)) |
|
Thanks!It's work.
|
|
Back to top |
|
|
|