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 


How to put the value of the address shown in the trainer?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
doahuang
How do I cheat?
Reputation: 0

Joined: 16 Apr 2009
Posts: 9

PostPosted: Wed Jul 20, 2011 4:08 pm    Post subject: How to put the value of the address shown in the trainer? Reply with quote

I want to make a trainer that shows the value of an address in the game but don't know how to do it.

All I found in the CE trainer is to freeze or change the value, but there's no option for just "show" the value.

Can anyone help with this? Thanks.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25283
Location: The netherlands

PostPosted: Wed Jul 20, 2011 4:44 pm    Post subject: Reply with quote

use the "Design the userinterface manually" option

place a label on your form where you want to show the value.

set the name property to a name (e.g :CELabel1)

Place a timer on the form (it's invisible, but you can see it in the object inspector window at the bottom of the objectlist), select it

go to events, at the onTimer event doubleclick the button with 3 dots, and the code editor will show with the function declaration written for you

now in there (after the function line and before end) place the code: (assuming your trainerform is called CETrainer, default)
Code:

  local memrec=addresslist_getMemoryRecordByDescription(getAddressList(), "The description of your cheat entry")
  local value=memoryrecord_getValue(memrec)
  control_setCaption(CETrainer_CELabel1, value)


Make sure this code is outside of any --TRAINERGENERATORSTART-- block (before or after it)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
doahuang
How do I cheat?
Reputation: 0

Joined: 16 Apr 2009
Posts: 9

PostPosted: Wed Jul 20, 2011 5:44 pm    Post subject: Reply with quote

thx for ur reply, dark byte.

btw, how come when i generate the trainer in "exe" and save it to desktop, it becomes "CET_TRAINER.CETRAINER", a file that's not runnable.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25283
Location: The netherlands

PostPosted: Wed Jul 20, 2011 7:35 pm    Post subject: Reply with quote

that file should have been deleted automatically. Anyhow, reinstall ce if you can not run .cetrainer files
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
doahuang
How do I cheat?
Reputation: 0

Joined: 16 Apr 2009
Posts: 9

PostPosted: Wed Jul 20, 2011 8:19 pm    Post subject: Reply with quote

.cetrainer file works well, just can't generate .exe file, weirrrrd

thx again for your help, dark byte, but i do think Lua language is hard for scripting noobs like me, even there's a post for Lua manual (I know, everytime I look it up I feel dizzy)
Back to top
View user's profile Send private message
paupav
Master Cheater
Reputation: 13

Joined: 15 Apr 2011
Posts: 315
Location: P. Sherman 42, Wallaby Way, Sydney

PostPosted: Thu Jul 21, 2011 11:33 am    Post subject: Reply with quote

doahuang wrote:


(I know, everytime I look it up I feel dizzy)


Same for me :)
Back to top
View user's profile Send private message
toanhung1
Newbie cheater
Reputation: 0

Joined: 07 Apr 2012
Posts: 11

PostPosted: Sat Apr 07, 2012 12:21 pm    Post subject: Reply with quote

hi dark i need some help
i try this and it work only for static address, but never show the value for the address that have pointer and it show is ??, but i try on the static address it work just fine
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25283
Location: The netherlands

PostPosted: Sat Apr 07, 2012 12:47 pm    Post subject: Reply with quote

Does the addres in the addresslist show the correct value ?

(remove the hidece line from the script after generating the trainer and then save as a normal .ct and run that)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
toanhung1
Newbie cheater
Reputation: 0

Joined: 07 Apr 2012
Posts: 11

PostPosted: Sat Apr 07, 2012 1:50 pm    Post subject: Reply with quote

it a normal ct, and i dont have hidece function on the script ..
NVM i got it to work ..


thank dark ^_^

Actually one more question. how can you do it for multiple address to show value? i cant seem to get more then 1 Timer.. for different address

thank you
Back to top
View user's profile Send private message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Sat Apr 07, 2012 11:16 pm    Post subject: Reply with quote

toanhung1 wrote:


Actually one more question. how can you do it for multiple address to show value? i cant seem to get more then 1 Timer.. for different address



