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 


Need some help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Bennnie
Newbie cheater
Reputation: 0

Joined: 29 Aug 2012
Posts: 11

PostPosted: Wed Aug 29, 2012 5:05 am    Post subject: Need some help Reply with quote

Hi,

Problem 1:

If got the following code

Code:

enabled=false

function CEButton1Click(sender)
     if enabled then
          enabled=false
          control_setEnabled(CETrainer_CETimer1, false)
          control_setCaption(CETrainer_CEButton1, "Auto refresh (Off)")
     else
          enabled=true
          control_setEnabled(CETrainer_CETimer1, true)
          control_setCaption(CETrainer_CEButton1, "Auto refresh (On)")
     end
end


and every time i use this code, i get an "Error:Access violation". It only works when i make the control_setEnabled lines in comment but this is obviously not what i want. Did i use the wrong command or is it a bug?

Problem 2:
Code:

armorAdd=addresslist_getMemoryRecordByDescription(addresslist, "armor")
armorValue=memoryrecord_getValue(armorAdd)
control_setCaption(CETrainer_CELabel10e, calculateReducedDamage(armorValue))

function calculateReducedDamage(value)
if value>0 then
doSomething()
end

armorValue is a float but i get the error "attempt to compare number with string" (at value>0) but i cannot set armorValue to an float manually, or should i do something else?




Thank you in advance!
Code:
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Wed Aug 29, 2012 3:32 pm    Post subject: Re: Need some help Reply with quote

Bennnie wrote:

control_setEnabled(CETrainer_CETimer1, false)


try this:
timer_setEnabled(CETrainer_CETimer1, false)


Bennnie wrote:

armorValue=memoryrecord_getValue(armorAdd)


memoryrecord_getValue(te): returns the current value of the cheat table entry as a string

So,
armorValue=tonumber(memoryrecord_getValue(armorAdd))

_________________
Back to top
View user's profile Send private message MSN Messenger
Bennnie
Newbie cheater
Reputation: 0

Joined: 29 Aug 2012
Posts: 11

PostPosted: Thu Aug 30, 2012 5:59 am    Post subject: Reply with quote

Thank you! it worked Smile
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