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 


Convert number to string and put into a CELabel

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Thu Apr 30, 2015 11:05 pm    Post subject: Convert number to string and put into a CELabel Reply with quote

I want show timer countdown process in form trainer as a label caption.
While test with print statement its work until " print(y) " and get error at
"control_setCaption(CELabel1, y)".

Please help to fix it.

Code:

function CEButton1Click(sender)
 tmr = tonumber(control_getCaption(UDF1.CEEdit1))
 t.Interval=tmr
--- print(tmr)
 x = tmr/1000
--- print(x)
 for i = x, 0, -1 do
--- print(i)
  y = tostring(i)
  print(y)
  control_setCaption(CELabel1, y)
 end
 t.Enabled=true
end

function resetTm()
  if (t) then
   t.Enabled=false
  end
end

t=createTimer(nil, false)
t.onTimer=resetTm


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

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Apr 30, 2015 11:15 pm    Post subject: Reply with quote

control_setCaption(UDF1.CELabel1, y)
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
Page 1 of 1

 
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