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 use Button?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
zazaxzazax
How do I cheat?
Reputation: 0

Joined: 24 Feb 2015
Posts: 2

PostPosted: Tue Feb 24, 2015 2:44 pm    Post subject: how to use Button? Reply with quote

I want to use button to change Label1.Caption

function CEButton()
Label.Caption = "test"
end

but it still error
Back to top
View user's profile Send private message
SteveAndrew
Master Cheater
Reputation: 30

Joined: 02 Sep 2012
Posts: 323

PostPosted: Tue Feb 24, 2015 4:48 pm    Post subject: Re: how to use Button? Reply with quote

zazaxzazax wrote:
I want to use button to change Label1.Caption

function CEButton()
Label.Caption = "test"
end

but it still error


Try it like this instead:

_________________
Back to top
View user's profile Send private message
zazaxzazax
How do I cheat?
Reputation: 0

Joined: 24 Feb 2015
Posts: 2

PostPosted: Tue Feb 24, 2015 9:23 pm    Post subject: Re: how to use Button? Reply with quote

SteveAndrew wrote:


Try it like this instead:

thank you
I know where I take mistake

can you help again?
I got another problem

my code
Code:
function CEButton1Click(sender)
if timer_getEnabled(CETimer1) == "True" then
timer_setEnabled(CETimer1, false)
elseif timer_getEnabled(CETimer1) == "False" then
timer_setEnabled(CETimer1, true)
end
end

function CETimer2Timer(sender)
UDF1.CELabel1.Caption = timer_getEnabled(CETimer1)
end


my structure
UDF1
└CEButtion1
└CELabel1
└CETimer1
└CETimer2

I got the error "Invalid class object"
if any where I take mistake?
I don't Know how to get and control the state of Timer
I hope to let CETimer2 get CETimer1.Enable state and renew the CELabel1.Caption
PS.sorry my English is poor and I can't post picture in the reply
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed Feb 25, 2015 3:13 am    Post subject: Reply with quote

you need to specify it's on UDF1
e.g
if UDF1.CETimer1.Enabled==false then UDF1.CETimer.Enabled=true end

_________________
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
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