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 


getPreviousOpcode and some other lua questions
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed Feb 13, 2013 4:53 pm    Post subject: Reply with quote

The lua engine is thread safe (if you get the .dll from the svn, the 6.2 release didn't compile the threadsafety define in the 32-bit build)

It's possible that if cheat engine is pushing/popping values from the lua state and your plugin does the same a conflict can occur. If you intend on calling lua asynchronously without syncing with the mainthread , then you must call lua_newthread(cemainluastate) to create your own lua state with it's own stack, but has access to the same global variables.

(If you use gui commands you MUST sync with the main thread, and remember, "print" is a gui command)

Callbacks you register are most of the time in sync with the main thread though


The references on a new line might be a bit of a problem. The disassembler is a runtime disassembler, so if you scroll down, you actually go to the next address. And even if that one address filled the whole screen, you will go to the next address clearing everything it previously disassembled.
So if you have an address with more than 100 references, you wouldn't even see the opcode or the other references

_________________
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
Chris12
Expert Cheater
Reputation: 1

Joined: 27 Apr 2012
Posts: 103

PostPosted: Wed Feb 13, 2013 10:14 pm    Post subject: Reply with quote

Lua:
Ok, so I'll just create a new luathread for data gathering.
But what are gui-commands?
Only the control_get/set/etc... commands?
Or do calls like getMemoryViewForm or disassemblerview_getSelectedAddress also belong to the gui functions??
Because I called the last two from a different thread with no problem so far.


References:
IDA tackles this problem by just using a new "real" line, but the address it is displaying stays the same as the one before. So it's not one single huge line that displays it all, but multiple lines that just display the same addres (and different comments). This can be seen in my screen on page one.

I don't know how the current disassmbler view works exactly, but if that's too hard to implement then maybe I could display my own meta information in a window beside the disassembler, only showing information about the currently highlighted line :/ But I'd really like to avoid that. Well, whatever, for now there's stuff thats more important. The visual stuff can wait Smile
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Feb 14, 2013 6:49 am    Post subject: Reply with quote

with gui functions I mean those that cause a gui update(and some that actually query a component graphically, but those are rare)

getMemoryViewForm and disassemblerview_getSelectedAddress don't cause a gui update, and just reference an internal address. (So no screen locking)

_________________
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
Chris12
Expert Cheater
Reputation: 1

Joined: 27 Apr 2012
Posts: 103

PostPosted: Tue Feb 19, 2013 7:41 am    Post subject: Reply with quote

Seems like you worked hard Very Happy
Nearly everything seems ready in the SVN (except the easy stuff like getComment setComment?).

When you finished it up with bindings to lua or the exportedFunctions struct could you upload a compiled version for me please ? Smile

Thanks for your great effort!!
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Tue Feb 19, 2013 10:01 am    Post subject: Reply with quote

I'm adding new builds here:
http://forum.cheatengine.org/viewtopic.php?p=5456143#5456143
(available for beta testers)

_________________
Back to top
View user's profile Send private message MSN Messenger
Chris12
Expert Cheater
Reputation: 1

Joined: 27 Apr 2012
Posts: 103

PostPosted: Tue Feb 19, 2013 4:23 pm    Post subject: Reply with quote

Looks like I don't have the rights to see this topic :/
"this topic doesn't exist"
edit: works now, thanks Smile
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
Goto page Previous  1, 2
Page 2 of 2

 
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