|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
LtO Advanced Cheater Reputation: 0
Joined: 09 Mar 2015 Posts: 71
|
Posted: Sun Feb 25, 2018 9:25 am Post subject: Maybe a 'stupid question' |
|
|
After searching and trying I was able to make a very simple lua script for an aob swap I got it to work, but not smooth... And it kinda confuses me, when I had those [enable] and disable parameters in the script it gave an error, now I just have the aobswap functions in a script .ct, but when i open that file to open cheat engine and find my process, it doesn't automatically run the script either. I'd just like the easiest way to use/activate my script. It looks complicated to me those different ways to use code like the auto assembler, .ct or .lua files, and how to make it autorun... The info I found about this didn't make it very clear for me.
So for now it only works when I manually put the aobswap codes in the 'show cheat table lua script', and execute...
Thanks for any help.
|
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Sun Feb 25, 2018 9:35 am Post subject: |
|
|
May be this will help explain it:
CE Lua Basics
As for using Lua or CEA files (the easiest way), "require" for Lua and "include" for AA sections.
include
require
You could also use Lua's "dofile" to execute a Lua file.
But all Lua will need to start at the cheat table Lua script to be executed automatically (if the right options in the CE settings is set).
_________________
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1253
|
Posted: Sun Feb 25, 2018 10:47 am Post subject: |
|
|
There's some complicated explanation.
But if I understood correctly:
(But if I misunderstood; I'll wait clarify the description of the new. )
Paste the following code into a .lua (edit it with notepad)
Then place the file in the Cheat engine Autorun Folder.
If you do not have a .lua file. Copy one from the Autorun folder,
Arrange it on the table.
Lua File Name: AobswapPlugin
(or create a different Autorun lua based on the example. (What if you need))
Code: | function DEC_HEX(IN)
local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
if IN<1 then
OUT=0
return OUT
end
while IN>0 do
I=I+1
IN,D=math.floor(IN/B),math.mod(IN,B)+1
OUT=string.sub(K,D,D)..OUT
end
return OUT
end
function Aobswap(search, change)
aobs = AOBScan(search)
if(aobs ~= nil) then
j = stringlist_getCount(aobs)
--print("Found:",j);
for i = 1, j do
--print(stringlist_getString(aobs,i-1));
--66 ?? ?? d1 a1 68 ?? ?? d0 d0
address=stringlist_getString(aobs,i-1)
for i = 1, string.len(change), 3 do
z = string.sub(change, i, i+2)
x, y = string.find(z, "%?+")
if (x == nil) then
script=[[
]]..address.."+"..(DEC_HEX((i-1)/3))..[[:
db ]]..z..[[
]]
autoAssemble(script)
--print(z)
--print(address.."+"..(DEC_HEX((i-1)/3)))
end
end
end
object_destroy(aobs);
aobs=nil
end
end |
_________________
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Feb 25, 2018 5:47 pm Post subject: |
|
|
LtO
Quote: | ...it doesn't automatically run the script either |
Did you check CE setting : 'When a table has lua script, execute it' ?.
If setting is 'Never' then you must execute lua script manually every time open that CT.
Or
If your script contain a function, say AOB swap function, then you need trigger that function to execute it by call that function name.
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
LtO Advanced Cheater Reputation: 0
Joined: 09 Mar 2015 Posts: 71
|
Posted: Wed Feb 28, 2018 5:38 am Post subject: |
|
|
Thanks, yes that checkbox is enabled... I had installed the aobswapplugin already and for now just execute the aobswaps in lua table... Not a problem also cuz i modify sometimes what I want to swap... But when I load the cheat table I made, it doesn't show the table in my cheat engine, only when i go to lua table script and have to execute it there too...
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1253
|
Posted: Wed Feb 28, 2018 7:13 am Post subject: |
|
|
LtO wrote: | But when I load the cheat table I made, it doesn't show the table in my cheat engine, only when i go to lua table script and have to execute it there too... |
We are living this too. For now this should not be a problem.
Besides, thanks for coming back and telling me about the situation.
Most people, after receiving the information, forgets to return to you.
It looks like these commands do not work on CT startup.
Execute with "Execute Script" command.
This problem can also be caused by changes we have made in CE.
_________________
|
|
Back to top |
|
|
LtO Advanced Cheater Reputation: 0
Joined: 09 Mar 2015 Posts: 71
|
Posted: Thu Mar 01, 2018 7:43 am Post subject: |
|
|
Aylin wrote: | LtO wrote: | But when I load the cheat table I made, it doesn't show the table in my cheat engine, only when i go to lua table script and have to execute it there too... |
We are living this too. For now this should not be a problem.
Besides, thanks for coming back and telling me about the situation.
Most people, after receiving the information, forgets to return to you.
It looks like these commands do not work on CT startup.
Execute with "Execute Script" command.
This problem can also be caused by changes we have made in CE. |
Np, I think it's normal, I'm happy people help me here, so Thanks. On another forum I often get no response at all...
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
|
Back to top |
|
|
|
|
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
|
|