Cheat Engine
The Official Site of Cheat Engine
FAQ
Search
Memberlist
Usergroups
Register
Profile
Log in to check your private messages
Log in
Cheat Engine Forum Index
->
General Discussions
->
Guests
Post a reply
Username
Subject
Message body
Emoticons
View more Emoticons
Font colour:
Default
Dark Red
Red
Orange
Brown
Yellow
Green
Olive
Cyan
Blue
Dark Blue
Indigo
Violet
White
Black
Font size:
Font size
Tiny
Small
Normal
Large
Huge
Close Tags
[quote="atom0s"]When Cheat Engine opens a target process, Lua has a callback function for it: [code]function onOpenProcess(procid)[/code] You can use this to tell if CE is attached to your process. procid is the process id that it is attached to. You can validate the process doing something like this: [code]---------------------------------------------------------------------------------------------------- -- func: CheckValidProcess -- desc: Ensures the process selected is our target process by its name. ---------------------------------------------------------------------------------------------------- local function CheckValidProcess(pid, name) local procs = getProcesslist(); for k, v in pairs(procs) do if (k == pid) then if (tostring(v):lower() == name:lower()) then return true; end end end return false; end ---------------------------------------------------------------------------------------------------- -- func: onOpenProcess -- desc: Callback invoked when a process is opened by Cheat Engine. ---------------------------------------------------------------------------------------------------- function onOpenProcess(procid) -- Ensure the correct process is selected.. if (not CheckValidProcess(procid, 'YourProcessNameHere.exe')) then error('Attached to the wrong process.'); return; end -- Force the open process to complete.. reinitializeSymbolhandler(); -- Do your code here.. end[/code] At the end where I put the comment 'do your code here' is where you would want to do your personal cheat stuff for what you are doing.[/quote]
Options
HTML is
OFF
BBCode
is
ON
Smilies are
ON
Disable BBCode in this post
Disable Smilies in this post
All times are GMT - 6 Hours
Jump to:
Select a forum
Cheat Engine
----------------
Cheat Engine
Cheat Engine MacOS
Cheat Engine Lua Scripting
Cheat Engine Extensions
Cheat Engine Tutorials
General Gamehacking
Auto Assembler tutorials
Pointer tutorials
Game specific tutorials
Webbrowser stuff related tutorials
Console Modding
LUA Tutorials
General Discussions
----------------
General Discussions
Art
Computer Talk
Random spam
Art Requests
Art Tutorials
Willekeurige Rotzooi
Guests
Cheat Requests
----------------
Single player cheat request
Cheat Engine Downloads
----------------
Tables
Trainers
Auto Assemble scripts
Coding
----------------
Cheat Engine Source
CETC Server and Clients
DBVM
Plugin development
General programming
Binaries
Crackmes
General programming+
Game Development
2D Graphics
3D Modeling
Gameplay design
Web Development
Games
----------------
Flash Games
Gaia Online
Stick Arena
Hello Kitty Forums
----------------
Temp
Topic review
Author
Message
jeff.artik
Posted: Sun Jun 11, 2017 6:27 pm
Post subject:
I targeted what I tought, the activation of the cheats are effective even before the game has started. So in this case I don't think the memory can be changed.
Is there any possibility of an error return if the value still doesn,'t exists in the memory ? And loop till it appears and being applied ?
I know starts to be complicated
jeff.Artik
Posted: Sun Jun 11, 2017 6:22 pm
Post subject:
Ok, So I adapted the script with your help. I have now:
Code:
shellExecute('C:\\Program Files (x86)\\Steam\\steamapps\\common\\TEKKEN 7\\TekkenGame\\Binaries\\Win64\\TekkenGame-Win64-Shipping.exe')
function myattach(timer)
if getProcessIDFromProcessName("TekkenGame-Win64-Shipping.exe") ~= nil then
object_destroy(timer)
openProcess("TekkenGame-Win64-Shipping.exe")
end
end
f=createForm(false) --create an invisible window
t=createTimer(f);
timer_setInterval(t,1000) --10 might have been too fast for xp...
timer_onTimer(t,myattach)
----------------------------------------------------------------------------------------------------
-- func: CheckValidProcess
-- desc: Ensures the process selected is our target process by its name.
----------------------------------------------------------------------------------------------------
local function CheckValidProcess(pid, name)
local procs = getProcesslist();
for k, v in pairs(procs) do
if (k == pid) then
if (tostring(v):lower() == name:lower()) then
return true;
end
end
end
return false;
end
----------------------------------------------------------------------------------------------------
-- func: onOpenProcess
-- desc: Callback invoked when a process is opened by Cheat Engine.
----------------------------------------------------------------------------------------------------
function onOpenProcess(procid)
-- Ensure the correct process is selected..
if (not CheckValidProcess(procid, 'TekkenGame-Win64-Shipping.exe')) then
error('Attached to the wrong process.');
return;
end
-- Force the open process to complete..
reinitializeSymbolhandler();
getAddressList().getMemoryRecordByDescription("Black_Bars").Active=true
getAddressList().getMemoryRecordByDescription("FOV").Active=true
end
</LuaScript>
I launch the game, and when I quit it, both boxed are checked, but it was not applied during the game. Maybe too early, I really don't know. F1 still works
atom0s
Posted: Sun Jun 11, 2017 1:10 pm
Post subject:
When Cheat Engine opens a target process, Lua has a callback function for it:
Code:
function onOpenProcess(procid)
You can use this to tell if CE is attached to your process. procid is the process id that it is attached to. You can validate the process doing something like this:
Code:
----------------------------------------------------------------------------------------------------
-- func: CheckValidProcess
-- desc: Ensures the process selected is our target process by its name.
----------------------------------------------------------------------------------------------------
local function CheckValidProcess(pid, name)
local procs = getProcesslist();
for k, v in pairs(procs) do
if (k == pid) then
if (tostring(v):lower() == name:lower()) then
return true;
end
end
end
return false;
end
----------------------------------------------------------------------------------------------------
-- func: onOpenProcess
-- desc: Callback invoked when a process is opened by Cheat Engine.
----------------------------------------------------------------------------------------------------
function onOpenProcess(procid)
-- Ensure the correct process is selected..
if (not CheckValidProcess(procid, 'YourProcessNameHere.exe')) then
error('Attached to the wrong process.');
return;
end
-- Force the open process to complete..
reinitializeSymbolhandler();
-- Do your code here..
end
At the end where I put the comment 'do your code here' is where you would want to do your personal cheat stuff for what you are doing.
jeff.artik
Posted: Sun Jun 11, 2017 5:21 am
Post subject: Loop until entry can be applied then auto close trainer
Hi! I started a little CT for TEKKEN7 that starts the game, then I press F1 and it switch to 21:9 mode. Actually this function works perfectly, but I want to improve the automate the tasks, till I reach the perfect trainer. Here is my LUA script:
Code:
<LuaScript>shellExecute('C:\\Program Files (x86)\\Steam\\steamapps\\common\\TEKKEN 7\\TekkenGame\\Binaries\\Win64\\TekkenGame-Win64-Shipping.exe')
function myattach(timer)
if getProcessIDFromProcessName("TekkenGame-Win64-Shipping.exe") ~= nil then
object_destroy(timer)
openProcess("TekkenGame-Win64-Shipping.exe")
end
end
f=createForm(false) --create an invisible window
t=createTimer(f);
timer_setInterval(t,1000) --10 might have been too fast for xp...
timer_onTimer(t,myattach)
function changevalues(timer)
getAddressList().getMemoryRecordByDescription("Black_Bars").Active=true
getAddressList().getMemoryRecordByDescription("FOV").Active=true
end
f=createForm(false) --create an invisible window
t=createTimer(f);
timer_setInterval(t,50000) --10 might have been too fast for xp...
timer_onTimer(t,changevalues)
</LuaScript>
The problem here is I need to wait the game starts to apply both values. I tried with a timer, boxes auto check at the end of the timer, but I don't know why it's not applied during the game. When I manually press F1, it works. As soon as they're applied, I don't need to use F1 anymore.
My first question is:
1. How to create a check that loop these 2 values until they can be applied?
Sometimes I stay on the TEKKEN main menu for 3minutes until I start a first game, sometimes 20 secondes.
The goal would be to loop till it's applied then stop. My second one is:
2. How to auto-close trainer when both values are applied?
I think you understood, I would love to get the perfect trainer that:
- Launch the game
- Auto apply values when i start the game (timing is always differ)
- Close the trainer when values are applied, like this no need to do it manually each time I quit TEKKEN.
Many thanks for your help
Powered by
phpBB
© 2001, 2005 phpBB Group
CE Wiki
IRC (#CEF)
Twitter
Third party websites