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 


more script descriptions?

 
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: 32

Joined: 16 Feb 2017
Posts: 1259

PostPosted: Wed Apr 06, 2022 5:13 pm    Post subject: Reply with quote

Code:
local list = getAddressList()

function onOpenProcess()
    local mem1 = list.getMemoryRecordByDescription("Script Name (Description)1")
    local mem2 = list.getMemoryRecordByDescription("Script Name (Description)2")
    local mem3 = list.getMemoryRecordByDescription("Script Name (Description)3")
    mem1.Active = true
    mem2.Active = true
    mem3.Active = true
end


-- or

Code:
local list = getAddressList()

function onOpenProcess1()
    local mem1 = list.getMemoryRecordByDescription("Script Name (Description)1")
    mem1.Active = true
end

function onOpenProcess2()
    local mem2 = list.getMemoryRecordByDescription("Script Name (Description)2")
    mem2.Active = true
end

local index=0

function onOpenProcessStart()
  local timer = createTimer(nil, false)
  timer.Interval = 500
  timer.OnTimer = function(timer)
   index=tonumber(index) + 1
    if index==2 then onOpenProcess1() end
    if index==4 then onOpenProcess2() end
    if index==6 then timer.Enabled = false index=0 end
    --timer.Destroy()
  end
  timer.Enabled = true
end

_________________
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
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Wed Apr 06, 2022 6:03 pm    Post subject: Reply with quote

You can also do this:
Code:


function activateScript(description)
  local mr = AddressList.getMemoryRecordByDesciprition(description)
  if mr ~= nil then
    mr.Active = true
  end
end

function onOpenProcess()
  local timer = createTimer(nil, false)
  timer.Interval = 500
  timer.OnTimer = function(timer)
    activateScript('script 1')
    activateScript('script 2')
    timer.Destroy()
  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: 1667

PostPosted: Fri Apr 08, 2022 12:57 am    Post subject: Reply with quote

Where is the first topic ?. Sold Out ?? Shocked
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1259

PostPosted: Fri Apr 08, 2022 1:05 am    Post subject: Reply with quote

Corroder wrote:
Where is the first topic ?. Sold Out ?? Shocked


Smile

https://forum.cheatengine.org/viewtopic.php?t=619298

_________________
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