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 


Automatic assembly production trainer reading and writing

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

Joined: 16 Feb 2017
Posts: 1516

PostPosted: Thu Aug 03, 2023 4:11 am    Post subject: Reply with quote

Please keep asking and explaining if I misunderstood the situation.

To import (Read) or change the record values in the address list into the Trainer, use:

Code:
getMemRecByDesc = getAddressList().getMemoryRecordByDescription

local sunlight = getMemRecByDesc("sunlight")
local magic = getMemRecByDesc("magic")

-- Print the values in the boxes.
--I'm assuming the button named "CEButton1" is. caption: data fetch
--(If not, correct the name)

CETrainer.CEButton1.OnClick=function()
processname="your game.exe"  -- sample: "chrome.exe"
check=getProcessIDFromProcessName(processname)
 if check==nil then
  print("Game not found!")
 else
  openProcess(processname)
  if sunlight~=nil or magic~=nil then
   CETrainer.CEEdit1.Text = sunlight.Value
   CETrainer.CEEdit2.Text = magic.Value
  else
   showMessage("Address records missing or incorrect!")
  end
 end
end

--Print the values in the box to the addresses:
--I'm assuming the button named "CEButton2" is. caption: modify
--(If not, correct the name)

CETrainer.CEButton2.OnClick=function()
 if sunlight~=nil or magic~=nil then
   sunlight.Value = CETrainer.CEEdit1.Text
   magic.Value = CETrainer.CEEdit2.Text
 else
   showMessage("Address records missing or incorrect!")
 end
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
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1516

PostPosted: Thu Aug 03, 2023 9:01 am    Post subject: Reply with quote

You have to make sure you match the button and edit names.
Are these true;
CETrainer.CEButton1
CETrainer.CEEdit1

You should also check the group and child names. There should not be entries with the same name.
Group name: yangguang, child name: not like yangguang.
Group name: yangguang1, child name: yangguang, that's better.

yangguang1
---> yangguang
---> mofa

Code:
list = getAddressList()

local sunlight = list.getMemoryRecordByDescription("yangguang")
local magic = list.getMemoryRecordByDescription("mofa")

-- Print the values in the boxes.
--I'm assuming the button named "CETrainer..CEButton1" is. caption: data fetch
--(If not, correct the name)

CETrainer.CEButton1.OnClick=function()
processname="your game.exe"  -- sample: "chrome.exe"
check=getProcessIDFromProcessName(processname)
 if check==nil then
  print("Game not found!")
 else
  openProcess(processname)
  if sunlight~=nil or magic~=nil then
   CETrainer.CEEdit1.Text = sunlight.Value
   CETrainer.CEEdit2.Text = magic.Value
  else
   showMessage("Address records missing or incorrect!")
  end
 end
end

--Print the values in the box to the addresses:
--I'm assuming the button named "CETrainer..CEButton2" is. caption: modify
--(If not, correct the name)

CETrainer.CEButton2.OnClick=function()
 if sunlight~=nil or magic~=nil then
   sunlight.Value = CETrainer.CEEdit1.Text
   magic.Value = CETrainer.CEEdit2.Text
 else
   showMessage("Address records missing or incorrect!")
 end
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
tuzi521
How do I cheat?
Reputation: 0

Joined: 16 Dec 2020
Posts: 1

PostPosted: Thu Aug 03, 2023 11:48 am    Post subject: Reply with quote

Thanks to you, I managed to (read) (write)
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