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 


CE Lua from command line

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
RandName
Newbie cheater
Reputation: 0

Joined: 19 Jun 2015
Posts: 22

PostPosted: Thu Mar 24, 2016 2:29 pm    Post subject: CE Lua from command line Reply with quote

Hey,

I need to run my script from the command line with args for a dynamic analysis of the script.
But when I do that I get errors because of the CE specific functions which don't exist in Lua itself.
Is there any way to do something like this, without removing all CE Lua functions?

Greetings,
RandName
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Mar 24, 2016 3:39 pm    Post subject: Reply with quote

Define those CE-specific functions yourself at the top of the script?
Code:
function readBytes() end
Back to top
View user's profile Send private message
RandName
Newbie cheater
Reputation: 0

Joined: 19 Jun 2015
Posts: 22

PostPosted: Thu Mar 24, 2016 3:52 pm    Post subject: Reply with quote

Won't they replace the CE functions?
I still want to be able to use the functions when used with CE.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Mar 24, 2016 4:15 pm    Post subject: Reply with quote

Create a separate file called "defines.lua" where ever you're testing your script.
Then include the following at the top of the CE script:
Code:
require("defines")

When CE executes that, it will do nothing because it has already loaded the defines.lua file in the install directory.
However, your other environment will load the file and all of the functions you define within.
Back to top
View user's profile Send private message
RandName
Newbie cheater
Reputation: 0

Joined: 19 Jun 2015
Posts: 22

PostPosted: Thu Mar 24, 2016 4:49 pm    Post subject: Reply with quote

Sounds reasonable Very Happy
So I have to define the CE functions in defines.lua, right?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Mar 24, 2016 5:22 pm    Post subject: Reply with quote

Yep. Whichever are giving your other environment a problem.
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 958

PostPosted: Fri Mar 25, 2016 7:13 am    Post subject: Reply with quote

I've made suggestion to mgr.inz.Player for a command line interface to ce lua
http://forum.cheatengine.org/viewtopic.php?p=5639395&highlight=#5639395
but seem not a right moment at the launch of new ce 6.5 at that time.

I tried make one, but it is buggy and inadequate, not even the arg variable for the script parameters.

At least it is possible, and should be easy for experienced programmer~

The attached trial use MemoryMap to communicate between ce and the command line interface.

--
Need ce 6.5.

Attached zip is in the table file, extract to ce directory with relative path;
Code:

files/directoy:
- autorun/
  + celuaautorun.lua -- will require 'celue' at starting ce
- Lua/
  - celua/
    + init.lua -- the ce lua console ui
+ celua.exe -- the command line exe and support assembly
+ celua.xml
+ Nemerle.dll
+ Nemerle.xml


Start console ui in ce, menu table/custom/ce lua console
Pressing 'start' in the console ui to initialize memory map,
it need once to attach the process to ce itself in order to call the sharedmemory function, after that ce can attach to other process as normal.

In command line,
Code:
celua script.lua
to send source file for ce executing.

bye~



CELuaConsole.CT
 Description:
failed, buggy inadequate ce lua command line console, zip in table file

Download
 Filename:  CELuaConsole.CT
 Filesize:  163.27 KB
 Downloaded:  566 Time(s)


_________________
- Retarded.
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 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