View previous topic :: View next topic |
Author |
Message |
Razi Expert Cheater
Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Sat May 06, 2023 11:28 am Post subject: Replace Edit box with combobox in the Find/Replace windows? |
|
|
Is it possible to replace Edit box with combobox in the Find and Replace windows in the CE Cheat Table Lua script and Lua Engine? And make the combobox remember the last entered data. And as a result, the last entered data will be in the combobox.
If this is not possible with Lua code, then is it possible to just add a combobox to the Find and Replace windows and make the combobox remember the last entered data?
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1066 Location: 0x90
|
Posted: Sat May 06, 2023 1:01 pm Post subject: |
|
|
The control used for the find function is limited. It's possible you could code your own find function and assign it to the event upon clicking find in the menu. Not exactly what you want, but something to get you started in the right direction.
Code: |
if f then f.destroy(); f = nil end
f = createForm(getMainForm())
f.Name = 'frmMain'
f.Caption = 'Main Form'
f.Width = 300
f.Height = 275
f.Position = 'poDesktopCenter'
t = createEdit(f)
t.Height = 30
t.Width = f.Width - 60
t.Left = 5
t.Top = 10
t.Name = 'txtFind'
b = createButton(f)
b.Name = 'btnFind'
b.Caption = 'Find'
b.Width = 50
b.Height = 25
b.Left = f.width - (b.Width + 3)
b.Top = 9
b.OnClick = function()
local text = getLuaEngine().mScript.Text
local searchText = f.t.Text
if text and searchText then
local start, textEnd = string.find(text, searchText)
if start ~= nil then
local selectedText = string.sub(text, start, textEnd)
print(selectedText)
-- Code to select the text here
end
end
end
|
|
|
Back to top |
|
 |
Razi Expert Cheater
Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Sat May 06, 2023 2:51 pm Post subject: |
|
|
Basically, I want the search history from an edit box in the "Find" window from Cheat Table Lua script to be stored in a combo box that would be placed in the same "Find" window.
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1066 Location: 0x90
|
Posted: Sat May 06, 2023 3:11 pm Post subject: |
|
|
Yes, you can customise the components as you see fit. See celua.txt
Ctrl + F > Type create.
It will locate all functions that relate to creating components.
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 35
Joined: 16 Feb 2017 Posts: 1476
|
Posted: 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.
_________________
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1066 Location: 0x90
|
Posted: Sun May 07, 2023 12:24 pm Post subject: |
|
|
Nice work!
|
|
Back to top |
|
 |
