Game Hacking Dojo Master Cheater
  Reputation: 1
  Joined: 17 Sep 2023 Posts: 250
 
  | 
		
			
				 Posted: Wed May 08, 2024 5:11 am    Post subject: Auto-Load Corresponding Cheat Table On Attach | 
				       | 
			 
			
				
  | 
			 
			
				This script will auto-load your cheat table once you attach CE to the process.
 
It will prompt you with a dialogue if it finds more than two files matching the description.
 
It will search for your cheat table in the specified folder.
 
 
Tip: Make a directory for all game hacks and subdirectories for each title.
 
 
All automated and GL HF
 
 
 	  | Code: | 	 		  local lfs = require("lfs")
 
local file = ""
 
local foundFile = ""
 
local foundFilePath = ""
 
local fileDir = ""
 
local searchDirectory = "D:\\myDirectory\\mySubDirectory\\Game Hacks"
 
local fileExtension = ".ct"
 
 
function getCTfile()
 
   local foundFileCount = 0
 
   local processName = process:gsub("%.exe$", "")
 
   for _,filePath in ipairs(getFileList(searchDirectory, '*.ct', true)) do
 
     --print(file)
 
     if string.find(string.lower(filePath), string.lower(processName), 1, true) then
 
        foundFileCount = foundFileCount + 1
 
 
        --print("Found file full path: "..filePath)
 
        file = extractFileName(filePath)
 
        --print("Found file name: "..file)
 
        fileDir = extractFilePath(filePath)
 
        --print("Found file directory: "..fileDir)
 
        foundFile = file
 
        foundFilePath = filePath
 
 
       if foundFileCount > 1 then
 
          --Load Dialog
 
         loadCTDialog = createOpenDialog()
 
         loadCTDialog.Title = "Load Cheat Table"
 
         loadCTDialog.FileName = foundFile
 
         loadCTDialog.InitialDir = fileDir
 
         loadCTDialog.DefaultExt = ".ct"
 
         loadCTDialog.Filter = "Cheat Table Files (*.ct)|*.ct"
 
         loadCTDialog.Options = "[ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]"
 
           --print("Found more than one file matching the description")
 
 
         if loadCTDialog.Execute() then
 
            loadTable(loadCTDialog.FileName)
 
         else
 
            return
 
         end
 
        end
 
     end
 
   end
 
     if foundFileCount == 1 then
 
      loadTable(foundFilePath)
 
      --ShowMessage("*** Cheat table has been load ***\n *** "..foundFile.." ***")
 
   end
 
end
 
 
MainForm.OnProcessOpened = function()
 
   createThread(function()   getCTfile() end)
 
end | 	 
  | 
			 
		  |