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 


Reading from multiple lines in memo object

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
usernotfound
Expert Cheater
Reputation: 0

Joined: 21 Feb 2016
Posts: 115

PostPosted: Wed Dec 07, 2016 2:35 am    Post subject: Reading from multiple lines in memo object Reply with quote

How could I do something like this with multiple lines, so that whatever is written in the memo object gets written to the autoAssemble line by line?

Code:
AAscriptenable = UDF1.CEMemo1.Lines
AAscriptdisable = UDF1.CEMemo2.Lines

function CECheckbox1Change(sender)
  if sender.Checked then
    autoAssemble(string.format([[
    %s
    ]],AAscriptenable))
  else
    autoAssemble(string.format([[
    %s
    ]],AAscriptdisable))
  end
end
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Wed Dec 07, 2016 2:52 am    Post subject: Reply with quote

to get the full text use AAscriptenable.Text
to get an individual libe use [] e.g. AAscriptenable[123456]

also, since you are using a disable part i recommend you add this as an entry to the table, and just set the Active property of the memoryrecord to true/false. (the standalone autoAssemble command can not use dealloc)

_________________
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
usernotfound
Expert Cheater
Reputation: 0

Joined: 21 Feb 2016
Posts: 115

PostPosted: Wed Dec 07, 2016 3:32 am    Post subject: Reply with quote

I tried this

Code:
function CECheckbox1Change(sender)
  local aL = getAddressList()
  local rec = aL.getMemoryRecordByDescription('AArec')
  rec.Script = UDF1.CEMemo1.Text
  if sender.Checked then
    rec.Active = true
  else
    rec.Active = false
  end
end


But nothing came up in the entry, using Lines[] works but I'm not sure how to add all lines at once. And would this still work in a compiled .exe trainer since it is using CE MainForm?

edit: Oops my mistake didn't realize you meant Lines.Text, that works perfectly. Thanks DB!
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