View previous topic :: View next topic |
Author |
Message |
Razi Expert Cheater Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Tue Mar 07, 2023 4:31 pm Post subject: How to change background color of Cheat Table Lua Script? |
|
|
Is it possible to change background color of Cheat Table Lua Script and Lua Engine?
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1065 Location: 0x90
|
Posted: Wed Mar 08, 2023 12:32 am Post subject: |
|
|
You can do it like this:
Code: |
local colour = 0x333333 -- 0xBBGGRR format
AddressList.Component[0].Color = colour
|
Older versions may require attaining the addresslist object:
Code: |
local colour = 0x333333 -- 0xBBGGRR format
local addresslist = getAddressList()
addresslist.Component[0].Color = colour
|
|
|
Back to top |
|
|
Razi Expert Cheater Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Wed Mar 08, 2023 5:54 am Post subject: |
|
|
LeFiXER wrote: | You can do it like this: |
Thanks, but I need to change color of Cheat Table Lua Script and Lua Engine.
Found that Lua Engine color can be changed like this:
Code: | getLuaEngine().Component[1].Color =0xffff00
getLuaEngine().Component[11].Color =0xffff00 |
But the main question of the topic still remains. About how to change background color of Lua Script Cheat Table.
This code doesn't work: Code: | MainForm.frmLuaTableScript.Component[0].Color =0xfff000 |
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1065 Location: 0x90
|
Posted: Wed Mar 08, 2023 10:14 am Post subject: |
|
|
My apologies, this will do what you want.
Code: |
-- Set colour here
local colour = 0x333333
function forEachAndFutureForm(classname, func)
local i
for i = 0,getFormCount() - 1 do
local f = getForm(i)
if f.ClassName == classname then
func(f)
end
end
registerFormAddNotification(function(f)
if classname == f.ClassName then
f.registerFirstShowCallback(function()
func(f)
end)
end
end)
end
forEachAndFutureForm('TfrmAutoInject', function(f)
f.Assemblescreen.Color = colour
end)
getLuaEngine().mScript.Color = colour
|
Note: the Cheat Table Lua Script and the Auto Assembler window is a shared form so it will affect both windows. You can save this as a Lua file and place it in the autorun directory within the Cheat Engine installation folder.
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 34
Joined: 16 Feb 2017 Posts: 1432
|
Posted: Wed Mar 08, 2023 10:26 am Post subject: |
|
|
Code: | if f1 then f1.Destroy() end
f1 = createForm()
f1.Position = 'poScreenCenter'
f1.Caption = 'Color Tester'
clrbox = createTrackBar(f1)
clrbox.Width = f1.Width - 20
clrbox.Left,clrbox.Top = 10,50
clrbox.Max = 1000
clrbox.Min = 0
edt1 = createEdit(f1)
edt1.Width = f1.Width - 200
edt1.Left,edt1.Top = 100,100
edt1.Font.Size = 14
clrbox.OnChange=function()
pst = clrbox.Position
if pst==0 then
MainForm.frmAutoInject.Assemblescreen.color = 0x000000
elseif pst==1000 then
MainForm.frmAutoInject.Assemblescreen.color = 0xFFFFFF
else
MainForm.frmAutoInject.Assemblescreen.color = pst * 1200
end
edt1.Text = MainForm.frmAutoInject.Assemblescreen.color
end |
_________________
|
|
Back to top |
|
|
Razi Expert Cheater Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Wed Mar 08, 2023 12:55 pm Post subject: |
|
|
LeFiXER wrote: | My apologies, this will do what you want. |
Thanks
Quote: | Note: the Cheat Table Lua Script and the Auto Assembler window is a shared form so it will affect both windows. You can save this as a Lua file and place it in the autorun directory within the Cheat Engine installation folder. |
We can change the colors in these windows independently of each other:
Code: |
frmLuaTableScript = getMainForm().frmAutoInject
frmLuaTableScript.Assemblescreen.Color =0xA7A7A7
frmA = getMemoryViewForm().frmAutoInject_1
frmA.Assemblescreen.Color =0xA7A7A7
|
AylinCE wrote: | Code: | MainForm.frmAutoInject.Assemblescreen.color = 0x000000
|
|
This is what I needed, thanks.
It's also interesting to know how to change the color in the Auto Assembler script window.
The color can be changed like this:
Code: | frmA = getMemoryViewForm().frmAutoInject_1
frmA.Assemblescreen.Color =0xA7A7A7 |
But for some reason this code doesn't work:
Code: | MainForm.MemoryBrowser.frmAutoInject_1.Color = 0xA7A7A7 | Can you help with this?
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 34
Joined: 16 Feb 2017 Posts: 1432
|
Posted: Wed Mar 08, 2023 4:07 pm Post subject: |
|
|
It has a color designation. Because it does not display the new color. Maybe a timer fixes the color.
Or the DB may have an explanation.
Here are some examples;
Code: | dis1 = getMemoryViewForm().DisassemblerView
hex1 = getMemoryViewForm().HexadecimalView
dis1.Color = 0x00ff00
hex1.Color = 0x1111ff
print("1 - " .. dis1.color)
print("2 - " .. hex1.Color)
--for i = 0, dis1.ComponentCount - 1 do
-- dis1.Component[i].Color = 11200 * i
-- print(dis1.Component[i].Color)
--end
print(dis1.SelectedAddress)
dis1.BackgroundColor = 0xffff00
hex1.BackgroundColor = 0x2200ff
print("3 - "..dis1.BackgroundColor)
print("4 - "..hex1.BackgroundColor)
--GetAddressList().Control[0].BackgroundColor=0xffff00 |
_________________
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1065 Location: 0x90
|
Posted: Thu Mar 09, 2023 5:38 am Post subject: |
|
|
Razi wrote: |
But for some reason this code doesn't work:
Code: | MainForm.MemoryBrowser.frmAutoInject_1.Color = 0xA7A7A7 | Can you help with this? |
This is because MemoryBrowser is not an object of MainForm, nor is frmAutoInject_1 an object of Memory Browser.
|
|
Back to top |
|
|
Razi Expert Cheater Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Thu Mar 09, 2023 10:38 am Post subject: |
|
|
LeFiXER wrote: | This is because MemoryBrowser is not an object of MainForm, nor is frmAutoInject_1 an object of Memory Browser. |
This is what I want to find out. How to call "frmAutoInject_1" referring to the correct objects.
Does anyone know how to call MemoryView Form in Lazarus? Can't find this Form.
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 34
Joined: 16 Feb 2017 Posts: 1432
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1065 Location: 0x90
|
Posted: Thu Mar 09, 2023 11:58 am Post subject: |
|
|
Razi wrote: | This is what I want to find out. How to call "frmAutoInject_1" referring to the correct objects.
Does anyone know how to call MemoryView Form in Lazarus? Can't find this Form. |
If by call you mean, open the memory viewer window via Lua alone. You can do this:
Code: |
-- This creates a reference for you
local memoryView = getMemoryViewForm()
memoryView.Show()
-- Or you can simply do it like this without the reference
getMemoryViewForm().Show()
|
|
|
Back to top |
|
|
Razi Expert Cheater Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Thu Mar 09, 2023 12:10 pm Post subject: |
|
|
@LeFiXER, @AylinCE: Thanks for answers.
|
|
Back to top |
|
|
|