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 


En/disable script and set address freeze status with script

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

Joined: 02 Aug 2021
Posts: 2

PostPosted: Mon Aug 02, 2021 8:31 am    Post subject: En/disable script and set address freeze status with script Reply with quote

I have a cheat table with Lua scripts and was wondering if there was a way I could enable or disable these scripts with another script to create defaults and profiles which quickly set and freeze values and enable scripts while still allowing me to manually go through and hand pick what I want.
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

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

PostPosted: Mon Aug 02, 2021 9:12 am    Post subject: Reply with quote

Code:

function toggleScript(x)
   if x ~= nil then
      x.Active = not x.Active
      if x.Active == true then
         x.Color = 0x00AA00
      else
         x.Color = 0x0000AA
      end
   end
end

function getMemRec(s)
   local al = getAddressList()
   local s = al.getMemoryRecordByDescription(s)
   if s ~= nil then
      return s
   else
      error(showMessage("Couldn't find the script :("))
   end
end

toggleScript(getMemRec('Address Description here'))


Usage:
In the [ENABLE]/[DISABLE] section of your script call
Code:

toggleScript(getMemRec('Address Description here'))
Back to top
View user's profile Send private message
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Mon Aug 02, 2021 9:18 am    Post subject: Reply with quote

1) Enable asm code and codes in Lua Script:

Code:
function onHack1()
script1 = [[
//you code
]]

script2 = [[
//you code
]]

autoAssemble(script1,true)
autoAssemble(script2,true)
end

function allOnHack()
onHack1()
--onHack2()
--onHack3()
end


or Lua Script onHack AddressList;

Code:
local activeIndx=0

function onHack1()
hack1=getAddressList().getMemoryRecordByDescription("YouHackDesc")
hack2=getAddressList().getMemoryRecordByDescription("YouHackDesc")
if activeIndx==0 then
hack1.Active=true
hack2.Active=true
--print(activeIndx)
activeIndx=1
else
hack1.Active=false
hack2.Active=false
--print(activeIndx)
activeIndx=0
end
end


To activate and deactivate all commands in the Address List;
Right click on the Address List and create a group and collect all addresses into that group.
Of course, right-click on the group name and choose what it should do.
Back to top
View user's profile Send private message
EcoRacer
How do I cheat?
Reputation: 0

Joined: 02 Aug 2021
Posts: 2

PostPosted: Mon Aug 02, 2021 7:38 pm    Post subject: Reply with quote

Thank you, this really helps
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