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 


Opening AA in different editor

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Merlini
Advanced Cheater
Reputation: 2

Joined: 12 Jun 2016
Posts: 53

PostPosted: Thu Oct 06, 2016 4:05 pm    Post subject: Opening AA in different editor Reply with quote

When you double click on <script> to open the AA script,
the code is opened in CE's auto assemble editor.

Is there a way to open the code in a different editor?
For example, I use vi/vim for most of my coding.
I've searched through the forum, and the settings,
but have not been able to find an option yet.

If this is not available, that itself would be satisfactory answer.
I think i can make a macro script to open new vim instance,
then dump the contents of the AA editor into it.
I just don't want to be reinventing the wheel if there is a
built-in way of doing this.

Thank you.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Thu Oct 06, 2016 4:17 pm    Post subject: Reply with quote

it's not available
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Merlini
Advanced Cheater
Reputation: 2

Joined: 12 Jun 2016
Posts: 53

PostPosted: Thu Oct 06, 2016 4:38 pm    Post subject: Reply with quote

Thank you for the quick confirmation.
Much appreciated.
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 42

Joined: 09 Nov 2005
Posts: 2672

PostPosted: Thu Oct 06, 2016 5:29 pm    Post subject: Reply with quote

Up to other editors to support AA scripts. You should ask them and they might include it in their program.
_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
Merlini
Advanced Cheater
Reputation: 2

Joined: 12 Jun 2016
Posts: 53

PostPosted: Thu Oct 06, 2016 7:52 pm    Post subject: Reply with quote

STN wrote:
Up to other editors to support AA scripts. You should ask them and they might include it in their program.


I'm fairly sure this functionality would require tinkering with CE
internals for it to work.
Specifically, I want to be able to right-click on a script[#1] in the CE table,
have it open a context menu for "Open this script in Vim."
This would then pipe the content of the script[#1] into vim.
Then when I "save" in vim, have it pipe the content back into CE script.


In particular for vim this work flow would work.

"STDIN | vim - " syntax currently opens a vim editor with STDIN buffer.

Right click -> "Open this script in Vim"
Then CE would send a command as
echo "<CE's internal script[#1] buffer>" | vim -

Then to save from vim to CE.
Vim can send command to OS with "!" syntax and
pipe the buffer of its content as STDIN with
:w !<cmd>

So something like this would pipe the modified vim content back to CE
:w !cheatengine-x86_64.exe -modify_script_id=#1 -CE_instance=#1

This means that vim would send a command to OS calling the
cheat engine with the option to identify CE_instance,
command to "modify_script_id" and accept its buffer as STDIN.


Because vim already has the option of accepting buffer from external
source as well as outputting buffer into external program,
there is nothing more that needs to be done on that end.
CE has to have the capability for sending script buffer out,
and accept it.
Which as, DB already confirmed, isn't part of CE's design.

However, I can imagine using LUA to do this.
I have not learned to use LUA with CE so I don't know the details,
but if LUA can grab the buffer for a CE script, and interact with
OS, then this would be possible. (And possibly be an interesting and
useful project for a modder.)


--------------------------------------------
As a small side note, I think it would be interesting to note
why this request came about.

I had a reason to do some refactoring in one of my AA codes.
All in all, I had to change maybe around 100 identifiers, etc.
I found that AA editor doesn't have search and replace tool,
(only search tool) so that meant I had to go and search
for each instance, then manually change them.

This got me thinking that I could probably do all these refactoring
a lot more efficiently in Visual studio, or eclipse, or vim.

Of course, I could copy the script to the IDE and fix, but
I then have to copy the content back to CE manually to test.
Then run the script, debug, find something's not quite right,
then copy the stuff back to IDE, fix it then back into CE, etc.
All this ping-pong'ing got me thinking that maybe there is already
a way for CE programmers to use their favorite external IDE.

Maybe all I really needed was for AA editor to have
"Search and replace" tool?

DB may I request a search and replace tool for next update please?
Back to top
View user's profile Send private message
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Thu Oct 06, 2016 8:27 pm    Post subject: Reply with quote

interesting........i'll see what i can do about it.
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 54

Joined: 01 Oct 2008
Posts: 941

PostPosted: Thu Oct 06, 2016 9:57 pm    Post subject: Reply with quote

Probably CE side can be notified file changed by Lua timer checking on the md5 (lua function md5file, check https://raw.githubusercontent.com/cheat-engine/cheat-engine/master/Cheat%20Engine/bin/main.lua ) hash of the file being edited.

I'll suggest also if CE got the event of filed changed, load the new version of file into the AA template form, which has 'execute' functionality, so that an edit -> test cycle can be made, and the user can decide if the actual change need to be update into the original memory record later.

bye~

_________________
- Retarded.
Back to top
View user's profile Send private message
Merlini
Advanced Cheater
Reputation: 2

Joined: 12 Jun 2016
Posts: 53

PostPosted: Thu Oct 06, 2016 10:36 pm    Post subject: Reply with quote

predprey wrote:
interesting........i'll see what i can do about it.

Thank you predprey for looking into it. I've not done LUA in any
real functional sense so help here would be gold.

panraven wrote:
Lua timer checking on the md5 [...] hash of the file being edited.
[...] event of filed changed, load the new version of file into the AA template form [...]


Panraven's approach is also good.
The fact is that not every IDE is capable of piping out
it's own buffer easily. So the idea of working with shared
access file worked on by both CE and external IDE
is next best (and generalized) solution.
Most decent editor will already monitor a shared text file's state and
update its buffer (with prompt such as "The file has been changed by
an external program. Would you like to reload this file? (y)/n")
So if it is possible for LUA script to monitor a file, and modify
linked script's content, we'd be golden.

We would just need a right click option on CE script entry such as
"Link this script to: <path to external file>"
Back to top
View user's profile Send private message
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Thu Oct 06, 2016 11:39 pm    Post subject: Reply with quote

panraven wrote:
Probably CE side can be notified file changed by Lua timer checking on the md5 (lua function md5file, check https://raw.githubusercontent.com/cheat-engine/cheat-engine/master/Cheat%20Engine/bin/main.lua ) hash of the file being edited.

I'll suggest also if CE got the event of filed changed, load the new version of file into the AA template form, which has 'execute' functionality, so that an edit -> test cycle can be made, and the user can decide if the actual change need to be update into the original memory record later.

bye~


thanks. i think i will do the md5 hash check onFocus of CE's main window, kinda like how notepad++ does it. i will save out the assemblelines text into a randomly named or serially named file in the %userprofiles% Temp folder like browsers does in the past.
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 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