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 


help generate trainer lua +10 process id

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
anglez
How do I cheat?
Reputation: 0

Joined: 15 Oct 2021
Posts: 2
Location: peru

PostPosted: Sat Nov 06, 2021 11:31 pm    Post subject: help generate trainer lua +10 process id Reply with quote

I can only select manually by testing but when I generate trainer it does not work because it grabs another process

help. !!!!!



kelokeee.jpg
 Description:
 Filesize:  147.95 KB
 Viewed:  1866 Time(s)

kelokeee.jpg



_________________
iselth
Back to top
View user's profile Send private message
anglez
How do I cheat?
Reputation: 0

Joined: 15 Oct 2021
Posts: 2
Location: peru

PostPosted: Mon Nov 08, 2021 1:55 pm    Post subject: Re: help generate trainer lua +10 process id Reply with quote

anglez wrote:
I can only select manually by testing but when I generate trainer it does not work because it grabs another process

help. !!!!!




helpppppppppppppppppppppp ???

_________________
iselth
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Mon Nov 08, 2021 2:38 pm    Post subject: Reply with quote

can probably be done with lua (i don't know any and can't be bothered)
_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3325

PostPosted: Tue Nov 09, 2021 5:49 am    Post subject: Re: help generate trainer lua +10 process id Reply with quote

anglez wrote:
I can only select manually by testing but when I generate trainer it does not work because it grabs another process

You need to write an auto-attach script that picks the right process.
Nobody except you knows how you are going to identify the right process though.
One way to go on about this would be using the image size, or, if that does not work, use signatures.
Once you have the logic in place, put that on a timer and check every 3-5 seconds that your PID is still valid, if not, destroy context and try to re-attach to the right process again.

Here's a template I use in my tables, this checks only the process name (you need to create your own process check routine):
Code:
PROCESS_NAME = 'BlaBlaBla.exe'
--------
-------- Check for process and auto attach if need be
--------
local autoAttachTimer = nil          ---- Declaration for our static timer object (no destroy here!)
local autoAttachTimerInterval = 5000 ---- Timer in milliseconds

function clearUserDefinedSymbols()
   local mv,sf = getMemoryViewForm()
   if not mv.frmSymbolhandler then
      local mvHidden
      if not mv.Visible then mvHidden=true,mv.Show() end
      mv.miuserdefinedsymbols:OnClick()
      if mvHidden then mv.hide()end
      sf = mv.frmSymbolhandler
      sf.Hide()
   else
      sf = mv.frmSymbolhandler
   end
   if sf ~= nil then
      local symbol
      for i = sf.Listview1.Items.Count - 1, 0, -1 do
         symbol = sf.Listview1.Items.Item[i].Caption
         unregisterSymbol(symbol)
      end
   end
end

local function autoAttachTimer_tick(timer) ---- Timer callback
   ---- Check to see if we are attached to the right process
   if getProcessIDFromProcessName(PROCESS_NAME) ~= getOpenedProcessID() then
      ---- If not the right process, check if process is running and attach if exists
      AddressList.disableAllWithoutExecute()
      clearUserDefinedSymbols()
      if getProcessIDFromProcessName(PROCESS_NAME) ~= nil then
         openProcess(PROCESS_NAME) ---- Open the process
      end
   end
end

autoAttachTimer = createTimer(getMainForm())       ---- Create timer with the main form as it's parent
autoAttachTimer.Interval = autoAttachTimerInterval ---- Set timer interval
autoAttachTimer.OnTimer = autoAttachTimer_tick     ---- Set timer tick call back
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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