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 


Is there anything missing?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Warning
Reputation: 37

Joined: 16 Feb 2017
Posts: 1538

PostPosted: Sat Feb 08, 2020 6:30 am    Post subject: Is there anything missing? Reply with quote

Even a simple code loop creates difficulties. Smile
What am I doing wrong?

Code:
if f then f.destroy() f = nil end

f = createForm(true)
f.Position = poDesktopCenter
f.Width = 220
f.Height = 200

local e1 = createEdit(f)
e1.Height = 24
e1.Left = 10
e1.Top = 15
e1.Width = 100
e1.text = "YourList"

local m1=createMemo(f)
m1.Height = 120
m1.Left = 10
m1.Top = 50
m1.Width = 100
--m1.visible=false
m1.lines.text="MyList\nYourList\nTheirList"

function keyKey1()
for i=0,m1.lines.count do end
local Box = e1.text
if Box ~= m1.lines[i] then
showMessage("Not available on the list.")
else
showMessage("Available in the List")
--Trainer1.hide()
--Trainer2.Show()
end
end

keyKey1()

_________________
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
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sat Feb 08, 2020 7:48 am    Post subject: Reply with quote

Try :

Code:
function keyKey1()
 local Box = e1.text
 for i=0,m1.lines.count do
 if Box ~= m1.lines[i] then
  showMessage("Not available on the list.")
 else
  showMessage("Available in the List")
--Trainer1.hide()
--Trainer2.Show()
 end
 end
end


BUT, the function will loop to matching the edit box text as much as memo lines text count until the end. One of memo line text will show 'Available in the list'.

I more like using something like this:

Code:
function keyKey1()
 x = m1.Lines.Text
 z = e1.Text
 if string.find(x, "%f[%a]" ..z.. "%f[%A]") ~= nil then
  showMessage("Available in the List")
 else
  showMessage("Not available on the list.")
 end
end

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Warning
Reputation: 37

Joined: 16 Feb 2017
Posts: 1538

PostPosted: Sat Feb 08, 2020 8:49 am    Post subject: Reply with quote

Corroder wrote:


I more like using something like this:

Code:
function keyKey1()
 x = m1.Lines.Text
 z = e1.Text
 if string.find(x, "%f[%a]" ..z.. "%f[%A]") ~= nil then
  showMessage("Available in the List")
 else
  showMessage("Not available on the list.")
 end
end


that's it worked. Smile
You saved me from great trouble. Thank you.
I am preparing a user-defined Trainer.
(To prevent unauthorized distribution and use)
I will send you a sample .CT file when the project is finished.
Maybe you can give some ideas for some arrangements.

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