Page 1 of 1

[HELP]Lua Help

Posted: Tue Jun 02, 2020 5:59 am
by Wjb1001
Within a game I have the player coordinate which are a float value, but I want to display those coordinates constantly on a cheat engine table. So is it possible to move that float value into a label constantly using a timer? And if so, how?

[HELP]Lua Help

Posted: Tue Jun 02, 2020 7:33 pm
by Dread_Pony_Roberts
You don't need lua for this, you can make a pointer to the address and cheat engine will handle the rest.

[HELP]Lua Help

Posted: Tue Jun 02, 2020 10:35 pm
by Wjb1001
I already scripted the pointers and have them, but I want to be able to display them on a cheat table constantly. So that I can see the coordinates on the same table that all the cheat toggle buttons are on.

[HELP]Lua Help

Posted: Tue Jun 02, 2020 10:58 pm
by Dread_Pony_Roberts
You mean like this?



[IMG]https://i.stack.imgur.com/UoxPC.png[/IMG]

[HELP]Lua Help

Posted: Tue Jun 02, 2020 11:20 pm
by TimFun13
I think the mean on a trainer.



Cheat table is not the same as a trainer. And you'd be better off actually posting some of the code you have so far.



But here's some links to the CE wiki.

[URL unfurl="true"]https://wiki.cheatengine.org/index.php?title=Lua:Class:Timer[/URL]

[URL unfurl="true"]https://wiki.cheatengine.org/index.php?title=Lua:Class:Label[/URL]

[HELP]Lua Help

Posted: Wed Jun 03, 2020 12:20 am
by Wjb1001
Okay so I have these labels: CETrainer_1_CELabel13, CETrainer_1_CELabel14, and CETrainer_1_CELabel15.



What I'm trying to do is to have these labels display what each of the following pointer values are on a trainer.



The player Z cord pointer is [pPlayer44]+DC

The player X cord pointer is [pPlayer4]+0D8

The player Y cord pointer is [pPlayer42]+E0

[HELP]Lua Help

Posted: Wed Jun 03, 2020 2:47 am
by GreenHouse
Change the names accordingly, I don't know if those are correct, as they're just called CELabel and pPlayer.

[CODE=lua]if tmer == nil then

tmer = createTimer(nil, false)

end



tmer.OnTimer = function(tmer)

CETrainer1.CELabel13.Caption=readFloat("[pPlayer44]+DC")

CETrainer1.CELabel14.Caption=readFloat("[pPlayer4]+0D8")

CETrainer1.CELabel15.Caption=readFloat("[pPlayer42]+E0")

end



tmer.Interval = 100

tmer.Enabled = true[/CODE]

[HELP]Lua Help

Posted: Wed Jun 03, 2020 3:29 am
by Wjb1001
Thank you! That works. I appreciate the help.