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 


Lua | Combo box changes my 16 Array of bytes

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
dario3star
Newbie cheater
Reputation: 0

Joined: 14 Dec 2020
Posts: 23

PostPosted: Thu Oct 14, 2021 4:35 am    Post subject: Lua | Combo box changes my 16 Array of bytes Reply with quote

Hello. This combo box i never touched it before, now i can use it for some reason. But how to change my cheat table's value using combo box?

16 array of bytes : FF 00 00 00 FF 00 00 00 FF 00 00 00 FF 00 00 00
Selections:
-OFF
-Slight
-Half
-Full

If i select Slight, it should change the value to AA AA AA AA between 5th to 8th array of byte only. If i select Full, it should change the value to AA AA AA AA between 13th to 16th array of bytes only.
Last, if i select Off, all value will set to default FF 00 00 00 FF 00 00 00 FF 00 00 00 FF 00 00 00

Thank you so much!
Will hit rep! Smile



combo box change value.JPG
 Description:
 Filesize:  45.64 KB
 Viewed:  1874 Time(s)

combo box change value.JPG


Back to top
View user's profile Send private message AIM Address
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Thu Oct 14, 2021 1:11 pm    Post subject: Reply with quote

Code:
UDF1.CEComboBox1.OnChange=function()
  index = combobox_getItemIndex(UDF1.CEComboBox1);
 
addresslist=getAddressList()
aldesc=addresslist.getMemoryRecordByDescription("Yep")
if aldesc~=nil then
   if index == 0 then --off
aldesc.value="FF 00 00 00 FF 00 00 00 FF 00 00 00 FF 00 00 00"
end
if index == 1 then --slight
aldesc.value="FF 00 00 00 AA AA AA AA FF 00 00 00 FF 00 00 00"
end
if index == 2 then --half
aldesc.value="FF 00 00 00 FF 00 00 00 AA AA AA AA FF 00 00 00"
end
if index == 3 then --full
aldesc.value="FF 00 00 00 FF 00 00 00 FF 00 00 00 AA AA AA AA"
end
else
showMessage("'Yep' not found..Error!!")
end
end
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