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 


Activating CETrainer via LUA

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

Joined: 06 Dec 2020
Posts: 5

PostPosted: Fri Feb 12, 2021 8:41 am    Post subject: Activating CETrainer via LUA Reply with quote

Hello i need help in activating trainer via lua

here is the code that i wrote and some code that are generated by CE
Code:

loadPlugin(getCheatEngineDir() .. "plugins\\umstealthedit-x86_64")

function checkActive()
  addresslist=getAddressList()
  memrec87962=addresslist.getMemoryRecordByID(87962)
  if memrec87962.Active == true then
     CETrainer_CELabel1.Caption = "Activated"
     CETrainer_CELabel2.Caption = readFloat("[set_teleport]+3b0")
     CETrainer_CELabel3.Caption = readFloat("[set_teleport]+3b4")
  else
     CETrainer_CELabel1.Caption = "Deactivated"
     CETrainer_CELabel2.Caption = "nil"
     CETrainer_CELabel3.Caption = "nil"
  end
end
function active()
  addresslist=getAddressList()
  memrec87962=addresslist.getMemoryRecordByID(87962)
  memrec87962.Active = true
end
function deactive()
  addresslist=getAddressList()
  memrec87962=addresslist.getMemoryRecordByID(87962)
  memrec87962.Active = false
end
createHotkey(active, VK_HOME)
createHotkey(deactive, VK_END)
createHotkey(checkActive, VK_INSERT)

--TRAINERGENERATORSTART--
--This is autogenerated code. Changing code in this block will
--get erased and rewritten if you regenerate the trainer code

--Uncomment the following line if this is a Cheat Table format trainer and you don't want CE to show (Tip, save as .CETRAINER alternatively)
--hideAllCEWindows()

RequiredCEVersion=7.2
if (getCEVersion==nil) or (getCEVersion()<RequiredCEVersion) then
  messageDialog('Please install Wkwkw Impact '..RequiredCEVersion, mtError, mbOK)
  closeCE()
end
addresslist=getAddressList()


CETrainer.SEPERATOR.Visible=false

getAutoAttachList().add("GenshinImpact.exe")
gPlaySoundOnAction=false
CETrainer.show()
function AboutClick()
  showMessage(gAboutText)
end
gAboutText=[[]]

function CloseClick()
  --called by the close button onClick event, and when closing the form
  closeCE()
  return caFree --onClick doesn't care, but onClose would like a result
end

--TRAINERGENERATORSTOP--


The checkActive function is working, but the trainer can't activate after pressing the hotkey.
And i can activate/deactivate this memrec in CE Main Form.
Thank you in advance
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