Dropdown list + auto change color?

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
User avatar
MikinaneShindouda
Expert Cheater
Expert Cheater
Posts: 74
Joined: Mon Sep 25, 2017 7:30 pm
Reputation: 92

Dropdown list + auto change color?

Post by MikinaneShindouda »

I want the dropdown list to auto change color.
example: i have 0:OFF , 1:ON and 2:ERROR.
I want OFF show as black color in table value, ON show as green and ERROR show as red.
whenever the value change so do the color change.

any idea?

TimFun13
Expert Cheater
Expert Cheater
Posts: 1353
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 7

Re: Dropdown list + auto change color?

Post by TimFun13 »

You could use a timer, and check the value then change the memory records color as needed. Or you could use "OnGetDisplayValue" to set the color of the memory record.

User avatar
MikinaneShindouda
Expert Cheater
Expert Cheater
Posts: 74
Joined: Mon Sep 25, 2017 7:30 pm
Reputation: 92

Re: Dropdown list + auto change color?

Post by MikinaneShindouda »

ShyTwig16 wrote:
Sun Mar 21, 2021 1:20 pm
You could use a timer, and check the value then change the memory records color as needed. Or you could use "OnGetDisplayValue" to set the color of the memory record.
im just start cheating 2 days ago. i need a full tutorial how to do it. pls :D

TimFun13
Expert Cheater
Expert Cheater
Posts: 1353
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 7

Re: Dropdown list + auto change color?

Post by TimFun13 »


User avatar
MikinaneShindouda
Expert Cheater
Expert Cheater
Posts: 74
Joined: Mon Sep 25, 2017 7:30 pm
Reputation: 92

Re: Dropdown list + auto change color?

Post by MikinaneShindouda »

ShyTwig16 wrote:
Sun Mar 21, 2021 4:26 pm
how is this help me

predprey
Expert Cheater
Expert Cheater
Posts: 207
Joined: Thu Mar 02, 2017 8:46 pm
Reputation: 140

Re: Dropdown list + auto change color?

Post by predprey »

ShyTwig16 wrote:
Sun Mar 21, 2021 1:20 pm
You could use a timer, and check the value then change the memory records color as needed. Or you could use "OnGetDisplayValue" to set the color of the memory record.
This is plenty of help already as it is. You can refer to Lua tutorials on the main CEF forums, but the general pseudocode could:

Code: Select all

--sets function for all memrecs, but you can alternatively check for specific indexes or descriptions if you don't want that
al = getAddressList()
for i = 1, al.Count then
	al[i].OnGetDisplayValue = function(mr, value)
		if value == 0 then
			mr.Color = integer for black # i'm guessing you can specify these using hex values like so 0x00000000
		elif value == 1 then
			mr.Color = integer for green #0x00FF00
		elif value == 2 then
			mr.Color = integer for red  #0xFF0000
		end
end
Should be rather simple if you know Lua which you're probably going to find useful if you're going to be making tables or CE trainers regularly. Rather than waiting for someone to post some readily working code, CEF forums is very helpful ;)

Post Reply

Who is online

Users browsing this forum: No registered users