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 


Label that shows the value of a string
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
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Tue Jun 28, 2016 10:11 am    Post subject: Label that shows the value of a string Reply with quote

Hello!

How do i create a label that changes after the value of a string?

For an example:
If the string value is: ceforum = change the label text to ceforum in the trainer

(the name is not specific, it can change to whatever, i just want to be able to see what name the client is.[/code]
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Jun 28, 2016 6:58 pm    Post subject: Reply with quote

Code:
UDF1.CELabel1.Caption = readString("address", 32)
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Wed Jun 29, 2016 10:50 am    Post subject: Reply with quote

Zanzer wrote:
Code:
UDF1.CELabel1.Caption = readString("address", 32)


This causes an error, i might just be really stupid but what am i doing wrong?
Code:
UDF1.CELabel1.Caption = readString("1B18034", 32)


Its the correct name of the label
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Wed Jun 29, 2016 11:39 am    Post subject: Reply with quote

What's the error?

The error should not be caused by readString.

May 1st check if your ce version is up to date.
The version should be shown in main form caption.
If under 6.4(or 6.3?), the Object-oriented format (eg. UDF1.CELabel1 ==> form_name.edit_name) cannot be use.
It has to use old format (eg.
Code:
local ed = component_findComponentByName(UDF1,'CEEdit1')
setProperty(ed,'Text', readString("1B18034", 32))


In Zanzer's example, 'UDF1', 'CELabel1' are the default 1st form name and 1st label name created by ce's form designer.
May check if your form/label's name matched.
<oh, they are correct names.>

bye~

_________________
- Retarded.
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Wed Jun 29, 2016 12:25 pm    Post subject: Reply with quote

panraven wrote:
What's the error?

The error should not be caused by readString.

May 1st check if your ce version is up to date.
The version should be shown in main form caption.
If under 6.4(or 6.3?), the Object-oriented format (eg. UDF1.CELabel1 ==> form_name.edit_name) cannot be use.
It has to use old format (eg.
Code:
local ed = component_findComponentByName(UDF1,'CEEdit1')
setProperty(ed,'Text', readString("1B18034", 32))


In Zanzer's example, 'UDF1', 'CELabel1' are the default 1st form name and 1st label name created by ce's form designer.
May check if your form/label's name matched.
<oh, they are correct names.>

bye~

I got 6.5,
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Wed Jun 29, 2016 12:28 pm    Post subject: Reply with quote

What's the error?
_________________
- Retarded.
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Wed Jun 29, 2016 12:38 pm    Post subject: Reply with quote

panraven wrote:
What's the error?



2.jpg
 Description:
 Filesize:  55.33 KB
 Viewed:  8251 Time(s)

2.jpg


Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Wed Jun 29, 2016 12:51 pm    Post subject: Reply with quote

It said UDF1 is a nil value.

If UDF1 is the name of the form created by CE FORM DESIGNER, it should be shown on ce main menu/Table and its name under 'Create Form' .
The UDF1 than should be usable even your *.ct convert to *.cetrainer.
UDF1 should not be nil value in this case.

May check the form detail in the *.ct file.

bye~

_________________
- Retarded.
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Wed Jun 29, 2016 12:56 pm    Post subject: Reply with quote

panraven wrote:
It said UDF1 is a nil value.

If UDF1 is the name of the form created by CE FORM DESIGNER, it should be shown on ce main menu/Table and its name under 'Create Form' .
The UDF1 than should be usable even your *.ct convert to *.cetrainer.
UDF1 should not be nil value in this case.

May check the form detail in the *.ct file.

bye~


The trainername is: CETrainer, if i swap out udf1 with cetrainer it works but nothing is writing on the label
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Wed Jun 29, 2016 1:00 pm    Post subject: Reply with quote

"... nothing is writing on the label"

Should be the readString return nil or an empty string,
which may be a process has not been attached, the address is not right (return nil),
or the string is actually an empty string.

added:
oops, I may misunderstood what 'nothing' means...
To see if the problem cause by readString, try replace 'readString...' with this
Code:
CETrainer.CELabel1.Caption = os.date('%X')

The Label should change text for every click if every other thing except readString working.

_________________
- Retarded.


Last edited by panraven on Wed Jun 29, 2016 1:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Wed Jun 29, 2016 1:33 pm    Post subject: Reply with quote

panraven wrote:
"... nothing is writing on the label"

Should be the readString return nil or an empty string,
which may be a process has not been attached, the address is not right (return nil),
or the string is actually an empty string.

added:
oops, I may misunderstood what 'nothing' means...
To see if the problem cause by readString, try replace 'readString...' with this
Code:
CETrainer.CELabel1.Caption = os.date('%X')

The Label should change text for every click if every other thing except readString working.

Code:
CETrainer.CELabel1.Caption =os.date('%X')("1B18034", 32)

So like this?
Sorry if im hard to help, i dont quite understand :c
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Wed Jun 29, 2016 2:03 pm    Post subject: Reply with quote

lothe23 wrote:

Code:
CETrainer.CELabel1.Caption =os.date('%X')  --  no these : ("1B18034", 32)

So like this?
Sorry if im hard to help, i dont quite understand :c


remove or comment out these : ("1B18034", 32)

It is just to isolate the problem between the ui and readString part.

_________________
- Retarded.
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Sat Jul 02, 2016 8:58 am    Post subject: Reply with quote

bump
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Jul 02, 2016 12:48 pm    Post subject: Reply with quote

Code:
print(readString("1B18034", 32) or "bad address!")
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Sat Jul 02, 2016 1:30 pm    Post subject: Reply with quote

Zanzer wrote:
Code:
print(readString("1B18034", 32) or "bad address!")


how do i use this with my label?
Back to top
View user's profile Send private message
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