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 


Cheat Engine Forum Index
PostGo back to topic
AylinCE
Grandmaster Cheater Supreme
Reputation: 35
Joined: 16 Feb 2017
Posts: 1476

PostPosted: Sun May 07, 2023 10:43 am    Post subject:

I guess you need something like:

Code:
if srchFrm1 then srchFrm1.Destroy() srchFrm1=nil end
DP1=getScreenDPI()/96
srchFrm1=createForm()
srchFrm1.height=70*DP1 srchFrm1.width=340*DP1 srchFrm1.left=283*DP1 srchFrm1.top=142*DP1
srchFrm1.PopupMode=0 srchFrm1.caption="Search Add Tbl"
srchFrm1.Position="poDesktopCenter" srchFrm1.BorderStyle="bsSingle"  srchFrm1.ShowInTaskBar="stAlways"
-------------------------
local sTbl1 = {}
----------------------- sTbl1.sB1 ----- 
sTbl1.sB1=createButton(srchFrm1)
sTbl1.sB1.AutoSize=false
sTbl1.sB1.height=25*DP1 sTbl1.sB1.width=120*DP1 sTbl1.sB1.left=210*DP1 sTbl1.sB1.top=9*DP1
sTbl1.sB1.caption="Search"
sTbl1.sB1.Font.Style="fsBold" sTbl1.sB1.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sB3 ----- 
sTbl1.sB2=createButton(srchFrm1)
sTbl1.sB2.AutoSize=false
sTbl1.sB2.height=25*DP1 sTbl1.sB2.width=190*DP1 sTbl1.sB2.left=10*DP1 sTbl1.sB2.top=40*DP1
sTbl1.sB2.caption="Clear  Search  List"
sTbl1.sB2.Font.Style="fsBold" sTbl1.sB2.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sCB1 ----- 
sTbl1.sCB1=createComboBox(srchFrm1)
sTbl1.sCB1.AutoSize=true
sTbl1.sCB1.height=22*DP1 sTbl1.sCB1.width=190*DP1 sTbl1.sCB1.left=10*DP1 sTbl1.sCB1.top=10*DP1
sTbl1.sCB1.text=""
sTbl1.sCB1.Font.Style="fsBold" sTbl1.sCB1.Font.Size=10*DP1
--sTbl1.sCB1.ReadOnly=false sTbl1.sCB1.Style="csDropDown"
-----------------------
--============================================================================--
--============================================================================--
--============================================================================--

local srcTextTbl={}
local newText=""
local assList = MainForm.frmAutoInject.Assemblescreen
local line1 = 0

function clrTbl(tbl)
 for i,k in pairs(tbl) do
  tbl[i] = nil
 end
end

sTbl1.sB1.OnClick=function()
local check1 = 0
 if sTbl1.sCB1.text=="" then
  print("Please type a word in the search text box!")
 else
  newText=sTbl1.sCB1.text
 if string.find(assList.Lines.Text,newText) then
  for l,k in pairs(srcTextTbl) do
   if k==sTbl1.sCB1.text then check1=1 end
  end
  if check1==0 then
   srcTextTbl[#srcTextTbl + 1] = sTbl1.sCB1.text
   sTbl1.sCB1.Items.Add(sTbl1.sCB1.text)
  end
    r1,r2 = string.find(assList.Lines.Text,newText,line1)
   if r2~=nil then
    assList.SelStart=r1
    assList.SelEnd=r2 + 1
    assList.setFocus()
    line1=tonumber(line1) + r2 + 1
    r3,r4 = string.find(assList.Lines.Text,newText,line1)
     if r4==nil then line1=0 end
   end
   else
    showMessage("'"..newText.."'  not found!")
  end
 end
end

sTbl1.sB2.OnClick=function()
clrTbl(srcTextTbl)
  sTbl1.sCB1.clear()
end


An example to get started.
_________________
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
Post reviews:   Approve 1
Author Review
LeFiXER
Review: Approve
Post reference:
ReviewPosted: Sun May 07, 2023 12:24 pm

Very nice solution!
Back to top
View user's profile Send private message
Display:  
Cheat Engine Forum Index


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites