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 


Auto turn off Cheat Record after process exit.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
mrgorungo
Newbie cheater
Reputation: 0

Joined: 20 May 2019
Posts: 12

PostPosted: Mon Aug 24, 2020 4:34 am    Post subject: Auto turn off Cheat Record after process exit. Reply with quote

what i want to do:
1,auto enable cheat record when CE attached to game process.

2,keep cheat record activated while process lasts.

3,auto deactivate cheat record if process dead.

but it dosent properly turn cheat off when the process exits.


my lua code:
Code:

function onOpenProcess()
  local timer = createTimer(nil, false)
  timer.Interval = 100
  timer.OnTimer = function(timer)
    local list = getAddressList()
    local mem = list.getMemoryRecordByDescription("AlwaysOn")

    if process ~= nil and readInteger(process) ~= nil then
       mem.Active = true

//if process dead deactivate cheat and destroy timer loop

    elseif readInteger(process) == nil then
        mem.Avtive = false
        timer.destroy()
    end
  end
  timer.Enabled = true
end


Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Mon Aug 24, 2020 7:06 am    Post subject: Reply with quote

I am imagine something like this.

Code:
function onOpenProcess(process)
  if timer then timer.destroy() end
  local timer = createTimer(nil, false)
  timer.Interval = 100
  timer.OnTimer = function(timer)
    --local list = getAddressList()
    --local mem = list.getMemoryRecordByDescription("AlwaysOn")
    process = 'notepad.exe'
    if process ~= nil and readInteger(process) ~= nil then
       --mem.Active = true
       print('Cheat is on but dont know how to stop it')

--if process dead deactivate cheat and destroy timer loop

    elseif readInteger(process) == nil then
        --mem.Avtive = false
        timer.Enabled = false
       print('Ouh shit. I got the cheat is off')
    end
  end
  timer.Enabled = true
end

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
mrgorungo
Newbie cheater
Reputation: 0

Joined: 20 May 2019
Posts: 12

PostPosted: Mon Aug 24, 2020 7:56 am    Post subject: Reply with quote

Corroder wrote:
I am imagine something like this.

Code:
function onOpenProcess(process)
  if timer then timer.destroy() end
  local timer = createTimer(nil, false)
  timer.Interval = 100
  timer.OnTimer = function(timer)
    --local list = getAddressList()
    --local mem = list.getMemoryRecordByDescription("AlwaysOn")
    process = 'notepad.exe'
    if process ~= nil and readInteger(process) ~= nil then
       --mem.Active = true
       print('Cheat is on but dont know how to stop it')

--if process dead deactivate cheat and destroy timer loop

    elseif readInteger(process) == nil then
        --mem.Avtive = false
        timer.Enabled = false
       print('Ouh shit. I got the cheat is off')
    end
  end
  timer.Enabled = true
end


thanks for reply.
it did work if it is print
but not work with mem.acitve = false
it still dosent turn cheat off when process exit
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Mon Aug 24, 2020 8:49 am    Post subject: Reply with quote

Code:
function onOpenProcess(process)

  if timer then timer.destroy() end

  local timer = createTimer(nil, false)
  timer.Interval = 100

  timer.OnTimer = function(timer)
    local list = getAddressList()
    local mem = list.getMemoryRecordByDescription("AlwaysOn")

    if process ~= nil and readInteger(process) ~= nil then
       mem.Active = true
    elseif readInteger(process) == nil then
        AddressList.disableAllWithoutExecute()
        mem.Active = false
        timer.Enabled = false
    end
  end
  timer.Enabled = true
end

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
mrgorungo
Newbie cheater
Reputation: 0

Joined: 20 May 2019
Posts: 12

PostPosted: Mon Aug 24, 2020 10:14 am    Post subject: Reply with quote

Corroder wrote:
Code:
function onOpenProcess(process)

  if timer then timer.destroy() end

  local timer = createTimer(nil, false)
  timer.Interval = 100

  timer.OnTimer = function(timer)
    local list = getAddressList()
    local mem = list.getMemoryRecordByDescription("AlwaysOn")

    if process ~= nil and readInteger(process) ~= nil then
       mem.Active = true
    elseif readInteger(process) == nil then
        AddressList.disableAllWithoutExecute()
        mem.Active = false
        timer.Enabled = false
    end
  end
  timer.Enabled = true
end


that is exactly what I did..
not working.


I think after process die lua cannot untick cheat record(auto asembler script) because CE cannot access to the address in the [disable] part .

[disable] << never excuted?
00xxxxxx:
blablalb
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25785
Location: The netherlands

PostPosted: Mon Aug 24, 2020 11:01 am    Post subject: Reply with quote

AddressList.disableAllWithoutExecute()
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Mon Aug 24, 2020 3:14 pm    Post subject: Reply with quote

I have added 'AddressList.disableAllWithoutExecute()' on the last script before DB suggestion. Don't know he has tried or not and the problem persist or not.

BTW, this is the script from old topic, about auto deactivating cheat table.

Code:
cecheck_list = createStringlist()

function gamecheck()

 status = readInteger(process_name)
 getProcesslist(cecheck_list)
 local count = 0

 for i=0,cecheck_list.count-1 do
  if cecheck_list[i]:find(process_name) then
  count = count + 1
  end
 end

 if count < 1 and status == nil then
 ----------------------------------------------------- deactivated hack here
 AddressList.disableAllWithoutExecute()

 CETrainer.CHEAT3.Activated=false
 CETrainer.CHEAT2.Activated=false
 CETrainer.CHEAT1.Activated=false
 CETrainer.CHEAT0.Activated=false
 CETrainer.CELabel3.Caption = "Lunch GAME..."
 CETrainer.CELabel3.Font.Color = 0xFF00FF
 check_t = false
 elseif count < 1 and status ~= nil then
 ----------------------------------------------------- deactivated hack here
 AddressList.disableAllWithoutExecute()
 CETrainer.CHEAT3.Activated=false
 CETrainer.CHEAT2.Activated=false
 CETrainer.CHEAT1.Activated=false
 CETrainer.CHEAT0.Activated=false
 else
 ----------------------------------------------------- activated hack here
 end
 cecheck_list.clear()
end


check_t=createTimer(nil)
timer_onTimer(check_t, gamecheck)
timer_setInterval(check_t, 500)
timer_setEnabled(check_t, true)



See : https://forum.cheatengine.org/viewtopic.php?p=5746915&sid=ba156e9370025da5600703924a8929ed

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
mrgorungo
Newbie cheater
Reputation: 0

Joined: 20 May 2019
Posts: 12

PostPosted: Mon Aug 24, 2020 6:21 pm    Post subject: Re: Auto turn off Cheat Record after process exit. Reply with quote

My bad

it actually worked!!!!!!!!!!

thankyou alot!
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 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