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 


how to change value using button [LUA]

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

Joined: 13 Feb 2022
Posts: 3

PostPosted: Sun Feb 13, 2022 10:26 pm    Post subject: how to change value using button [LUA] Reply with quote

Hello! I just want to know how to make a assign button from exact address to write values.
I know this is very simple but since i dont have any knowledge in LUA so im stuck Sad
I tried to write this
Code:
writeBytes("[02E147EC]", Value)


but always not working. I hope someone can help me to fix this.



here.png
 Description:
 Filesize:  169.72 KB
 Viewed:  4407 Time(s)

here.png


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

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

PostPosted: Mon Feb 14, 2022 5:26 am    Post subject: Reply with quote

You will want this, which writes a 32-bit value to the address specified:
Code:

writeInteger(0x02E147EC, Value)


It should be noted that when you encapsulate an address with square brackets, you're telling Cheat Engine that the value held at the address, is the address you want to read. Which it isn't in this case.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Mon Feb 14, 2022 5:36 am    Post subject: Reply with quote

copy the address to clipboard and then paste in notepad or some other text editor.
Find the id of the record

then use
Code:

AddressList.getMemoryRecordByID(idyoufound).Value=Value


Also, you say you have no knowledge of Lua in CE so I'm assuming you've also got no clue on how to read out the value from the edit

Code:

Value=CETrainer.CEEdit1.Text


you can even do:
Code:

AddressList.getMemoryRecordByID(idyoufound).Value=CETrainer.CEEdit1.Text

_________________
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
citerindo
How do I cheat?
Reputation: 0

Joined: 13 Feb 2022
Posts: 3

PostPosted: Tue Feb 15, 2022 5:01 am    Post subject: Reply with quote

Thank you DarkByte for your replies, but all codes is not working.


and for LeFiXER, your codes is working good but for specific values, but not working for label because.
Code:
writeInteger(0x02E147EC, Value)


can someone help me to make it working from label to button Sad



here2.png
 Description:
 Filesize:  90.27 KB
 Viewed:  4337 Time(s)

here2.png


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

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

PostPosted: Tue Feb 15, 2022 6:51 am    Post subject: Reply with quote

Try this:
Code:

function CETrainer_ChangeClick(sender)
  local value = tonumber(CETrainer.TCEEdit.Text)
  if value ~= nil then
      writeInteger(0x2E147EC, value)
  else
      CETrainer.TCEEdit.Text = 'Please enter a value'
  end
end
Back to top
View user's profile Send private message
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 510

PostPosted: Tue Feb 15, 2022 9:57 am    Post subject: Reply with quote

when you edit the form,button won't click,just close form editor and test it
and changing integer from TCELabel is impossible since its a string value
You can take value from TCEEdit only (variations of string and number)
You are asking to write string into integer
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