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 


PLS help me with this

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

Joined: 28 Oct 2019
Posts: 4

PostPosted: Mon Dec 09, 2019 1:10 pm    Post subject: PLS help me with this Reply with quote

I need to activate the Script somehow
Idk what I'm doing wrong



LuaError.png
 Description:
 Filesize:  29.42 KB
 Viewed:  4967 Time(s)

LuaError.png


Back to top
View user's profile Send private message
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Mon Dec 09, 2019 2:10 pm    Post subject: Reply with quote

At line 4 (as console shows you)
You accidently using script variable instead of addressList,
Replace it with
Code:
script = addressList.getMemoryRecordByDescription("Status")

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
PROTOTYPE_LTU
How do I cheat?
Reputation: 0

Joined: 28 Oct 2019
Posts: 4

PostPosted: Mon Dec 09, 2019 4:42 pm    Post subject: Reply with quote

Ty that worked
and now I need to Enable 2 Scripts at the same time

Code:
isEnabled = 0
function CETrainer_CECheckbox1Click(sender)
  addressList = getAddressList()
  script = addressList.getMemoryRecordByDescription("Stats")
  if ( isEnabled == 0 ) then
     script.Active = true
     isEnabled = 1
  else
    script.Active = false
    isEnabled = 0
  end
end
function CETrainer_CECheckbox2Click(sender)
  addressList = getAddressList()
  script = addressList.getMemoryRecordByDescription("Enemy Stats")
  if ( isEnabled == 0 ) then
     script.Active = true
     isEnabled = 1
  else
    script.Active = false
    isEnabled = 0
  end
end


and this don't seem to work
if i Check both boxes only 1 will work
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1533

PostPosted: Tue Dec 10, 2019 5:23 am    Post subject: Reply with quote

PROTOTYPE_LTU wrote:
Ty that worked
and now I need to Enable 2 Scripts at the same time


and this don't seem to work
if i Check both boxes only 1 will work



Code:
isEnabled = 0
function CETrainer_CECheckbox1Click(sender)
  addressList = getAddressList()
if sender.checked == true then
  script1 = addressList.getMemoryRecordByDescription("Stats")
  script2 = addressList.getMemoryRecordByDescription("Stats1")
     script1.Active = true
     script2.Active = true
     isEnabled = 1
  else
  script1 = addressList.getMemoryRecordByDescription("Stats") -- hack false -close
  script2 = addressList.getMemoryRecordByDescription("Stats1") --hack false
    script1.Active = false
    script2.Active = false
    isEnabled = 0
  end
end
function CETrainer_CECheckbox2Click(sender)
  addressList = getAddressList()
if sender.checked == true then
  script3 = addressList.getMemoryRecordByDescription("Enemy Stats")
     script3.Active = true
     isEnabled = 1
  else
  script3 = addressList.getMemoryRecordByDescription("Enemy Stats")
    script3.Active = false
    isEnabled = 0
  end
end

-- or all select
function CETrainer_CECheckbox3Click(sender)
if sender.checked == true then
CETrainer.CECheckbox1.checked = true --or CETrainer_CECheckbox1
CETrainer.CECheckbox2.checked = true
else
CETrainer.CECheckbox1.checked = false
CETrainer.CECheckbox2.checked = false
end
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
PROTOTYPE_LTU
How do I cheat?
Reputation: 0

Joined: 28 Oct 2019
Posts: 4

PostPosted: Tue Dec 10, 2019 12:01 pm    Post subject: Reply with quote

Ty Aylin for help
this line was not necessary i removed that and ur code was working well
Code:
script2 = addressList.getMemoryRecordByDescription("Stats1")


1)how separate numbers with commas like in Pic.

2)maybe I'm asking too much but how make in another window when "Enemy HP"
is Losing HP in another window would show how much HP is lost in 1 second


here is the code that displays HP

Code:
function CETrainer_CETimer3Timer(sender)
  local memrec=addresslist_getMemoryRecordByDescription(getAddressList(), "HP E")
  local value=memoryrecord_getValue(memrec)
  control_setCaption(CETrainer_CEEdit1, value)
end



HP.png
 Description:
 Filesize:  2.32 KB
 Viewed:  4879 Time(s)

HP.png


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