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 


What is wrong with this code?Please help me

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

Joined: 15 Sep 2012
Posts: 5

PostPosted: Sat Sep 22, 2012 11:14 pm    Post subject: What is wrong with this code?Please help me Reply with quote

Code:
function CETimer1Timer(sender)
if (control_getChecked(TD_goldCheckBox)) == true then
   writeInteger("[6acb28]+30", control_getCaption(TD_goldEdit))
end
if (control_getChecked(TD_bloodCheckBox)) == true then
   writeInteger("[6acb28]+38", control_getCaption(TD_bloodEdit))
end
end


Error:[string "function CETimer1Timer(sender)..."]:17: attempt to call global 'control_getChecked' (a number value)

I am trying to lock gold and blood,Please tell me how to getChecked???wrong grammar?


Last edited by tukey on Sun Sep 23, 2012 1:55 am; edited 1 time in total
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Sun Sep 23, 2012 1:31 am    Post subject: Reply with quote

You will need to either use a code-cave and alter how the game accesses the addresses you mentioned when your check boxes are enabled. Or you an use a timer/thread to force the trainer to keep writing to the addresses until the checkbox is unchecked.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Sun Sep 23, 2012 3:06 am    Post subject: Reply with quote

control_getChecked() doesn't return a boolean but a number.

The return values are:
Code:

cbUnchecked=0
cbChecked=1
cbGrayed=2


so change the line to:
Code:

if control_getChecked(TD_goldCheckBox)==cbChecked then

_________________
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