Last active
May 11, 2024 23:38
-
-
Save J1327/4e62b428c8e455e370b888e4b26a1cd8 to your computer and use it in GitHub Desktop.
View current Cheat Engine Table session, files. Images, text, lua etc… Exclusive for Opencheattables.com (community)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if Insider and Insider.InsiderForm then | |
Insider.InsiderForm.close() | |
end | |
Insider = {} | |
Insider.tryformatdocument = function(code) | |
code = code:gsub(",", ",\n") | |
local keywords = {"for", "do", " local function ", "function", "end", "if", "return"} | |
local formattedCode = code | |
for _, keyword in ipairs(keywords) do | |
formattedCode = formattedCode:gsub(keyword, "\n" .. keyword) | |
end | |
return formattedCode | |
end | |
Insider.getTableFileCount = function() | |
for i = 0, getMainForm().Menu.Items.Count - 1 do | |
if getMainForm().Menu.Items[i].Name == 'miTable' then | |
mmi = getMainForm().Menu.Items[i] | |
mmi.doClick() | |
for u = 0, mmi.Count - 1 do | |
if mmi.Item[u].Name == 'miAddFile' then | |
u = u + 1 | |
local output_filecount = mmi.Count - u | |
return output_filecount | |
end | |
end | |
break | |
end | |
end | |
end | |
function local_aob_memscan(aob, badr, sadr) | |
local memscan = createMemScan() | |
memscan.firstScan(soExactValue, vtByteArray, rtRounded, aob, nil, badr, sadr, "", fsmNotAligned, "", true, false, | |
false, false, false) | |
memscan.waitTillDone() | |
local memscan_list = createFoundList(memscan) | |
memscan_list.initialize() | |
return memscan_list | |
end | |
function getFormbyName(string) | |
for i = 0, getFormCount() - 1 do | |
local root = getForm(i) | |
local root_name = root.ClassName | |
if root_name == string then | |
return root; | |
end | |
end | |
if root_name ~= string then | |
return nil | |
end | |
end | |
Insider.InsiderForm = createForm() | |
Insider.InsiderForm.Caption = "[FileInsider] Current CE Session file table viewer" | |
Insider.InsiderForm.setSize(1000, 550) | |
setProperty(Insider.InsiderForm, "FormStyle", [[fsSystemStayOnTop]]) | |
setProperty(Insider.InsiderForm, "visible", true) | |
setProperty(Insider.InsiderForm, "BorderStyle", bsSizeable) | |
Insider.FileTListBox = createListBox(Insider.InsiderForm) | |
Insider.FileTListBox.setSize(400, 400) | |
Insider.FileTListBox.Anchors = [[akTop,akLeft,akBottom]] | |
Insider.InsiderForm.OnClose = function() | |
if Insider.CESFTV then | |
Insider.CESFTV.destroy() | |
end | |
Insider.InsiderForm.destroy() | |
if Insider.CESFTV then | |
Insider.CESFTV.destroy() | |
end | |
Insider = nil; | |
beep() | |
end | |
Insider.pop = createPopupMenu(Insider.FileTListBox) | |
Insider.pop.Images = MainForm.MainMenu1.Images | |
Insider.pop0 = createMenuItem(RightMenu) | |
Insider.pop0.Caption = "Rename Selected" | |
Insider.pop0.OnClick = function() | |
for i = 0, Insider.FileTListBox.Items.Count - 1 do | |
if Insider.FileTListBox.Selected[i] and not string.match(Insider.FileTListBox.Items.String[i], "^USERSCRIPT_") then | |
for a = 0, getMainForm().Menu.Items.Count - 1 do | |
if getMainForm().Menu.Items[a].Name == 'miTable' then | |
local mmi = getMainForm().Menu.Items[a] | |
mmi.doClick() | |
for b = 0, mmi.Count - 1 do | |
if mmi.Item[b].Name == 'miAddFile' then | |
for c = b + 1, mmi.Count - 1 do | |
if Insider.FileContents[i + 1][1] == mmi.Item[c].Caption then | |
local ContextMenu = mmi.Item[c] | |
ContextMenu.Component[0].doClick() | |
break | |
end | |
end | |
break | |
end | |
end | |
break | |
end | |
end | |
break | |
end | |
end | |
Insider.RefreshBTN.OnClick() | |
end | |
Insider.pop.Items.add(Insider.pop0) | |
Insider.pop1 = createMenuItem(RightMenu) | |
Insider.pop1.Caption = "Remove Selected" | |
Insider.pop1.OnClick = function() | |
for i = 0, Insider.FileTListBox.Items.Count - 1 do | |
if Insider.FileTListBox.Selected[i] and not string.match(Insider.FileTListBox.Items.String[i], "^USERSCRIPT_") then | |
for a = 0, getMainForm().Menu.Items.Count - 1 do | |
if getMainForm().Menu.Items[a].Name == 'miTable' then | |
local mmi = getMainForm().Menu.Items[a] | |
mmi.doClick() | |
for b = 0, mmi.Count - 1 do | |
if mmi.Item[b].Name == 'miAddFile' then | |
for c = b + 1, mmi.Count - 1 do | |
if Insider.FileContents[i + 1][1] == mmi.Item[c].Caption then | |
local CM = mmi.Item[c] | |
CM.Component[3].doClick() | |
break | |
end | |
end | |
break | |
end | |
end | |
break | |
end | |
end | |
break | |
end | |
end | |
Insider.RefreshBTN.OnClick() | |
end | |
Insider.pop.Items.add(Insider.pop1) | |
Insider.pop2 = createMenuItem(RightMenu) | |
Insider.pop2.Caption = "Get UserScripts" | |
Insider.pop2.Checked = false | |
Insider.pop2.OnClick = function() | |
if not Insider.pop2.Checked then | |
setProperty(Insider.pop2, "Checked", true) | |
setProperty(Insider.pop2, "Enabled", false) | |
local obj = getFormbyName("TfrmAutoInject") | |
for j = 0, obj.TabCount - 1 do | |
local tmp_name = "USERSCRIPT_" .. j | |
local tmp_datastring = obj.TabScript[j] | |
local tmp_size = string.len(tmp_datastring) | |
local tmp_id = "TabScript_" .. j | |
local mdhash = stringToMD5String(tmp_datastring) | |
Insider.FileTListBox.Items.add(tmp_name) | |
table.insert(Insider.FileContents, {tmp_name, tmp_datastring, tmp_size, tmp_id, mdhash}) | |
end | |
else | |
setProperty(Insider.pop2, "Checked", false) | |
end | |
end | |
Insider.pop.Items.add(Insider.pop2) | |
Insider.pop3 = createMenuItem(RightMenu) | |
Insider.pop3.Caption = "Get Table Scripts" | |
Insider.pop3.OnClick = function() | |
if not Insider.pop3.Checked then | |
setProperty(Insider.pop3, "Checked", true) | |
setProperty(Insider.pop3, "Enabled", false) | |
for i = 0, AddressList.Count - 1 do | |
local B = AddressList.getMemoryRecord(i) | |
if B.getType() == 11 then | |
local UserAAName = "AASCRIPT_" .. i; | |
local UserAAScript = B.Script | |
local UserAASize = string.len(UserAAScript) | |
local UserAAID = "AASCRIPT_" .. i; | |
local savemd = stringToMD5String(UserAAScript) | |
Insider.FileTListBox.Items.add(UserAAName) | |
table.insert(Insider.FileContents, {UserAAName, UserAAScript, UserAASize, UserAAID, savemd}) | |
end | |
end | |
else | |
setProperty(Insider.pop2, "Checked", false) | |
end | |
end | |
Insider.pop.Items.add(Insider.pop3) | |
Insider.pop4 = createMenuItem(RightMenu) | |
Insider.pop4.Caption = "Load from process to table files->" | |
Insider.pop.Items.add(Insider.pop4) | |
Insider.signatures = {{ | |
type = "PNG", | |
sign = "89 50 4E 47 0D 0A 1A 0A", | |
endpoint = "826042AE444E4549", | |
maxcrawl = 50000, | |
data = {} | |
}, { | |
type = "XML", | |
sign = "3C 3F 78 6D 6C", | |
endpoint = "00", | |
maxcrawl = 50000, | |
data = {} | |
}, { | |
type = "Reserved", | |
sign = "00", | |
endpoint = "00", | |
maxcrawl = 0, | |
data = {} | |
}, { | |
type = "JPG", | |
sign = "FF D8 FF E0 00 10 4A 46", | |
endpoint = "FF D9", | |
maxcrawl = 500000, | |
data = {} | |
}, { | |
type = "WAV", | |
sign = "52 49 46 46 ? ? ? ? 57 41 56 45 ? ? ? ? ? ? ? ? 0?", | |
endpoint = "", | |
maxcrawl = 0, | |
data = {} | |
}} | |
Insider.popMenu1 = createMenuItem(RightMenu) | |
Insider.popMenu1.Caption = "Audio -> X" | |
Insider.popMenu1.Visible = false; | |
Insider.pop4.add(Insider.popMenu1) | |
Insider.popMenu2 = createMenuItem(RightMenu) | |
Insider.popMenu2.Caption = "Images -> X" | |
Insider.popMenu2.Visible = false; | |
Insider.pop4.add(Insider.popMenu2) | |
Insider.popMenu21 = createMenuItem(RightMenu) | |
Insider.popMenu21.Caption = "Reserved -> X" | |
Insider.popMenu21.Visible = false; | |
Insider.pop4.add(Insider.popMenu21) | |
Insider.popMenu3 = createMenuItem(RightMenu) | |
Insider.popMenu3.Caption = "Config -> X" | |
Insider.popMenu3.Visible = false; | |
Insider.pop4.add(Insider.popMenu3) | |
Insider.popMenu4 = createMenuItem(RightMenu) | |
Insider.popMenu4.Caption = "Other -> X" | |
Insider.popMenu4.Visible = false; | |
Insider.pop4.add(Insider.popMenu4) | |
Insider.pop41 = createMenuItem(RightMenu) | |
Insider.pop41.Caption = " | *.PNG | " | |
Insider.pop4.add(Insider.pop41) | |
Insider.pop41.OnClick = function() | |
if not readInteger(process) then | |
return | |
end | |
local FoundaList = local_aob_memscan(Insider.signatures[1].sign, 0, 140737488355327) | |
for i = 0, FoundaList.Count - 1 do | |
local a = getAddressSafe(FoundaList[i]) | |
local b | |
local c = a | |
local d | |
local at = 0 | |
while not b do | |
at = at + 1 | |
a = a + 1 | |
if at == Insider.signatures[1].maxcrawl then | |
break | |
end | |
if not readByte(a + 8) then | |
break | |
end | |
if string.format("%X", readQword(a)) == tostring(Insider.signatures[1].endpoint) then | |
b = a | |
d = b - c | |
local t = readBytes(c, d + 8, true) | |
table.insert(Insider.signatures[1].data, { | |
begins = string.format("%X", c), | |
ends = string.format("%X", b), | |
size = d + 8, | |
{stream_string}, | |
{t} | |
}) | |
break | |
end | |
end | |
end | |
for i = 1, #Insider.signatures[1].data do | |
local rel = createTableFile("PNG_" .. i .. "_Read.png") | |
rel.stream.Position = 0 | |
rel.stream.write(Insider.signatures[1].data[i][2][1]) | |
end | |
Insider.RefreshBTN.OnClick() | |
beep() | |
end | |
Insider.pop42 = createMenuItem(RightMenu) | |
Insider.pop42.Caption = " | *.XML | " | |
Insider.pop4.add(Insider.pop42) | |
Insider.pop42.OnClick = function() | |
if not readInteger(process) then | |
return | |
end | |
local FoundaList = local_aob_memscan(Insider.signatures[2].sign, 0, 140737488355327) | |
if FoundaList.Count > 0 then | |
for i = 0, FoundaList.Count - 1 do | |
local a = tonumber(FoundaList.Address[i], 16) | |
local b = a + Insider.signatures[2].maxcrawl | |
local mem = createMemScan() | |
mem.OnlyOneResult = true | |
mem.firstScan(1, 8, 0, Insider.signatures[2].endpoint, nil, a, b, "", 0, "", 1, 0, 0, 0, 0) | |
mem.waitTillDone() | |
if mem.Result then | |
local c = mem.Result | |
local d = c - a | |
local t = readBytes(a, d, true) | |
table.insert(Insider.signatures[2].data, { | |
begins = string.format("%X", a), | |
ends = string.format("%X", c), | |
size = d, | |
{t} | |
}) | |
mem.nextScan() | |
end | |
mem.destroy() | |
end | |
end | |
if #Insider.signatures[2].data == 0 then | |
return | |
end | |
for i = 1, #Insider.signatures[2].data do | |
local rel = createTableFile("XML_" .. i .. "_Read.xml") | |
rel.stream.Position = 0 | |
rel.stream.write(Insider.signatures[2].data[i][1][1]) | |
end | |
Insider.RefreshBTN.OnClick() | |
beep() | |
end | |
Insider.popRES = createMenuItem(RightMenu) | |
Insider.popRES.Caption = " | Reserved for future | " | |
Insider.popRES.Enabled = false; | |
Insider.popRES.Visible = false; | |
Insider.pop4.add(Insider.popRES) | |
Insider.popRES.OnClick = function() | |
if not readInteger(process) then | |
return | |
end | |
local FoundaList = local_aob_memscan(Insider.signatures[2].sign, 0, 140737488355327) | |
if FoundaList.Count > 0 then | |
for i = 0, FoundaList.Count - 1 do | |
local a = tonumber(FoundaList.Address[i], 16) | |
local b = a + Insider.signatures[3].maxcrawl | |
local mem = createMemScan() | |
mem.OnlyOneResult = true | |
mem.firstScan(1, 8, 0, Insider.signatures[3].endpoint, nil, a, b, "", 0, "", 1, 0, 0, 0, 0) | |
mem.waitTillDone() | |
if mem.Result then | |
local c = mem.Result | |
local d = c - a | |
local t = readBytes(a, d, true) | |
table.insert(Insider.signatures[3].data, { | |
begins = string.format("%X", a), | |
ends = string.format("%X", c), | |
size = d, | |
{t} | |
}) | |
mem.nextScan() | |
end | |
mem.destroy() | |
end | |
end | |
if #Insider.signatures[3].data == 0 then | |
return | |
end | |
for i = 1, #Insider.signatures[3].data do | |
local rel = createTableFile("Reserved_" .. i .. "_data") | |
rel.stream.Position = 0 | |
rel.stream.write(Insider.signatures[3].data[i][1][1]) | |
end | |
Insider.RefreshBTN.OnClick() | |
beep() | |
end | |
Insider.pop44 = createMenuItem(RightMenu) | |
Insider.pop44.Caption = " | *.JPG | " | |
Insider.pop4.add(Insider.pop44) | |
Insider.pop44.OnClick = function() | |
local id = 4 | |
local FoundaList = local_aob_memscan(Insider.signatures[id].sign, 0, 140737488355327) | |
if FoundaList.Count > 0 then | |
for i = 0, FoundaList.Count - 1 do | |
local a = tonumber(FoundaList.Address[i], 16) | |
local b = a + Insider.signatures[id].maxcrawl | |
local mem = createMemScan() | |
mem.OnlyOneResult = true | |
mem.firstScan(1, 8, 0, Insider.signatures[id].endpoint, nil, a, b, "", 0, "", 1, 0, 0, 0, 0) | |
mem.waitTillDone() | |
if mem.Result then | |
local c = mem.Result | |
local d = c - a | |
local t = readBytes(a, d, true) | |
table.insert(Insider.signatures[id].data, { | |
begins = string.format("%X", a), | |
ends = string.format("%X", c), | |
size = d, | |
{t} | |
}) | |
mem.nextScan() | |
end | |
mem.destroy() | |
end | |
end | |
if #Insider.signatures[id].data == 0 then | |
return | |
end | |
for i = 1, #Insider.signatures[id].data do | |
local rel = createTableFile("JPG_" .. i .. "_read.jpg") | |
rel.stream.Position = 0 | |
rel.stream.write(Insider.signatures[id].data[i][1][1]) | |
end | |
Insider.RefreshBTN.OnClick() | |
beep() | |
end | |
Insider.pop45 = createMenuItem(RightMenu) | |
Insider.pop45.Caption = " | *.WAV | " | |
Insider.pop4.add(Insider.pop45) | |
Insider.pop45.OnClick = function() | |
local id = 5 | |
local FoundaList = local_aob_memscan(Insider.signatures[id].sign, 0, 140737488355327) | |
if FoundaList.Count > 0 then | |
for i = 0, FoundaList.Count - 1 do | |
local a = tonumber(FoundaList.Address[i], 16) | |
local c = readInteger(a + 4) | |
if c ~= 0 then | |
local b = a + c | |
local t = readBytes(a, c, true) | |
table.insert(Insider.signatures[id].data, { | |
begins = string.format("%X", a), | |
ends = string.format("%X", b), | |
size = c, | |
{t} | |
}) | |
end | |
end | |
end | |
for i = 1, #Insider.signatures[id].data do | |
local rel = createTableFile("WAV" .. i .. "_read.wav") | |
rel.stream.Position = 0 | |
rel.stream.write(Insider.signatures[id].data[i][1][1]) | |
end | |
Insider.RefreshBTN.OnClick() | |
beep() | |
end | |
Insider.pop50 = createMenuItem(RightMenu) | |
Insider.pop50.Caption = "Remove all files from this session at once" | |
Insider.pop50.OnClick = function() | |
for i = 0, getMainForm().Menu.Items.Count - 1 do | |
if getMainForm().Menu.Items[i].Name == 'miTable' then | |
local mmi = getMainForm().Menu.Items[i] | |
mmi.doClick() | |
for u = 0, mmi.Count - 1 do | |
if mmi.Item[u].Name == 'miAddFile' then | |
local u = u + 1 | |
for o = mmi.Count - 1, u, -1 do | |
local filein = mmi.Item[o] | |
filein.Component[3].doClick() | |
end | |
break | |
end | |
end | |
break | |
end | |
end | |
beep() | |
Insider.RefreshBTN.OnClick(_) | |
end | |
Insider.pop.Items.add(Insider.pop50) | |
Insider.pop60 = createMenuItem(RightMenu) | |
Insider.pop60.Caption = "Insider Settings" | |
Insider.pop60.OnClick = function() | |
local offset = 25 | |
if Insider.Settings then | |
Insider.Settings.show() | |
Insider.Settings.Left = Insider.InsiderForm.Left + Insider.InsiderForm.Width + offset | |
Insider.Settings.Top = Insider.InsiderForm.Top | |
else | |
Insider.Settings = createForm() | |
Insider.Settings.ClassName = "TfrmInsiderSettings" | |
Insider.Settings.Name = "InsiderSettings" | |
Insider.Settings.Caption = "Insider Settings" | |
Insider.Settings.setSize(400, 300) | |
Insider.Settings.Intro = createLabel(Insider.Settings) | |
Insider.Settings.Intro.Caption = "OVERRIDE SETTINGS" | |
Insider.Settings.Intro.setPosition(150, 0) | |
Insider.Settings.CapField0 = createLabel(Insider.Settings) | |
Insider.Settings.CapField0.Caption = "Font Size" | |
Insider.Settings.CapField0.setPosition(25, 25) | |
Insider.Settings.Strings = { | |
A = {"Insider.ControlCover.Font.Size", "Insider.synEditLUA.Font.Size", "Insider.synEditCEA.Font.Size"}, | |
B = {"Control Cover", "Lua Editor", "ASM Editor"} | |
} | |
Insider.Settings.Selekta0 = createComboBox(Insider.Settings) | |
Insider.Settings.Selekta0.Text = Insider.Settings.Strings.B[1] | |
Insider.Settings.Selekta0.Items.addText(Insider.Settings.Selekta0.Text) | |
Insider.Settings.Selekta0.Items.addText(Insider.Settings.Strings.B[2]) | |
Insider.Settings.Selekta0.Items.addText(Insider.Settings.Strings.B[3]) | |
Insider.Settings.Selekta0.setSize(300, 0) | |
Insider.Settings.Selekta0.setPosition(0, 50) | |
Insider.Settings.Selekta0.ReadOnly = 1; | |
Insider.Settings.Field0 = createEdit(Insider.Settings) | |
Insider.Settings.Field0.setSize(100, nil) | |
Insider.Settings.Field0.setPosition(300, 50) | |
Insider.Settings.Field0.NumbersOnly = true | |
Insider.Settings.Field0.Text = "" | |
Insider.Settings.BTN0 = createButton(Insider.Settings) | |
Insider.Settings.BTN0.Caption = "Save Settings" | |
Insider.Settings.BTN0.Width = 150 | |
Insider.Settings.BTN0.Height = 50 | |
Insider.Settings.BTN0.setPosition(0, 250) | |
Insider.Settings.BTN0.OnClick = function() | |
if Insider.Settings.Selekta0.Text ~= nil and Insider.Settings.Field0.Text ~= "" then | |
local a = Insider.Settings.Selekta0.Text | |
local b | |
if a == Insider.Settings.Strings.B[1] then | |
b = Insider.Settings.Strings.A[1] | |
elseif a == Insider.Settings.Strings.B[2] then | |
b = Insider.Settings.Strings.A[2] | |
elseif a == Insider.Settings.Strings.B[3] then | |
b = Insider.Settings.Strings.A[3] | |
end | |
if not b then | |
return | |
end | |
loadstring(string.format("%s =" .. Insider.Settings.Field0.Text, b))() | |
beep() | |
end | |
end | |
Insider.Settings.OnClose = function() | |
Insider.Settings.Hide() | |
end | |
Insider.Settings.Left = Insider.InsiderForm.Left + Insider.InsiderForm.Width + offset | |
Insider.Settings.Top = Insider.InsiderForm.Top | |
end | |
end | |
Insider.pop.Items.add(Insider.pop60) | |
Insider.pop0.ImageIndex = 17 | |
Insider.pop1.ImageIndex = 22 | |
Insider.pop2.ImageIndex = 34 | |
Insider.pop3.ImageIndex = 34 | |
Insider.pop50.ImageIndex = 0 | |
Insider.pop60.ImageIndex = 1 | |
Insider.FileTListBox.PopupMenu = Insider.pop | |
Insider.FileInsider = createMemo(Insider.InsiderForm) | |
Insider.FileInsider.setSize(600, 400) | |
Insider.FileInsider.Left = Insider.FileTListBox.Height | |
Insider.FileInsider.Visible = false | |
Insider.FileInsider.ReadOnly = true | |
Insider.FileInsider.setWordWrap(false) | |
Insider.FileInsider.setScrollbars(3) | |
setProperty(Insider.FileInsider, "BorderStyle", bsSizeable) | |
Insider.FileInsider.Anchors = [[akTop,akRight,akLeft,akBottom]] | |
Insider.synEditLUA = createSynEdit(Insider.InsiderForm, 0) | |
Insider.synEditLUA.setSize(500, 500) | |
Insider.synEditLUA.setSize(600, 400) | |
Insider.synEditLUA.Left = Insider.FileTListBox.Height | |
Insider.synEditLUA.ReadOnly = true | |
Insider.synEditLUA.Visible = false | |
setProperty(Insider.synEditLUA, "BorderStyle", bsSizeable) | |
Insider.synEditLUA.Anchors = [[akTop,akRight,akLeft,akBottom]] | |
Insider.synEditLUA.Lines.clear() | |
Insider.synEditLUA.PopupMenu = createPopupMenu(Insider.synEditLUA) | |
Insider.LUApop0 = createMenuItem(Insider.synEditLUA.PopupMenu) | |
Insider.LUApop0.Caption = "Copy LUA" | |
Insider.LUApop0.OnClick = function() | |
Insider.synEditLUA.CopyToClipboard(Insider.synEditLUA.SelText) | |
end | |
Insider.synEditLUA.PopupMenu.Items.add(Insider.LUApop0) | |
Insider.LUApop0b = createMenuItem(Insider.synEditLUA.PopupMenu) | |
Insider.LUApop0b.Caption = "Paste to Lua" | |
Insider.LUApop0b.OnClick = function() | |
Insider.synEditLUA.PasteFromClipboard() | |
end | |
Insider.synEditLUA.PopupMenu.Items.add(Insider.LUApop0b) | |
Insider.LUApop1 = createMenuItem(Insider.synEditLUA.PopupMenu) | |
Insider.LUApop1.Caption = "Try to Format" | |
Insider.LUApop1.OnClick = function() | |
local newFormat = Insider.tryformatdocument(Insider.synEditLUA.Lines.Text) | |
Insider.synEditLUA.Lines.Text = newFormat | |
end | |
Insider.synEditLUA.PopupMenu.Items.add(Insider.LUApop1) | |
if getScreenDPI() > 100 then | |
Insider.synEditLUA.Font.Size = 10 | |
end | |
Insider.synEditCEA = createSynEdit(Insider.InsiderForm, 1) | |
Insider.synEditCEA.setSize(500, 500) | |
Insider.synEditCEA.setSize(600, 400) | |
Insider.synEditCEA.Left = Insider.FileTListBox.Height | |
Insider.synEditCEA.ReadOnly = true | |
Insider.synEditCEA.Visible = false | |
setProperty(Insider.synEditLUA, "BorderStyle", bsSizeable) | |
Insider.synEditCEA.Anchors = [[akTop,akRight,akLeft,akBottom]] | |
Insider.synEditCEA.Lines.clear() | |
Insider.synEditCEA.PopupMenu = createPopupMenu(Insider.synEditCEA) | |
Insider.CEApop0 = createMenuItem(Insider.synEditCEA.PopupMenu) | |
Insider.CEApop0.Caption = "Copy CEASM" | |
Insider.CEApop0.OnClick = function() | |
Insider.synEditCEA.CopyToClipboard(Insider.synEditCEA.SelText) | |
end | |
Insider.synEditCEA.PopupMenu.Items.add(Insider.CEApop0) | |
Insider.CEApop0b = createMenuItem(Insider.synEditCEA.PopupMenu) | |
Insider.CEApop0b.Caption = "Paste to CEASM" | |
Insider.CEApop0b.OnClick = function() | |
Insider.synEditCEA.PasteFromClipboard() | |
end | |
Insider.synEditCEA.PopupMenu.Items.add(Insider.CEApop0b) | |
Insider.CEApop1 = createMenuItem(Insider.synEditCEA.PopupMenu) | |
Insider.CEApop1.Caption = "Try to Format" | |
Insider.CEApop1.OnClick = function() | |
local newFormat = Insider.tryformatdocument(Insider.synEditCEA.Lines.Text) | |
Insider.synEditCEA.Lines.Text = newFormat | |
end | |
Insider.synEditCEA.PopupMenu.Items.add(Insider.CEApop1) | |
if getScreenDPI() > 100 then | |
Insider.synEditCEA.Font.Size = 10 | |
end | |
Insider.ControlCover = createGroupBox(Insider.InsiderForm) | |
Insider.ControlCover.setSize(590, 130) | |
Insider.ControlCover.setPosition(405, 400) | |
Insider.ControlCover.Anchors = [[akBottom,akRight]] | |
if getScreenDPI() > 100 then | |
Insider.ControlCover.Font.Size = 7 | |
end | |
Insider.SaveBTN = createButton(Insider.ControlCover) | |
Insider.SaveBTN.Anchors = [[akBottom,akRight]] | |
Insider.SaveBTN.Caption = "Save" | |
Insider.SaveBTN.Enabled = false | |
Insider.SaveBTN.setPosition(5, 25) | |
Insider.SaveBTN.OnClick = function() | |
setProperty(Insider.SaveBTN, 'Enabled', false) | |
for i = 0, Insider.FileTListBox.Items.Count - 1 do | |
local lofi = string.lower(Insider.FileContents[i + 1][1]) | |
if Insider.FileTListBox.Selected[i] and (not string.match(lofi, "^userscript_")) and | |
(not string.match(lofi, "^aascript_")) then | |
local UpdateStream = findTableFile(lofi).stream | |
if string.len(Insider.FileInsider.getLines().Text) < Insider.FileContents[i + 1][3] then | |
UpdateStream.Size = string.len(Insider.FileInsider.getLines().Text) | |
end | |
if string.find(lofi, "%.lua$") then | |
Insider.FileContents[i + 1][2] = Insider.synEditLUA.Lines.Text | |
UpdateStream.Position = 0 | |
UpdateStream.write(stringToByteTable(Insider.FileContents[i + 1][2])) | |
elseif string.find(lofi, "%.cea$") then | |
Insider.FileContents[i + 1][2] = Insider.synEditCEA.Lines.Text | |
UpdateStream.Position = 0 | |
UpdateStream.write(stringToByteTable(Insider.FileContents[i + 1][2])) | |
else | |
Insider.FileContents[i + 1][2] = Insider.FileInsider.getLines().Text | |
UpdateStream.Position = 0 | |
UpdateStream.write(stringToByteTable(Insider.FileContents[i + 1][2])) | |
end | |
local tmpsize = UpdateStream.Size | |
Insider.SFSLabel.Caption = "Selected File Size : " .. tmpsize | |
Insider.FileContents[i + 1][3] = tmpsize | |
Insider.FileContents[i + 1][5] = stringToMD5String(Insider.FileContents[i + 1][2]) | |
Insider.md5check.Caption = "MD5: " .. Insider.FileContents[i + 1][5] | |
break | |
elseif Insider.FileTListBox.Selected[i] and string.match(lofi, "^userscript_") then | |
local obj = getFormbyName("TfrmAutoInject"); | |
for j = 0, obj.TabCount - 1 do | |
if j == tonumber(string.match(Insider.FileTListBox.Items.String[i], "^USERSCRIPT_(%d+)")) then | |
obj.TabScript[j] = Insider.synEditLUA.Lines.Text | |
Insider.FileContents[i + 1][2] = Insider.synEditLUA.Lines.Text | |
local tmpsize = string.len(Insider.synEditLUA.Lines.Text) | |
Insider.SFSLabel.Caption = "Selected File Size : " .. tmpsize | |
Insider.FileContents[i + 1][3] = tmpsize | |
Insider.FileContents[i + 1][5] = stringToMD5String(Insider.FileContents[i + 1][2]) | |
Insider.md5check.Caption = "MD5: " .. Insider.FileContents[i + 1][5] | |
end | |
end | |
break | |
elseif Insider.FileTListBox.Selected[i] and string.match(lofi, "^aascript_") then | |
for j = 0, AddressList.Count - 1 do | |
if j == tonumber(string.match(Insider.FileTListBox.Items.String[i], "^AASCRIPT_(%d+)")) then | |
AddressList.getMemoryRecord(j).Script = Insider.synEditCEA.Lines.Text | |
Insider.FileContents[i + 1][2] = Insider.synEditCEA.Lines.Text | |
break | |
end | |
end | |
local tmpsize = string.len(Insider.synEditCEA.Lines.Text) | |
Insider.SFSLabel.Caption = "Selected File Size : " .. tmpsize | |
Insider.FileContents[i + 1][3] = tmpsize | |
Insider.FileContents[i + 1][5] = stringToMD5String(Insider.FileContents[i + 1][2]) | |
Insider.md5check.Caption = "MD5: " .. Insider.FileContents[i + 1][5] | |
setProperty(Insider.CEApop1, 'Enabled', false) | |
break | |
end | |
end | |
setProperty(Insider.EditBTN, 'Enabled', true) | |
end | |
Insider.EditBTN = createButton(Insider.ControlCover) | |
Insider.EditBTN.Anchors = [[akBottom,akRight]] | |
Insider.EditBTN.Caption = "Edit" | |
Insider.EditBTN.Enabled = false | |
Insider.EditBTN.Top = Insider.SaveBTN.Top | |
Insider.EditBTN.Left = Insider.SaveBTN.Width + Insider.SaveBTN.Left | |
Insider.EditBTN.OnClick = function() | |
setProperty(Insider.EditBTN, 'Enabled', false) | |
setProperty(Insider.FileInsider, 'ReadOnly', false) | |
setProperty(Insider.SaveBTN, 'Enabled', true) | |
for i = 0, Insider.FileTListBox.Items.Count - 1 do | |
if Insider.FileTListBox.Selected[i] then | |
local lofi = string.lower(Insider.FileContents[i + 1][1]) | |
if string.find(lofi, "%.lua$") or string.match(lofi, "^userscript_") then | |
setProperty(Insider.synEditCEA, 'ReadOnly', true) | |
setProperty(Insider.synEditLUA, 'ReadOnly', false) | |
setProperty(Insider.SaveBTN, 'Enabled', true) | |
setProperty(Insider.LUApop1, 'Enabled', true) | |
setProperty(Insider.LUApop0b, 'Enabled', true) | |
elseif string.find(lofi, "%.cea$") or string.match(lofi, "^aascript_") then | |
setProperty(Insider.synEditLUA, 'ReadOnly', true) | |
setProperty(Insider.synEditCEA, 'ReadOnly', false) | |
setProperty(Insider.SaveBTN, 'Enabled', true) | |
setProperty(Insider.CEApop1, 'Enabled', true) | |
setProperty(Insider.CEApop0b, 'Enabled', true) | |
else | |
setProperty(Insider.EditBTN, 'Enabled', false) | |
setProperty(Insider.FileInsider, 'ReadOnly', false) | |
setProperty(Insider.SaveBTN, 'Enabled', true) | |
end | |
break | |
end | |
end | |
end | |
Insider.ExtractBTN = createButton(Insider.ControlCover) | |
Insider.ExtractBTN.Anchors = [[akBottom,akRight]] | |
Insider.ExtractBTN.Caption = "Extract" | |
Insider.ExtractBTN.Enabled = false | |
Insider.ExtractBTN.Top = Insider.SaveBTN.Top | |
Insider.ExtractBTN.Left = Insider.SaveBTN.Width + Insider.SaveBTN.Left + Insider.EditBTN.Width | |
setProperty(Insider.ExtractBTN, 'ShowHint', true) | |
setProperty(Insider.ExtractBTN, 'Hint', | |
"\n Extracts selected file directly to Cheat Engine directory (there you launched CE from) \n OR there you launched cheat table") | |
Insider.ExtractBTN.OnClick = function() | |
for i = 0, Insider.FileTListBox.Items.Count - 1 do | |
if Insider.FileTListBox.Selected[i] then | |
local sobject = findTableFile(Insider.FileContents[i + 1][1]) | |
beep() | |
return sobject.saveToFile(Insider.FileContents[i + 1][1]) | |
end | |
end | |
end | |
Insider.LoadBTN = createButton(Insider.ControlCover) | |
Insider.LoadBTN.Anchors = [[akBottom,akRight]] | |
Insider.LoadBTN.Caption = "Load" | |
Insider.LoadBTN.Enabled = true | |
Insider.LoadBTN.Top = Insider.SaveBTN.Top | |
Insider.LoadBTN.Left = Insider.ExtractBTN.Left + Insider.ExtractBTN.Width | |
Insider.LoadBTN.OnClick = function() | |
for i = 0, getMainForm().Menu.Items.Count - 1 do | |
if getMainForm().Menu.Items[i].Name == 'miTable' then | |
local mmi = getMainForm().Menu.Items[i] | |
mmi.doClick() | |
for u = 0, mmi.Count - 1 do | |
if mmi.Item[u].Name == 'miAddFile' then | |
local m = mmi.Item[u] | |
m.OnClick(_) | |
break | |
end | |
end | |
break | |
end | |
end | |
Insider.RefreshBTN.OnClick() | |
end | |
Insider.CreateBTN = createButton(Insider.ControlCover) | |
Insider.CreateBTN.Anchors = [[akBottom,akRight]] | |
Insider.CreateBTN.Caption = "Create NEW file Without extension" | |
Insider.CreateBTN.Enabled = true | |
Insider.CreateBTN.Width = 300 | |
Insider.CreateBTN.Top = Insider.SaveBTN.Top - Insider.EditBTN.Height | |
Insider.CreateBTN.Left = Insider.SaveBTN.Left | |
Insider.CreateBTN.OnClick = function() | |
createTableFile("File_" .. math.random(0, 123456789)) | |
Insider.RefreshBTN.OnClick(_) | |
end | |
Insider.ExecBTN = createButton(Insider.ControlCover) | |
Insider.ExecBTN.Anchors = [[akBottom,akRight]] | |
Insider.ExecBTN.Caption = "Execute" | |
Insider.ExecBTN.Enabled = false | |
Insider.ExecBTN.Width = 90 | |
Insider.ExecBTN.Height = 50 | |
Insider.ExecBTN.Top = Insider.SaveBTN.Top - Insider.EditBTN.Height | |
Insider.ExecBTN.Left = Insider.CreateBTN.Left + Insider.CreateBTN.Width | |
Insider.ExecBTN.OnClick = function() | |
getProperty(Insider.ExecBTN, 'Enabled', false) | |
for i = 0, Insider.FileTListBox.Items.Count - 1 do | |
if Insider.FileTListBox.Selected[i] then | |
if string.find(Insider.FileContents[i + 1][1], "%.lua$") or | |
string.match(Insider.FileTListBox.Items.String[i], "^USERSCRIPT_") then | |
local UserluaCode = Insider.synEditLUA.Lines.Text | |
local fxok, badfx = load(UserluaCode) | |
if fxok then | |
pcall(fxok) | |
else | |
print("Error loading script: " .. tostring(badfx)) | |
end | |
elseif string.find(Insider.FileContents[i + 1][1], "%.CEA$") or | |
string.match(Insider.FileTListBox.Items.String[i], "^AASCRIPT_") then | |
local UserASMscript = Insider.synEditCEA.Lines.Text | |
local response, status = autoAssembleCheck(UserASMscript) | |
if not status and response then | |
_, lookup = autoAssemble(UserASMscript); | |
if _ ~= false then | |
for key, value in pairs(lookup.allocs) do | |
if type(value) == "table" and value.address then | |
local address = value.address | |
local info = messageDialog("New allocation at " .. string.format("%X", address), | |
mtInformation, mbOK, mbCancel) | |
break | |
end | |
end | |
else | |
messageDialog(lookup, mtWarning) | |
end | |
else | |
messageDialog(status, mtWarning) | |
end | |
elseif string.find(Insider.FileContents[i + 1][1], "%.ps1$") then | |
local command = | |
"-NoProfile -ExecutionPolicy Bypass -Command \"" .. Insider.FileInsider.getLines().Text .. | |
"\"; pause" | |
shellExecute("powershell", command) | |
elseif string.find(Insider.FileContents[i + 1][1], "%.bat$") then | |
local myscript = Insider.FileInsider.getLines().Text | |
myscript = myscript:gsub("[^\r\n]+", function(line) | |
if line:find("^%s*REM") then | |
return "" | |
else | |
return line | |
end | |
end) | |
myscript = myscript:gsub("^%s*(.-)%s*$", "%1"):gsub("\n+", " & ") | |
myscript = myscript:gsub("&%s*$", "") | |
myscript = myscript:gsub("[^\r\n]+", function(line) | |
if line:match("^%s*&+%s*$") then | |
return "" | |
else | |
return line | |
end | |
end) | |
return shellExecute("cmd", "/c " .. myscript .. "& pause") | |
elseif string.find(Insider.FileContents[i + 1][1], "%.py$") then | |
local UserPYcode = Insider.FileInsider.getLines().Text | |
UserPYcode = UserPYcode:gsub("^%s*(.-)%s*$", "%1") | |
UserPYcode = UserPYcode:gsub("\n", "; ") | |
local c = "python" .. ' -c "' .. UserPYcode .. '"' | |
shellExecute("cmd.exe", "/c " .. c .. "& pause") | |
end | |
break | |
end | |
end | |
getProperty(Insider.ExecBTN, 'Enabled', true) | |
end | |
Insider.RefreshBTN = createButton(Insider.ControlCover) | |
Insider.RefreshBTN.Anchors = [[akBottom,akRight]] | |
Insider.RefreshBTN.Caption = "Reload File list" | |
Insider.RefreshBTN.setPosition(155, 50) | |
Insider.RefreshBTN.Width = 150 | |
Insider.RefreshBTN.OnClick = function() | |
setProperty(Insider.FileInsider, 'ReadOnly', true) | |
setProperty(Insider.EditBTN, 'Enabled', false) | |
setProperty(Insider.SaveBTN, 'Enabled', false) | |
setProperty(Insider.ExecBTN, 'Enabled', false) | |
setProperty(Insider.ExtractBTN, 'Enabled', false) | |
setProperty(Insider.LoadBTN, 'Enabled', true) | |
setProperty(Insider.CreateBTN, 'Enabled', true) | |
setProperty(Insider.synEditLUA, 'ReadOnly', true) | |
setProperty(Insider.synEditLUA, 'Visible', false) | |
setProperty(Insider.synEditCEA, 'ReadOnly', true) | |
setProperty(Insider.synEditCEA, 'Visible', false) | |
setProperty(Insider.FileInsider, 'Visible', false) | |
Insider.FileTListBox.clear() | |
Insider.local_Insider_LoadFileList() | |
setProperty(Insider.pop2, 'Checked', false) | |
setProperty(Insider.pop2, 'Enabled', true) | |
setProperty(Insider.pop3, 'Checked', false) | |
setProperty(Insider.pop3, 'Enabled', true) | |
end | |
Insider.PicageBTN = createButton(Insider.InsiderForm) | |
Insider.PicageBTN.Caption = "Load Full Image Preview" | |
Insider.PicageBTN.Anchors = [[akBottom,akLeft]] | |
Insider.PicageBTN.Height = 82 | |
Insider.PicageBTN.Width = 382 | |
Insider.PicageBTN.Left = 8 | |
Insider.PicageBTN.Top = 408 | |
Insider.PicageBTN.Visible = false | |
Insider.PicageBTN.OnClick = function() | |
Insider.InsiderForm.Visible = false; | |
local tmpform = createForm() | |
tmpform.Name = "TempIMGPreviewForm" | |
tmpform.Caption = "an IMAGE preview" | |
tmpform.BorderStyle = [[bsSizeable]] | |
tmpform.Width = Insider.image.Picture.Bitmap.getWidth() | |
tmpform.Height = Insider.image.Picture.Bitmap.getHeight() | |
Insider.image.setParent(tmpform) | |
Insider.image.setPosition(0, 0) | |
Insider.image.AutoSize = true | |
tmpform.OnClose = function() | |
Insider.image.setParent(Insider.InsiderForm) | |
Insider.image.setPosition(400, 0) | |
Insider.image.Picture.Bitmap.setHeight(400) | |
Insider.image.Picture.Bitmap.setWidth(400) | |
tmpform.destroy() | |
Insider.InsiderForm.Visible = true; | |
Insider.PicageBTN.Visible = false; | |
end | |
end | |
Insider.WAVPlayBTN = createButton(Insider.InsiderForm) | |
Insider.WAVPlayBTN.Caption = "Play WAV file" | |
Insider.WAVPlayBTN.Anchors = [[akBottom,akLeft]] | |
Insider.WAVPlayBTN.Height = 82 | |
Insider.WAVPlayBTN.Width = 382 | |
Insider.WAVPlayBTN.Left = 8 | |
Insider.WAVPlayBTN.Top = 408 | |
Insider.WAVPlayBTN.Visible = false | |
Insider.WAVPlayBTN.OnClick = function() | |
for i = 0, Insider.FileTListBox.Items.Count - 1 do | |
if Insider.FileTListBox.Selected[i] then | |
playSound(findTableFile(Insider.FileContents[i + 1][1]), true) | |
break | |
end | |
end | |
end | |
Insider.FileInsiderWordWarp = createCheckBox(Insider.ControlCover) | |
Insider.FileInsiderWordWarp.Anchors = [[akBottom,akRight]] | |
Insider.FileInsiderWordWarp.Caption = "Word Warp" | |
Insider.FileInsiderWordWarp.setPosition(5, 50) | |
Insider.FileInsiderWordWarp.OnChange = function() | |
if Insider.FileInsiderWordWarp.Checked then | |
setProperty(Insider.FileInsider, "WordWrap", true) | |
else | |
setProperty(Insider.FileInsider, "WordWrap", false) | |
end | |
end | |
Insider.local_Insider_LoadFileList = function() | |
local count = 0 | |
local dupTrack = {} | |
for i = 0, getMainForm().Menu.Items.Count - 1 do | |
if getMainForm().Menu.Items[i].Name == 'miTable' then | |
local mmi = getMainForm().Menu.Items[i] | |
mmi.doClick() | |
for u = 0, mmi.Count - 1 do | |
if mmi.Item[u].Name == 'miAddFile' then | |
Insider.FileContents = {}; | |
for o = u + 1, mmi.Count - 1 do | |
local string_caption = mmi.Item[o].Caption | |
if not dupTrack[string_caption] then | |
dupTrack[string_caption] = true | |
else | |
messageDialog("Duplicate file name has been detected please rename file named.. " .. | |
string_caption) | |
local a = messageDialog([[ | |
... Found duplicate file names which will cause issues ... | |
Press -- to: | |
[ OK ] -- Rename files | |
[ Cancel ] -- Stop loading file viewer | |
[ Ignore ] -- Proceed without renaming files | |
]], mtWarning, mbOK, mbCancel, mbIgnore) | |
if a == 1 then | |
for k = 0, mmi.Item[o].ComponentCount - 1 do | |
if mmi.Item[o].Component[k].Caption == 'Rename' then | |
while mmi.Item[o].Caption == string_caption do | |
getMainForm().Menu.Items[i].Item[o].Component[k].doClick() | |
getMainForm().Menu.Items[i].doClick() | |
end | |
break | |
end | |
end | |
string_caption = mmi.Item[o].Caption | |
elseif a == 2 then | |
return Insider.InsiderForm.close() | |
elseif a == 5 then | |
end | |
end | |
Insider.FileTListBox.Items.add(string_caption) | |
Insider.tableStream = findTableFile(string_caption).stream | |
if Insider.tableStream ~= nil then | |
Insider.tableStream.Position = 0 | |
local szstream = Insider.tableStream.Size | |
local localbytes = {} | |
for _ = 1, szstream do | |
local byte = Insider.tableStream.readByte(_) | |
if byte ~= 0 then | |
table.insert(localbytes, string.char(byte)) | |
end | |
end | |
local str = table.concat(localbytes) | |
local updatecalls = stringToMD5String(str) | |
table.insert(Insider.FileContents, {string_caption, str, szstream, count, updatecalls}) | |
end | |
count = count + 1 | |
end | |
break | |
end | |
end | |
break | |
end | |
end | |
end | |
Insider.local_Insider_LoadFileList() | |
if not Insider.InsiderForm then | |
return | |
end | |
Insider.FileCount = #Insider.FileContents | |
Insider.SFSLabel = createLabel(Insider.ControlCover) | |
Insider.SFSLabel.Anchors = [[akLeft]] | |
Insider.SFSLabel.Caption = "Selected File Size : ?" | |
setProperty(Insider.SFSLabel, 'ShowHint', true) | |
Insider.SFSLabel.setPosition(400, 50) | |
Insider.IDLabel = createLabel(Insider.ControlCover) | |
Insider.IDLabel.Anchors = [[akLeft]] | |
Insider.IDLabel.Caption = "Selected File ID : ?" | |
setProperty(Insider.IDLabel, 'ShowHint', true) | |
Insider.IDLabel.setPosition(400, 0) | |
Insider.Fllcount = createLabel(Insider.ControlCover) | |
Insider.Fllcount.Anchors = [[akBottom,akRight]] | |
Insider.Fllcount.Caption = "Files : " .. #Insider.FileContents | |
Insider.Fllcount.setPosition(400, 25) | |
Insider.md5check = createLabel(Insider.ControlCover) | |
Insider.md5check.Caption = "MD5: ?" | |
Insider.md5check.setPosition(5, 75) | |
Insider.md5check.Anchors = [[akLeft]] | |
Insider.CESFTV = createTimer(Insider.ControlCover) | |
Insider.CESFTV.Interval = 1327 | |
Insider.known_selected = -1 | |
Insider.CESFTV.Ontimer = function() | |
if Insider.FileCount == Insider.getTableFileCount() then -- IDK about this | |
for i = 0, Insider.FileTListBox.Items.Count - 1 do | |
if Insider.FileTListBox.Selected[i] and Insider.known_selected ~= Insider.FileTListBox.Items[i] then | |
Insider.SFSLabel.Caption = "Selected File Size : " .. Insider.FileContents[i + 1][3] | |
Insider.SaveBTN.Hint = "\n" .. Insider.FileContents[i + 1][3] | |
Insider.IDLabel.Caption = "Selected File ID : " .. Insider.FileContents[i + 1][4] | |
Insider.IDLabel.Hint = "\n" .. Insider.FileContents[i + 1][4] | |
Insider.md5check.Caption = "MD5: " .. Insider.FileContents[i + 1][5] | |
setProperty(Insider.FileInsiderWordWarp, 'Checked', false) | |
setProperty(Insider.FileInsider, 'ReadOnly', true) | |
setProperty(Insider.synEditLUA, 'ReadOnly', true) | |
setProperty(Insider.synEditLUA, 'Visible', false) | |
setProperty(Insider.synEditCEA, 'ReadOnly', true) | |
setProperty(Insider.synEditCEA, 'Visible', false) | |
setProperty(Insider.FileInsider, 'Visible', false) | |
setProperty(Insider.EditBTN, 'Enabled', false) | |
setProperty(Insider.SaveBTN, 'Enabled', false) | |
setProperty(Insider.ExecBTN, 'Enabled', false) | |
setProperty(Insider.ExtractBTN, 'Enabled', true) | |
setProperty(Insider.LoadBTN, 'Enabled', true) | |
setProperty(Insider.CreateBTN, 'Enabled', true) | |
setProperty(Insider.CEApop1, 'Enabled', false) | |
setProperty(Insider.CEApop0b, 'Enabled', false) | |
setProperty(Insider.LUApop1, 'Enabled', false) | |
setProperty(Insider.LUApop0b, 'Enabled', false) | |
setProperty(Insider.WAVPlayBTN, 'Visible', false) | |
if Insider.image then | |
Insider.image.destroy(); | |
Insider.image = nil; | |
end | |
local lofi = string.lower(Insider.FileContents[i + 1][1]) | |
if string.find(lofi, "%.txt$") then | |
setProperty(Insider.synEditLUA, 'Visible', false) | |
setProperty(Insider.EditBTN, 'Enabled', true) | |
setProperty(Insider.FileInsider, 'Visible', true) | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', true) | |
setProperty(Insider.PicageBTN, 'Visible', false) | |
elseif string.find(lofi, "%.lua$") then | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', false) | |
Insider.synEditLUA.Lines.clear() | |
Insider.synEditLUA.Lines.addText(Insider.FileContents[i + 1][2]) | |
setProperty(Insider.synEditCEA, 'Visible', false) | |
setProperty(Insider.synEditLUA, 'Visible', true) | |
setProperty(Insider.ExecBTN, 'Enabled', true) | |
setProperty(Insider.EditBTN, 'Enabled', true) | |
setProperty(Insider.FileInsider, 'Visible', false) | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', false) | |
setProperty(Insider.PicageBTN, 'Visible', false) | |
elseif string.find(lofi, "%.cea$") then | |
Insider.synEditCEA.Lines.clear() | |
Insider.synEditCEA.Lines.addText(Insider.FileContents[i + 1][2]) | |
setProperty(Insider.synEditCEA, 'Visible', true) | |
setProperty(Insider.synEditLUA, 'Visible', false) | |
setProperty(Insider.ExecBTN, 'Enabled', true) | |
setProperty(Insider.EditBTN, 'Enabled', true) | |
setProperty(Insider.FileInsider, 'Visible', false) | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', false) | |
setProperty(Insider.PicageBTN, 'Visible', false) | |
elseif string.find(lofi, "%.png") or string.find(lofi, "%.bmp") or string.find(lofi, "%.jpg") then | |
if Insider.ImagePreviewobject then | |
Insider.ImagePreviewobject.destroy() | |
end | |
Insider.ImagePreviewobject = nil; | |
Insider.ImagePreviewobject = createImage(Insider.InsiderForm) | |
setProperty(Insider.synEditLUA, 'Visible', false) | |
setProperty(Insider.FileInsider, 'Visible', false) | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', false) | |
Insider.ImagePreviewobject.setPosition(400, 0) | |
Insider.ImagePreviewobject.setSize(400, 400) | |
local a = Insider.ImagePreviewobject.loadImageFromFile(Insider.FileContents[i + 1][1]) | |
if not a then | |
setProperty(Insider.PicageBTN, 'Visible', true) | |
Insider.image = createImage(Insider.InsiderForm) | |
Insider.image.setPosition(400, 0) | |
Insider.image.setSize(400, 400) | |
Insider.image.picture.loadFromStream(findTableFile(Insider.FileContents[i + 1][1]).Stream); | |
end | |
elseif string.find(lofi, "%.ps1$") or string.find(lofi, "%.bat$") then | |
setProperty(Insider.synEditLUA, 'Visible', false) | |
setProperty(Insider.EditBTN, 'Enabled', true) | |
setProperty(Insider.FileInsider, 'Visible', true) | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', true) | |
setProperty(Insider.PicageBTN, 'Visible', false) | |
setProperty(Insider.ExecBTN, 'Enabled', true) | |
elseif string.find(lofi, "%.ct$") then | |
setProperty(Insider.synEditLUA, 'Visible', false) | |
setProperty(Insider.EditBTN, 'Enabled', true) | |
setProperty(Insider.FileInsider, 'Visible', true) | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', true) | |
setProperty(Insider.PicageBTN, 'Visible', false) | |
elseif string.find(lofi, "%.py$") then | |
setProperty(Insider.synEditLUA, 'Visible', false) | |
setProperty(Insider.EditBTN, 'Enabled', true) | |
setProperty(Insider.FileInsider, 'Visible', true) | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', true) | |
setProperty(Insider.PicageBTN, 'Visible', false) | |
setProperty(Insider.ExecBTN, 'Enabled', true) | |
elseif string.match(lofi, "^userscript_") then | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', false) | |
Insider.synEditLUA.Lines.clear() | |
Insider.synEditLUA.Lines.addText(Insider.FileContents[i + 1][2]) | |
setProperty(Insider.synEditCEA, 'Visible', false) | |
setProperty(Insider.synEditLUA, 'Visible', true) | |
setProperty(Insider.ExecBTN, 'Enabled', true) | |
setProperty(Insider.EditBTN, 'Enabled', true) | |
setProperty(Insider.FileInsider, 'Visible', false) | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', false) | |
setProperty(Insider.PicageBTN, 'Visible', false) | |
setProperty(Insider.ExtractBTN, 'Enabled', false) | |
elseif string.match(lofi, "^aascript_") then | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', false) | |
Insider.synEditCEA.Lines.clear() | |
Insider.synEditCEA.Lines.addText(Insider.FileContents[i + 1][2]) | |
setProperty(Insider.synEditCEA, 'Visible', true) | |
setProperty(Insider.synEditLUA, 'Visible', false) | |
setProperty(Insider.ExecBTN, 'Enabled', true) | |
setProperty(Insider.EditBTN, 'Enabled', true) | |
setProperty(Insider.FileInsider, 'Visible', false) | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', false) | |
setProperty(Insider.PicageBTN, 'Visible', false) | |
setProperty(Insider.ExtractBTN, 'Enabled', false) | |
elseif string.find(lofi, "%.wav$") then | |
setProperty(Insider.WAVPlayBTN, 'Enabled', true) | |
setProperty(Insider.WAVPlayBTN, 'Visible', true) | |
else | |
setProperty(Insider.synEditCEA, 'Visible', false) | |
setProperty(Insider.synEditLUA, 'Visible', false) | |
setProperty(Insider.EditBTN, 'Enabled', true) | |
setProperty(Insider.FileInsider, 'Visible', true) | |
setProperty(Insider.FileInsiderWordWarp, 'Enabled', true) | |
end | |
Insider.known_selected = Insider.FileTListBox.Items[i] | |
Insider.FileInsider.clear() | |
Insider.FileInsider.SelText = Insider.FileContents[i + 1][2] | |
end | |
end | |
else | |
Insider.RefreshBTN.OnClick(_) | |
Insider.FileCount = #Insider.FileContents | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1019 Topic