Razi Expert Cheater
Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Tue May 09, 2023 7:49 am Post subject: |
|
|
AylinCE wrote: | I guess you need something like: |
Thanks for example. Do you know how to highlight all the same words in Lua script with green background color when one word is selected?
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1066 Location: 0x90
|
Posted: Tue May 09, 2023 10:08 am Post subject: |
|
|
Razi wrote: | Thanks for example. Do you know how to highlight all the same words in Lua script with green background color when one word is selected? |
I'm pretty sure this isn't possible without modifying the actual source code of the component responsible for displaying the text.
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 35
Joined: 16 Feb 2017 Posts: 1476
|
Posted: Tue May 09, 2023 1:05 pm Post subject: |
|
|
LeFiXER wrote: | Nice work!  |
Thanks ..
Here is a different and slightly more comprehensive example:
*Search
*Copy
*Paste (Or Replace)
*Cut
I don't know if I should add a "Replace All" option.
Code: | if srchFrm1 then srchFrm1.Destroy() srchFrm1=nil end
DP1=getScreenDPI()/96
srchFrm1=createForm()
srchFrm1.height=130*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.sB3 -----
sTbl1.sB3=createButton(srchFrm1)
sTbl1.sB3.AutoSize=false
sTbl1.sB3.height=25*DP1 sTbl1.sB3.width=120*DP1 sTbl1.sB3.left=210*DP1 sTbl1.sB3.top=40*DP1
sTbl1.sB3.caption="Copy Select"
sTbl1.sB3.Font.Style="fsBold" sTbl1.sB3.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sCB2 -----
sTbl1.sCB2=createComboBox(srchFrm1)
sTbl1.sCB2.AutoSize=true
sTbl1.sCB2.height=22*DP1 sTbl1.sCB2.width=190*DP1 sTbl1.sCB2.left=10*DP1 sTbl1.sCB2.top=70*DP1
sTbl1.sCB2.text=""
sTbl1.sCB2.Font.Style="fsBold" sTbl1.sCB2.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sB4 -----
sTbl1.sB4=createButton(srchFrm1)
sTbl1.sB4.AutoSize=false
sTbl1.sB4.height=25*DP1 sTbl1.sB4.width=120*DP1 sTbl1.sB4.left=210*DP1 sTbl1.sB4.top=70*DP1
sTbl1.sB4.caption="Paste Select"
sTbl1.sB4.Font.Style="fsBold" sTbl1.sB4.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sB5 -----
sTbl1.sB5=createButton(srchFrm1)
sTbl1.sB5.AutoSize=false
sTbl1.sB5.height=25*DP1 sTbl1.sB5.width=120*DP1 sTbl1.sB5.left=210*DP1 sTbl1.sB5.top=100*DP1
sTbl1.sB5.caption="Cut Select"
sTbl1.sB5.Font.Style="fsBold" sTbl1.sB5.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sB6 -----
sTbl1.sB6=createButton(srchFrm1)
sTbl1.sB6.AutoSize=false
sTbl1.sB6.height=25*DP1 sTbl1.sB6.width=190*DP1 sTbl1.sB6.left=10*DP1 sTbl1.sB6.top=100*DP1
sTbl1.sB6.caption="Clear Paste List"
sTbl1.sB6.Font.Style="fsBold" sTbl1.sB6.Font.Size=10*DP1
-----------------------
--============================================================================--
--============================================================================--
--============================================================================--
local srcTextTbl={}
local pstTextTbl={}
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
sTbl1.sB3.OnClick=function()
s=assList.SelText
writeToClipboard(s)
end
sTbl1.sB4.OnClick=function()
local check2 = 0
newText1=sTbl1.sCB2.text
if newText1=="" then newText1=readFromClipboard() end
for l,k in pairs(pstTextTbl) do
if k==newText1 then check2=1 end
end
if check2==0 then
pstTextTbl[#pstTextTbl + 1] = newText1
sTbl1.sCB2.Items.Add(newText1)
end
if sTbl1.sCB2.text=="" then
text2=readFromClipboard()
assList.SelText=assList.SelText:gsub(assList.SelText,text2)
else
assList.SelText=assList.SelText:gsub(assList.SelText,newText1)
end
end
sTbl1.sB5.OnClick=function()
s=assList.SelText
writeToClipboard(s)
assList.SelText=assList.SelText:gsub(assList.SelText,"")
end
sTbl1.sB6.OnClick=function()
clrTbl(pstTextTbl)
sTbl1.sCB2.clear()
end |
Description: |
|
Filesize: |
10.39 KB |
Viewed: |
7219 Time(s) |

|
_________________
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1066 Location: 0x90
|
Posted: Tue May 09, 2023 1:08 pm Post subject: |
|
|
AylinCE wrote: | LeFiXER wrote: | Nice work!  |
Thanks ..
Here is a different and slightly more comprehensive example:
*Search
*Copy
*Paste (Or Replace)
*Cut
I don't know if I should add a "Replace All" option.
Code: | if srchFrm1 then srchFrm1.Destroy() srchFrm1=nil end
DP1=getScreenDPI()/96
srchFrm1=createForm()
srchFrm1.height=130*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.sB3 -----
sTbl1.sB3=createButton(srchFrm1)
sTbl1.sB3.AutoSize=false
sTbl1.sB3.height=25*DP1 sTbl1.sB3.width=120*DP1 sTbl1.sB3.left=210*DP1 sTbl1.sB3.top=40*DP1
sTbl1.sB3.caption="Copy Select"
sTbl1.sB3.Font.Style="fsBold" sTbl1.sB3.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sCB2 -----
sTbl1.sCB2=createComboBox(srchFrm1)
sTbl1.sCB2.AutoSize=true
sTbl1.sCB2.height=22*DP1 sTbl1.sCB2.width=190*DP1 sTbl1.sCB2.left=10*DP1 sTbl1.sCB2.top=70*DP1
sTbl1.sCB2.text=""
sTbl1.sCB2.Font.Style="fsBold" sTbl1.sCB2.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sB4 -----
sTbl1.sB4=createButton(srchFrm1)
sTbl1.sB4.AutoSize=false
sTbl1.sB4.height=25*DP1 sTbl1.sB4.width=120*DP1 sTbl1.sB4.left=210*DP1 sTbl1.sB4.top=70*DP1
sTbl1.sB4.caption="Paste Select"
sTbl1.sB4.Font.Style="fsBold" sTbl1.sB4.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sB5 -----
sTbl1.sB5=createButton(srchFrm1)
sTbl1.sB5.AutoSize=false
sTbl1.sB5.height=25*DP1 sTbl1.sB5.width=120*DP1 sTbl1.sB5.left=210*DP1 sTbl1.sB5.top=100*DP1
sTbl1.sB5.caption="Cut Select"
sTbl1.sB5.Font.Style="fsBold" sTbl1.sB5.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sB6 -----
sTbl1.sB6=createButton(srchFrm1)
sTbl1.sB6.AutoSize=false
sTbl1.sB6.height=25*DP1 sTbl1.sB6.width=190*DP1 sTbl1.sB6.left=10*DP1 sTbl1.sB6.top=100*DP1
sTbl1.sB6.caption="Clear Paste List"
sTbl1.sB6.Font.Style="fsBold" sTbl1.sB6.Font.Size=10*DP1
-----------------------
--============================================================================--
--============================================================================--
--============================================================================--
local srcTextTbl={}
local pstTextTbl={}
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
sTbl1.sB3.OnClick=function()
s=assList.SelText
writeToClipboard(s)
end
sTbl1.sB4.OnClick=function()
local check2 = 0
newText1=sTbl1.sCB2.text
if newText1=="" then newText1=readFromClipboard() end
for l,k in pairs(pstTextTbl) do
if k==newText1 then check2=1 end
end
if check2==0 then
pstTextTbl[#pstTextTbl + 1] = newText1
sTbl1.sCB2.Items.Add(newText1)
end
if sTbl1.sCB2.text=="" then
text2=readFromClipboard()
assList.SelText=assList.SelText:gsub(assList.SelText,text2)
else
assList.SelText=assList.SelText:gsub(assList.SelText,newText1)
end
end
sTbl1.sB5.OnClick=function()
s=assList.SelText
writeToClipboard(s)
assList.SelText=assList.SelText:gsub(assList.SelText,"")
end
sTbl1.sB6.OnClick=function()
clrTbl(pstTextTbl)
sTbl1.sCB2.clear()
end |
|
I would say why not? You've gone this far
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 35
Joined: 16 Feb 2017 Posts: 1476
|
Posted: Tue May 09, 2023 1:48 pm Post subject: |
|
|
I left a CheckBox checkbox.
If checked, the "Paste" option will change all results.
This is a dangerous option!
Code: | if srchFrm1 then srchFrm1.Destroy() srchFrm1=nil end
DP1=getScreenDPI()/96
srchFrm1=createForm()
srchFrm1.height=130*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.sB3 -----
sTbl1.sB3=createButton(srchFrm1)
sTbl1.sB3.AutoSize=false
sTbl1.sB3.height=25*DP1 sTbl1.sB3.width=120*DP1 sTbl1.sB3.left=210*DP1 sTbl1.sB3.top=40*DP1
sTbl1.sB3.caption="Copy Select"
sTbl1.sB3.Font.Style="fsBold" sTbl1.sB3.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sCB2 -----
sTbl1.sCB2=createComboBox(srchFrm1)
sTbl1.sCB2.AutoSize=true
sTbl1.sCB2.height=22*DP1 sTbl1.sCB2.width=190*DP1 sTbl1.sCB2.left=10*DP1 sTbl1.sCB2.top=70*DP1
sTbl1.sCB2.text=""
sTbl1.sCB2.Font.Style="fsBold" sTbl1.sCB2.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sB4 -----
sTbl1.sB4=createButton(srchFrm1)
sTbl1.sB4.AutoSize=false
sTbl1.sB4.height=25*DP1 sTbl1.sB4.width=100*DP1 sTbl1.sB4.left=210*DP1 sTbl1.sB4.top=70*DP1
sTbl1.sB4.caption="Paste Select"
sTbl1.sB4.Font.Style="fsBold" sTbl1.sB4.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sChk1 -----
sTbl1.sChk1=createCheckBox(srchFrm1)
sTbl1.sChk1.AutoSize=true
sTbl1.sChk1.left=315 sTbl1.sChk1.top=73
sTbl1.sChk1.caption="" sTbl1.sChk1.ShowHint=true
sTbl1.sChk1.Hint="If you check this box,\nall results will change."
-----------------------
----------------------- sTbl1.sB5 -----
sTbl1.sB5=createButton(srchFrm1)
sTbl1.sB5.AutoSize=false
sTbl1.sB5.height=25*DP1 sTbl1.sB5.width=120*DP1 sTbl1.sB5.left=210*DP1 sTbl1.sB5.top=100*DP1
sTbl1.sB5.caption="Cut Select"
sTbl1.sB5.Font.Style="fsBold" sTbl1.sB5.Font.Size=10*DP1
-----------------------
----------------------- sTbl1.sB6 -----
sTbl1.sB6=createButton(srchFrm1)
sTbl1.sB6.AutoSize=false
sTbl1.sB6.height=25*DP1 sTbl1.sB6.width=190*DP1 sTbl1.sB6.left=10*DP1 sTbl1.sB6.top=100*DP1
sTbl1.sB6.caption="Clear Paste List"
sTbl1.sB6.Font.Style="fsBold" sTbl1.sB6.Font.Size=10*DP1
-----------------------
--============================================================================--
--============================================================================--
--============================================================================--
local srcTextTbl={}
local pstTextTbl={}
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
sTbl1.sB3.OnClick=function()
s=assList.SelText
writeToClipboard(s)
end
sTbl1.sB4.OnClick=function()
local check2 = 0
newText1=sTbl1.sCB2.text
if newText1=="" then newText1=readFromClipboard() end
for l,k in pairs(pstTextTbl) do
if k==newText1 then check2=1 end
end
if check2==0 then
pstTextTbl[#pstTextTbl + 1] = newText1
sTbl1.sCB2.Items.Add(newText1)
end
if sTbl1.sChk1.Checked==false then
if sTbl1.sCB2.text=="" then
text2=readFromClipboard()
assList.SelText=assList.SelText:gsub(assList.SelText,text2)
else
assList.SelText=assList.SelText:gsub(assList.SelText,newText1)
end
else
if sTbl1.sCB1.text=="" then
print("Please type a word in the search text box!")
else
newText3 = sTbl1.sCB1.text
if sTbl1.sCB2.text=="" then
text2=readFromClipboard()
assList.Lines.Text:gsub(newText3,text2)
else
newText1=sTbl1.sCB2.text
assList.Lines.Text=assList.Lines.Text:gsub(newText3,newText1)
end
end
end
end
sTbl1.sB5.OnClick=function()
s=assList.SelText
writeToClipboard(s)
assList.SelText=assList.SelText:gsub(assList.SelText,"")
end
sTbl1.sB6.OnClick=function()
clrTbl(pstTextTbl)
sTbl1.sCB2.clear()
end |
_________________
|
|
Back to top |
|
 |
Razi Expert Cheater
Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Tue May 09, 2023 6:44 pm Post subject: |
|
|
This example is sufficient for now. I'm also interested in this question: is it possible to select all the same words in Lua script when one same word is selected?
|
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 35
Joined: 16 Feb 2017 Posts: 1476
|
Posted: Wed May 10, 2023 1:56 am Post subject: |
|
|
Corroder wrote: | (someone ever said: "Why make it difficult when there is an easy way") |
A question comes to my mind:
I guess it is not easy to use Notepad++ with CE GUI or CE syntax.
Edit it in Notepad++, export it to CE Lua Script (especially for GUI tests!) and try it out.
Doing this 10,20,30 times in a row would be tiring.
I guess the easy way is to enrich CE Lua Script and help add more features.
@Corroder, my old friend, you are a person who has implemented rare features, code, into CE. Notepad++ can't make you lazy.
(Maybe we should write a code that we can edit in Notepad++ and transfer it to CE lua script. Of course both must be on at the same time.
I doubt this is the easy way.)
--===============================--
@Razi:
I will try your last comment.
But it would be wiser to get a recommendation from the DB for this.
_________________
|
|
Back to top |
|
 |
Razi Expert Cheater
Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Wed May 10, 2023 8:41 am Post subject: |
|
|
AylinCE wrote: | Maybe we should write a code that we can edit in Notepad++ and transfer it to CE lua script. |
I have already replaced the edit box with a combo box in CE source (actually lazarus source files) and already edited the lazarus files, but not finished yet. (Need to know how to properly Move combobox items) But, this requires to edit 2 lazarus files: finddialog.inc, replacedialog.inc and compiling CE. Just need to add a few lines of code to these files. This can be done for any version of CE.
Description: |
|
Filesize: |
41.45 KB |
Viewed: |
7100 Time(s) |

|
Description: |
|
Filesize: |
67.71 KB |
Viewed: |
7101 Time(s) |

|
Last edited by Razi on Fri May 12, 2023 8:46 am; edited 3 times in total |
|
Back to top |
|
 |
|