View previous topic :: View next topic |
Author |
Message |
moon1 How do I cheat? Reputation: 0
Joined: 11 Apr 2022 Posts: 5
|
Posted: Thu Apr 14, 2022 1:20 am Post subject: Custom Box |
|
|
Hello,
I need help with this one. I'm fairly new to cheat engine and wanted to ask what type of box do I need to use for it to have a drop down box and choose one whenever I want to change the value of my scan. (Refer to first photo)
And if guys have a sample code for that type of boxes that I can play with that would be very helpful!
Thank you in advance.
Description: |
|
Filesize: |
1.91 KB |
Viewed: |
1423 Time(s) |
|
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
|
Posted: Thu Apr 14, 2022 11:51 am Post subject: |
|
|
This is not a tutorial, moved to Lua section.
_________________
- Retired. |
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1053 Location: 0x90
|
Posted: Thu Apr 14, 2022 12:12 pm Post subject: |
|
|
It's just called a combobox. You can set the values based on the itemindex of the combobox.
For example:
Code: |
-- Check if the form exists, if so then destroy it
if f then f.destroy(); f = nil end
-- Create a new form and assign some properties
local f = createForm(getMainForm())
f.Caption = 'Dropdown Example'
f.BorderStyle = 'bsDialog'
f.Position = 'poScreenCenter'
f.Height = 100
f.Width = 250
local combobox = createComboBox(f)
-- Width/Height of the combobox
combobox.Width = 100
combobox.Height = 30
-- Align centrally for both horizontal/vertical axes
combobox.Left = (f.Width - combobox.Width) / 2
combobox.Top = (f.Height - combobox.Height) / 2
-- Populate the combobox with some entries
for i = 0, 10 do
combobox.Items.Add('Item ' .. tostring(i))
end
-- What to do when we change the value of the combobox
combobox.OnChange = function()
f.Caption = 'Item Selected is : ' .. combobox.Items[combobox.ItemIndex]
end
|
|
|
Back to top |
|
|
moon1 How do I cheat? Reputation: 0
Joined: 11 Apr 2022 Posts: 5
|
Posted: Thu Apr 14, 2022 2:04 pm Post subject: |
|
|
Thank you for this one LeFIXER. After how many tries on switching codes from my normal buttons to this comboBox, still haven't figured it out. Can you please help me figure out on how can I combine my codes to make it applicable for a comboBox. Just an overview on how can I do it would be great. Here's my code for my normal boxes.
Code: | CETrainer.CEButton1.OnClick=function() --AOE LEVEL 1 ..
local mr1 = AddressList.getMemoryRecordByDescription('AOE')
mr1.value = 1500
CETrainer.CELabel1.caption="Level 1 AOE Active!"
end
CETrainer.CEButton2.OnClick=function() --AOE LEVEL 2.
local mr1 = AddressList.getMemoryRecordByDescription('AOE')
mr1.value = 2000
CETrainer.CELabel1.caption="Level 2 AOE Active!"
end
CETrainer.CEButton3.OnClick=function() --AOE LEVEL 3.
local mr1 = AddressList.getMemoryRecordByDescription('AOE')
mr1.value = 2500
CETrainer.CELabel1.caption="Level 3 AOE Active!"
end
CETrainer.CEButton4.OnClick=function() --AOE OFF.
local mr1 = AddressList.getMemoryRecordByDescription('AOE')
mr1.value = '43a'
CETrainer.CELabel1.caption="AOE is turned off!"
end
-- AS --
if frzTim1 then frzTim1.Destroy() frzTim1=nil end
frzTim1=createTimer(false) frzTim1.Interval=1 frzTim1.Enabled=false
local adrr1=""
local val1=0
local frzIndex=0
frzTim1.OnTimer=function()
frzIndex = tonumber(frzIndex) + 1
if frzIndex==150 then --15=1500 msec, 1.5 sec .. 150=15.000 msec, 15 sec
adrr1.Active = false
frzTim1.Enabled=false
else
adrr1.Value = val1
adrr1.Active = true
end
end
CETrainer.CEButton5.OnClick=function() --AS LEVEL 1 ..
adrr1 = AddressList.getMemoryRecordByDescription('AS')
val1 = 0.4
frzIndex=0
frzTim1.Enabled=true
CETrainer.CELabel3.caption="Level 1 AS Active!"
end
CETrainer.CEButton6.OnClick=function() --AS LEVEL 2.
adrr1 = AddressList.getMemoryRecordByDescription('AS')
val1 = 0.8
frzIndex=0
frzTim1.Enabled=true
CETrainer.CELabel3.caption="Level 2 AS Active!"
end
CETrainer.CEButton7.OnClick=function() --AS LEVEL 3.
adrr1 = AddressList.getMemoryRecordByDescription('AS')
val1 = 1
frzIndex=0
frzTim1.Enabled=true
CETrainer.CELabel3.caption="Level 3 AS Active!"
end
CETrainer.CEButton8.OnClick=function() --AS OFF.
adrr1 = AddressList.getMemoryRecordByDescription('AS')
val1 = 0.18
frzIndex=0
frzTim1.Enabled=true
CETrainer.CELabel3.caption="AS is turned off!"
end |
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 30
Joined: 16 Feb 2017 Posts: 1234
|
Posted: Thu Apr 14, 2022 2:58 pm Post subject: |
|
|
Some features have changed for use.
You can rearrange this according to your script.
Code: | -- AS --
if frzTim1 then frzTim1.Destroy() frzTim1=nil end
frzTim1=createTimer(false) frzTim1.Interval=1 frzTim1.Enabled=false
local adrr1=""
local val1=0
local frzIndex=1500
local cboxIndex=0
local cptn=""
frzTim1.OnTimer=function()
frzIndex = tonumber(frzIndex) - 1
if frzIndex==0 then
adrr1.Active = false
CETrainer.CELabel3.caption=cptn .. " >> ".. frzIndex .. " <<"
frzTim1.Enabled=false
else
adrr1.Value = val1
adrr1.Active = true
CETrainer.CELabel3.caption=cptn .. " >> ".. frzIndex .. " <<"
end
end
function asL1() --AS LEVEL 1 ..
adrr1 = AddressList.getMemoryRecordByDescription('AS')
val1 = 0.4
frzIndex=1500
frzTim1.Enabled=true
cptn="Level 1 AS Active!"
end
function asL2() --AS LEVEL 2.
adrr1 = AddressList.getMemoryRecordByDescription('AS')
val1 = 0.8
frzIndex=1500
frzTim1.Enabled=true
cptn="Level 2 AS Active!"
end
function asL3() --AS LEVEL 3.
adrr1 = AddressList.getMemoryRecordByDescription('AS')
val1 = 1
frzIndex=1500
frzTim1.Enabled=true
cptn="Level 3 AS Active!"
end
function asLOff() --AS OFF.
adrr1 = AddressList.getMemoryRecordByDescription('AS')
val1 = 0.18
frzIndex=1500
frzTim1.Enabled=true
cptn="AS is turned off!"
end
CETrainer.CEComboBox1.clear()
CETrainer.CEComboBox1.Items.Add("Level Select")
CETrainer.CEComboBox1.Items.Add("Level 1 AS")
CETrainer.CEComboBox1.Items.Add("Level 2 AS")
CETrainer.CEComboBox1.Items.Add("Level 3 AS")
CETrainer.CEComboBox1.Items.Add("Level OFF")
CETrainer.CEComboBox1.ItemIndex="0"
CETrainer.CEComboBox1.OnChange=function()
cboxIndex=CETrainer.CEComboBox1.ItemIndex
if cboxIndex==1 then asL1() end
if cboxIndex==2 then asL2() end
if cboxIndex==3 then asL3() end
if cboxIndex==4 then asLOff() end
end
CETrainer.CEButton5.OnClick=function() --AS LEVEL 1 ..
CETrainer.CEComboBox1.ItemIndex=1
CETrainer.CEComboBox1.OnChange()
end
CETrainer.CEButton6.OnClick=function() --AS LEVEL 2 ..
CETrainer.CEComboBox1.ItemIndex=2
CETrainer.CEComboBox1.OnChange()
end
CETrainer.CEButton7.OnClick=function() --AS LEVEL 3 ..
CETrainer.CEComboBox1.ItemIndex=3
CETrainer.CEComboBox1.OnChange()
end
CETrainer.CEButton8.OnClick=function() --AS LEVEL off ..
CETrainer.CEComboBox1.ItemIndex=4
CETrainer.CEComboBox1.OnChange()
end |
_________________
|
|
Back to top |
|
|
moon1 How do I cheat? Reputation: 0
Joined: 11 Apr 2022 Posts: 5
|
Posted: Fri Apr 15, 2022 5:52 am Post subject: |
|
|
I managed to play with the codes and are fully functioning now. Thank you AylineCE and LeFIXER!
|
|
Back to top |
|
|
|