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 


I2 Cheat Engine CEA File Assembler

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting -> Lua Extensions
View previous topic :: View next topic  
Author Message
TheyCallMeTim13
Wiki Contributor
Reputation: 6

Joined: 24 Feb 2017
Posts: 161
Location: Right Here Buddy.

PostPosted: Sun Dec 31, 2017 8:27 pm    Post subject: I2 Cheat Engine CEA File Assembler Reply with quote


I2 Cheat Engine CEA File Assembler



A Lua module for using external CEA files in a Cheat Engine table.



Version: 1.0.3



The Doc String.
Code:

--[====================================================================================================================[

I2 Cheat Engine CEA File Assembler

   Version: 1.0.3
      1.0.1:
         * First release.
      1.0.2:
         * Fixed load error.
      1.0.3:
         * Added reset function, to reset the state of all assembled scripts.
         * Changed "autoAssembleFile" to work as toggle, with optional "forceDisable".

   Author: Matt - TheyCallMeTim13 - MattI2.com


   Features:
      - A Lua module for assembling CEA files be it, table files or local files, in a Cheat Engine table.
         Note: Local files will override the table files, this is meant for updating scripts.
      - Really the only function meant to be used is autoAssembleFile(ceaFile, targetSelf, disable)


   Settings:
      CEAFilesDirectory         : The directory to check for local files.
                              Can be set to nil to look in current folder.
                              i.e.: 'ceaFiles'


   Install / Setup Method:
      This is a Lua module so place it in the Cheat Engine 'lua' folder or in the same directory as the cheat table
      then just import (require) the module to use


   Examples:
      require 'I2CETableCEA'
      I2CETableCEA.autoAssembleFile('CoordHook.CEA') -- Enable
      I2CETableCEA.autoAssembleFile('CoordHook.CEA') -- Disable
      I2CETableCEA.autoAssembleFile('CoordHook.CEA', true) -- Enable and assemble in Cheat Engine's memory
      I2CETableCEA.autoAssembleFile('CoordHook.CEA', false, true) -- Force Diable


   Note:
      The "Table Require" template in my "pluginI2CELuaScriptTemplateGenerator.lua" plug-in will also allow for
         Lua modules to be added as table files then imported, but local files will override the table files.

         Table Require Code:
            --------
            -------- CE Table Require
            --------
            local TableLuaFilesDirectory = 'luaFiles'
            function CETrequire(moduleStr)
               if moduleStr ~= nil then
                  local localTableLuaFilePath = moduleStr
                  if TableLuaFilesDirectory ~= nil or TableLuaFilesDirectory ~= '' then
                     local sep = package.config:sub(1,1)
                     localTableLuaFilePath = TableLuaFilesDirectory .. sep .. moduleStr
                  end
                  local f, err = io.open(localTableLuaFilePath .. '.lua')
                  if f and not err then
                     f:close()
                     return require(localTableLuaFilePath)
                  else
                     local tableFile = findTableFile(moduleStr .. '.lua')
                     if tableFile == nil then
                        return nil
                     end
                     local stream = tableFile.getData()
                     local fileStr = nil
                     local bytes = stream.read(stream.Size)
                     for i = 1, #bytes do
                        if fileStr == nil then
                           fileStr = ''
                        end
                        fileStr = fileStr .. string.char(bytes[i])
                     end
                     if fileStr then
                        return assert(loadstring(fileStr))()
                     end
                  end
               end
               return nil
            end
            CETrequire('I2CETableCEA')
            -- I2CETableCEA.autoAssembleFile('CoordHook.CEA')



]====================================================================================================================]--


And as always, Code Happy, Code Freely, Be Awesome.



I2CETableCEA.lua
 Description:
I2 Cheat Engine CEA File Assembler v: 1.0.3

Download
 Filename:  I2CETableCEA.lua
 Filesize:  8.87 KB
 Downloaded:  29 Time(s)


_________________
A: What manner of man are you that can summon up fire without flint or tinder?
T: I... am an enchanter.


Last edited by TheyCallMeTim13 on Fri Jan 12, 2018 8:09 am; edited 1 time in total
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 6

Joined: 24 Feb 2017
Posts: 161
Location: Right Here Buddy.

PostPosted: Fri Jan 12, 2018 8:07 am    Post subject: Reply with quote


Update:


Version: 1.0.3

_________________
A: What manner of man are you that can summon up fire without flint or tinder?
T: I... am an enchanter.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting -> Lua Extensions 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