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 


If I'm wrong please correct.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1536

PostPosted: Sat Jul 20, 2019 5:12 pm    Post subject: If I'm wrong please correct. Reply with quote

Below are 2 Lua Script codes.
Reasons for use, plus and minus aspects, are explained in the headings.

1) This encoding is working.
Pros:
1) It can change all the codes it finds during scanning.
2) External value can be assigned (with the help of CEEdit)
3) The formatted value can be injected into the code.
Cons:
1) It makes scanning and changing process very slowly.

Code:
function CEButton1Click(sender)
UDF1.CEButton1.Font.Style="fsBold";
codescan1 = 'd0 30 d0 66 ?? ?? 20 14 06 00 00 24 00'
codescan2 = 'D0 D0 61 ?? ?? ?? ?? ?? ?? 09 A7 ?? ?? ??'

Aobswap(codescan1,('d0 30 24 01 48 ?? 20 14 06 00 00 24 00'))
Aobswap(codescan2,('D0 25 F8 55 02 02 02 02 02 02 02'))
UDF1.CEButton1.Font.Style="fsStrikeOut";
end


======================================
The result of my research: a similar, the only available sample is the following.
@ atom0S code:
( I didn't make any changes because the code works. Smile )

2) This encoding is working.
Pros:
It is activated faster than the above encoding.

Cons:
1) It only changes the first code it finds.
The other does not change the same codes.
For example, the game has 1 code, 2 scan results and
i have to write that code 2 times.
2) Lua growing range too.


Code:
function CEButton2Click(sender)
UDF1.CEButton2.Font.Style="fsBold";
local script1 = ([[
[ENABLE]
Aobscan(_code1,d0 30 d0 66 ?? ?? 20 14 06 00 00 24 00) --Code1

_code1:
db d0 30 24 01 48 ?? 20 14 06 00 00 24 00
[DISABLE]
]]);

local script2 = ([[
[ENABLE]
Aobscan(_code2,D0 D0 61 ?? ?? ?? ?? ?? ?? 09 A7 ?? ?? ??) --code2.1

_code2:
db D0 25 F8 55 02 02 02 02 02 02 02
[DISABLE]
]]);

local script3 = ([[
[ENABLE]
Aobscan(_code3,D0 D0 61 ?? ?? ?? ?? ?? ?? 09 A7 ?? ?? ??) --Code2.2

_code3:
db D0 25 F8 55 02 02 02 02 02 02 02
[DISABLE]
]]);

local a, b = autoAssemble(script1, false);
local c, d = autoAssemble(script2, false);
local e, f = autoAssemble(script3, false);
if (a) then
    -- Disable the script?
    autoAssemble(script1, false, b); end
if (c) then
    -- Disable the script?
    autoAssemble(script2, false, d); end
if (e) then
    -- Disable the script?
    autoAssemble(script3, false, f);

    UDF1.CEButton2.Font.Style="fsStrikeOut";
end
end



Question:
Isn't there a way out?
For scanning and replacing in Lua;
Do you have a fast and regular coding idea? Smile

Thanks..

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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