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 Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

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

You don't. Just execute it in the Cheat Table Lua Script and see if it prints the string you think it should.
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:50 pm    Post subject: Reply with quote

Zanzer wrote:
You don't. Just execute it in the Cheat Table Lua Script and see if it prints the string you think it should.


I guess it works, but i want it to be written by a label in my trainer



1.jpg
 Description:
 Filesize:  46.04 KB
 Viewed:  5005 Time(s)

1.jpg


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 1:58 pm    Post subject: Reply with quote

That's saying that CETrainer is nil. Therefore, that's the wrong name of your form as well.
I thought you said swapping out UDF1 with CETrainer worked?

When you click the Table dropdown menu, do you not see a form name there above Add File?

Why don't you just upload whatever you've got?
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 2:25 pm    Post subject: Reply with quote

Zanzer wrote:
That's saying that CETrainer is nil. Therefore, that's the wrong name of your form as well.
I thought you said swapping out UDF1 with CETrainer worked?

When you click the Table dropdown menu, do you not see a form name there above Add File?

Why don't you just upload whatever you've got?


thats because i didnt assign it to anything, i just executed it. I assigned it to a button and it still works, however i want it to be shown by a label changing after the value the string has



1.jpg
 Description:
 Filesize:  41.96 KB
 Viewed:  4984 Time(s)

1.jpg


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 3:31 pm    Post subject: Reply with quote

I see no label in that screenshot.
Code:
CETrainer.CEButton1.Caption = readString("1B18034", 32)
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 3:59 pm    Post subject: Reply with quote

Zanzer wrote:
I see no label in that screenshot.
Code:
CETrainer.CEButton1.Caption = readString("1B18034", 32)


When i do this with a label and execute the script it shows my name ingame properly, but when i generate the trainer the name doesent show anymore. (the bottom right one is a generated trainer from the same script as the one in this image)



3.jpg
 Description:
 Filesize:  193.71 KB
 Viewed:  4953 Time(s)

3.jpg


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 6:08 pm    Post subject: Reply with quote

That's because you're manually executing the script within the table.

Whereas your trainer is executing the script immediately. Before even attaching to the game.
Code:
function onOpenProcess(processId)
  reinitializeSymbolhandler()
  CETrainer.CELabel1.Caption = readString("1B18034", 32)
end

That may not even work. Probably need to wait until you actually load up your saved character.

You'll have to create a timer that constantly polls for the character name.

Code:
startup = createTimer(nil, false)
startup.Interval = 1000
startup.OnTimer = function(timer)
  local name = readString("1B18034", 32)
  if name then
    CETrainer.CELabel1.Caption = name
    timer.Enabled = false
  end
end
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Sun Jul 03, 2016 5:31 am    Post subject: Reply with quote

Zanzer wrote:
That's because you're manually executing the script within the table.

Whereas your trainer is executing the script immediately. Before even attaching to the game.
Code:
function onOpenProcess(processId)
  reinitializeSymbolhandler()
  CETrainer.CELabel1.Caption = readString("1B18034", 32)
end

That may not even work. Probably need to wait until you actually load up your saved character.

You'll have to create a timer that constantly polls for the character name.

Code:
startup = createTimer(nil, false)
startup.Interval = 1000
startup.OnTimer = function(timer)
  local name = readString("1B18034", 32)
  if name then
    CETrainer.CELabel1.Caption = name
    timer.Enabled = false
  end
end



With this it works until the name changes (since the clients change the names does aswell)

Code:
function onOpenProcess(processId)
  reinitializeSymbolhandler()
  CETrainer.CELabel1.Caption = readString("1B18034", 32)
end


With this option nothing at all happens:

Code:
startup = createTimer(nil, false)
startup.Interval = 1000
startup.OnTimer = function(timer)
  local name = readString("1B18034", 32)
  if name then
    CETrainer.CELabel1.Caption = name
    timer.Enabled = false
  end
end
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Jul 03, 2016 8:48 am    Post subject: Reply with quote

Have fun.
Code:
startup = createTimer(nil, false)
startup.Interval = 1000
startup.OnTimer = function(timer)
  CETrainer.CELabel1.Caption = readString("1B18034", 32)
end
startup.Enabled = true
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Sun Jul 03, 2016 12:20 pm    Post subject: Reply with quote

Zanzer wrote:
Have fun.
Code:
startup = createTimer(nil, false)
startup.Interval = 1000
startup.OnTimer = function(timer)
  CETrainer.CELabel1.Caption = readString("1B18034", 32)
end
startup.Enabled = true


Thank you for all the help even tho i explain horrible some times, i really apprechiate it!
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 Previous  1, 2
Page 2 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