Please elaborate. I didn't understand what you are trying to say.
Do you want multiple labels to show multiple addresses?

_________________
Back to top
View user's profile Send private message Send e-mail
toanhung1
Newbie cheater
Reputation: 0

Joined: 07 Apr 2012
Posts: 11

PostPosted: Sun Apr 08, 2012 12:30 am    Post subject: Reply with quote

yes that exactly what i want to do. i try some like this but it only show value on one lablel

function CETimer1Timer(sender)
local memrec=addresslist_getMemoryRecordByDescription(getAddressList(), "value1")
local value=memoryrecord_getValue(memrec)
control_setCaption(CETrainer_CELabel1, value)
end

function CETimer1Timer(sender)
local memrec=addresslist_getMemoryRecordByDescription(getAddressList(), "value2")
local value=memoryrecord_getValue(memrec)
control_setCaption(CETrainer_CELabel2, value)
end

and i couldnt seem to create another CETimer

thank for any help
Back to top
View user's profile Send private message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Sun Apr 08, 2012 12:53 am    Post subject: Reply with quote

Code:
openProcess([[processnamehere]])  --put process name here

addresslist = getAddressList()

myform = createForm()

description1= [[Description of memoryrecord1]]   -- put description of memory record 1 here
local memrec1=addresslist_getMemoryRecordByDescription(addresslist, description1)
local value1=memoryrecord_getValue(memrec1)
label1 = createLabel(myform)
control_setPosition(label1, 10,10)
control_setCaption(label1, value1)

description1= [[Description of memoryrecord2]]   -- put description of memory record 2 here
local memrec2=addresslist_getMemoryRecordByDescription(addresslist, description2)
local value2=memoryrecord_getValue(memrec2)
label2 = createLabel(myform)
control_setPosition(label2, 10,30)
control_setCaption(label2, value2)


copy paste this code in
Table-> Show Cheat table lua script.
And modify description and processname and execute.

Is this what you want?

_________________
Back to top
View user's profile Send private message Send e-mail
toanhung1
Newbie cheater
Reputation: 0

Joined: 07 Apr 2012
Posts: 11

PostPosted: Sun Apr 08, 2012 1:49 am    Post subject: Reply with quote

yes sir , that exactly what i need. add it in to the rest of the script and modify a little bit bam everything good


thank you Freiza
Back to top
View user's profile Send private message
toanhung1
Newbie cheater
Reputation: 0

Joined: 07 Apr 2012
Posts: 11

PostPosted: Mon Apr 09, 2012 3:38 pm    Post subject: Reply with quote

btw that script doesnt do realtime value changing.. but darkbytes script does change the display value whenever the actual value is change
Back to top
View user's profile Send private message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Mon Apr 09, 2012 10:45 pm    Post subject: Reply with quote

I thought you figured it out.

Btw

Code:
openProcess([[processnamehere]])  --put process name here

addresslist = getAddressList()
myform= createForm()
label1 = createLabel(myform)
label2 = createLabel(myform)
value1 = nil
value2 = nil
local t=createTimer(nil)

description1= [[Description of memoryrecord1]]   -- put description of memory record 1 here
local memrec1=addresslist_getMemoryRecordByDescription(addresslist, description1)


description2= [[Description of memoryrecord2]]   -- put description of memory record 2 here
local memrec2=addresslist_getMemoryRecordByDescription(addresslist, description2)

function changing()

value1=memoryrecord_getValue(memrec1)

control_setPosition(label1, 10,10)
control_setCaption(label1, value1)

value2=memoryrecord_getValue(memrec2)

control_setPosition(label2, 10,30)
control_setCaption(label2, value2)

return true
end

function start(memoryrecord, before, currentstate)
  timer_onTimer(t, changing)
  timer_setInterval(t,100) --really short wait (setting the speed on open won't work)
  timer_setEnabled(t, true)

return true

end

memoryrecord_onActivate(memrec1, start)
memoryrecord_onActivate(memrec2, start)



Just activate the memory record once and change the value. The value will change in real time and it will also work even if you deactivate memoryrecord.

Is this what you wanted?

_________________
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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