View previous topic :: View next topic |
Author |
Message |
Autem Expert Cheater
Reputation: 1
Joined: 30 Jan 2023 Posts: 149
|
Posted: Wed Apr 16, 2025 6:51 pm Post subject: Brain fog. How do I format this LUA math for CE? |
|
|
Can't get CE to add 30 (in hex) to a value. Trying things such as the attempts below, with no luck...
value = value + 30
value = tonumber(value) + tonumber(30)
value = tonumber(value + "30")
Someone please let me know the right format to write this in, preferably using CE 6.7. If the problem is that 6.7 doesn't support my attempted math, please let me know the alternative way to write this out that will work in CE 6.7.
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 150
Joined: 06 Jul 2014 Posts: 4651
|
Posted: Wed Apr 16, 2025 7:06 pm Post subject: |
|
|
I'd need more context to give a more specific answer.
Lua code:
Code: | value = value + 0x30 |
Memory record's value:
In an AA script, hexadecimal is the default in most places
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
Autem Expert Cheater
Reputation: 1
Joined: 30 Jan 2023 Posts: 149
|
Posted: Wed Apr 16, 2025 7:26 pm Post subject: |
|
|
Code: | [ENABLE]
{$lua}
if syntaxcheck then return end
function funk1(sender)
local AoB1 = AOBScan("3C 00 00 00 89 88 88 3C 80");
if (AoB1 == nil or AoB1.Count > 1) then --> Ends function earlier if the AoB was not found, or if multiple aobs were found.
print("ending")
return
end
local adf = tonumber(AoB1[0], 16)
local pro = getAddress(process)
local blih = ("%8X"):format(adf-tonumber(pro))
local stripped = string.gsub(blih, '%s+', '')
io.write('|', blih, '|\r\n')
io.write('|', stripped, '|\r\n')
print("Found\r\n"..process.."+"..stripped)
end
funk1()
[DISABLE] |
The above script shows the game module address+offset I need, and works perfectly. What I'm trying to do is print another line that shows the address + 30.
So for example right now I get these printed results:
Found
Game.exe+12345600
...but I also want a line that, in this case, would just add 30 to the address. The desired output would look like this:
Found
Game.exe+12345600
Second
Game.exe+12345630
And I'm just stuck not being able to figure out how to add 30 and print that second address. I thought it would be something like in my first post's attempts but the script stops when it gets to any attempt to use math to add 30 to "stripped" variable, so I'm not exactly sure what to do or where exactly to place it since anywhere I place the line causes the script to stop at that line.
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 150
Joined: 06 Jul 2014 Posts: 4651
|
|
Back to top |
|
 |
Autem Expert Cheater
Reputation: 1
Joined: 30 Jan 2023 Posts: 149
|
Posted: Wed Apr 16, 2025 8:13 pm Post subject: |
|
|
Using your additions and removals, the script seems much more straightforward and is working perfectly now. As always, thank you for taking the time to help me out! It really means a lot!
|
|
Back to top |
|
 |
|