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 


Req: Custom toolbar

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Csimbi
I post too much
Reputation: 92

Joined: 14 Jul 2007
Posts: 3102

PostPosted: Sun Jul 16, 2017 11:36 am    Post subject: Req: Custom toolbar Reply with quote

Hi all,
this is a call for LUA gurus.
I don't know much about LUA, but I'm sure that there are tons of talented people out there who might be able to help.

I'd need a LUA file that I'd put into the autorun folder.
The LUA file would contain the scripts required to:
- create a floating window which would auto-save its own position and the saved position would be reloaded on startup.
- the floating window would contain a number of buttons - let's say, 10 buttons for now - next to each other, much like a toolbar.
- each button would have an 'Clicked' event so the appropriate LUA function would be executed on activation.

Now, as for the scripts themselves, the first button should create the environment, meaning:
- terminate any existing scans (i.e. make sure each tab is ready for 'First scan') and close all tabs (if need be).
- set 'Scan type' to 'Exact value'
- set 'Value type' to 'Double'
- select 'Rounded (default)'
- set 'Fast scan' to 0x10
- Open 10 scan tabs using the exact same scan settings as above and name the tabs 'health1', 'mana2', 'health2', etc. I'll change the names later on; just put there some dummies for now.

The second button will walk through all 10 tabs and:
- Terminate any existing scans (i.e. make sure each tab is ready for 'First scan').
- Set a required value in the 'Value' field on each tab (just set it to 10000 for now, I can change this easily later).

The third button will walk through all 10 tabs and perform 'First scan'.

The fourth button will operate only on the currently selected tab and do the following:
- Copy the value from the 'Value' box.
- Paste the copied value into the last two addresses in the address list and freeze both of these addresses.

The fifth button will remove all addresses (frozen or not) below the last header or script from the address list.

Any takers?

Thanks!
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: Mon Jul 17, 2017 9:52 am    Post subject: Reply with quote

The thing is, scan tabs, i.e. "Scan 1", "Scan 2", "Scan 3", ...., in reality is one big ScantabList object (class name: TTablist, inherits from TCustomControl class). Something similar to Panel or Button, with custom Paint function.


To get ScantabList object you can use:
Code:
local ScantabList = MainForm.ScantabList


If you want to change to first tab, use this code (it starts from 0, not 1):
Code:
ScantabList.SelectedTab = 0





Quote:
and name the tabs 'health1', 'mana2', 'health2'

Unfortunately this will require something more than pure Lua script, there will be a lot of executeCodeLocal() combined with targetself autoAssemble. You have to find TTablist.setTabText(i: integer; s: string) procedure address.

As you see, you will have to hack CE itself to achieve that, and this means that every CE update could break the script.





I think it would be much easier to just use few MemScan objects...

_________________
Back to top
View user's profile Send private message MSN Messenger
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Mon Jul 17, 2017 6:51 pm    Post subject: Reply with quote

@mgr.inz.Player

tablist.pas shows a published
Code:
property TabText[Index: Integer]: string read getTabText write setTabText;
and is listed in the result of getPropertyList... can you explain why trying to access it gives me this (both via .TabText and getProperty, which was worth a try)?
Code:
Error:List index (12410531) out of bounds


I've 0 experience with using delphi/lazuarus but it seems easy enough to read the class definitions. If it's a bug that's difficult to find/fix would it be possible to have those functions published so that they could be used directly?
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