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 


Current cheat table name (similar to "project name"

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting -> Lua Extensions
View previous topic :: View next topic  
Author Message
mgr.inz.Player
I post too much
Reputation: 148

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

PostPosted: Thu Jul 28, 2016 12:43 pm    Post subject: Current cheat table name (similar to "project name" Reply with quote

Current cheat table name.
Something similar to "project name" known from other applications.


Just place it in autorun folder.


Script:
Code:
local mf = getMainForm()
local sd = mf.SaveDialog1
local od = mf.OpenDialog1

local function returnFileName(path)
 --extracts file name from full path (not full path => return nil)
 return (path~=nil) and (path:match("\\([^\\]+)$"))
end

local currentTableNameLabel = createLabel(mf.Panel5)
currentTableNameLabel.AnchorSideLeft.Control = mf.foundcountlabel
currentTableNameLabel.AnchorSideLeft.Side = asrBottom
currentTableNameLabel.AnchorSideTop.Control = mf.foundcountlabel
currentTableNameLabel.AnchorSideTop.Side = asrCenter
currentTableNameLabel.BorderSpacing.Left = 20

local currentTableNameTimer = createTimer(mf)
currentTableNameTimer.Interval = 1000
currentTableNameTimer.OnTimer = function ()
  local name = returnFileName(sd.Filename)
  name = name or returnFileName(od.Filename)
  currentTableNameLabel.Caption = 'Current table name:  '..(name or '')
end




Below file contains (up do date ) script.



currentCheatTableName.lua
 Description:

Download
 Filename:  currentCheatTableName.lua
 Filesize:  1.31 KB
 Downloaded:  553 Time(s)


_________________


Last edited by mgr.inz.Player on Thu Jul 28, 2016 3:10 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
panraven
Grandmaster Cheater
Reputation: 26

Joined: 01 Oct 2008
Posts: 653

PostPosted: Thu Jul 28, 2016 1:40 pm    Post subject: Reply with quote

Thank you~

May be replacing timer with CommonDialog's OnClose event?
It seems sd.FileName will contain filename of the CT executing from the Explorer.

btw, using event then the caption trail with os.date'%X' will show the last save/load time.

_________________
- Retarded.
dropbox
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

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

PostPosted: Thu Jul 28, 2016 3:05 pm    Post subject: Reply with quote

Unfortunately there's no dialog result exposed to lua:
Code:
local mf = getMainForm()
local sd = mf.SaveDialog1

print( getPropertyList(sd).Text )

Name
Tag
HelpContext
Width
Height
Title
DefaultExt
FileName
Filter
FilterIndex
InitialDir
Options


We can not check (inside OnClose event) if dialog was cancelled.


But. I can use OnClose event to enable the timer at right moment and only when it is needed.
Timer will disable itself after updating a label. First post updated with new file.


Edit:
Removed not needed source. It's in first post anyway.

_________________


Last edited by mgr.inz.Player on Sun Oct 30, 2016 12:54 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
panraven
Grandmaster Cheater
Reputation: 26

Joined: 01 Oct 2008
Posts: 653

PostPosted: Thu Jul 28, 2016 3:57 pm    Post subject: Reply with quote

It seems the original timer method update the label correctly in the right time.
But event base method may have a delay(?) in case of asking user to merge 2 table.

_________________
- Retarded.
dropbox
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

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

PostPosted: Thu Jul 28, 2016 4:23 pm    Post subject: Reply with quote

I see.

When you click YES in "do you wish to merge" window:
- file name is correct, because you added stuff to existing CT file from other CT
- time is wrong

When you click NO in "do you wish to merge" window:
- file name is wrong, you just opened other CT file
- time is correct



Also, pressing CTRL+S do not update the time. I have to dig more.

_________________
Back to top
View user's profile Send private message MSN Messenger
jaejunks
How do I cheat?
Reputation: 0

Joined: 29 May 2016
Posts: 4

PostPosted: Sat Jan 21, 2017 9:20 am    Post subject: Reply with quote

I think I've fixed the table name not get updated after opening a different table.

I've removed some of the code lines since they aren't necessary, and shorten the timer interval so that the name update is more snappy.



currentCheatTableName.lua
 Description:

Download
 Filename:  currentCheatTableName.lua
 Filesize:  1.24 KB
 Downloaded:  328 Time(s)

Back to top
View user's profile Send private message
jaejunks
How do I cheat?
Reputation: 0

Joined: 29 May 2016
Posts: 4

PostPosted: Thu Jan 26, 2017 6:43 am    Post subject: Reply with quote

Script update:

- Added label tooltip to display table full file path.

- Made the "Delete all addresses from the list" button prompts user to clear the table name if there's a table currently loaded.

The second one is mainly to prevent the Save menu item from accidental overwriting of a possibly good table file because both the menu and the button don't clear the table file name that was previously loaded or saved.

I haven't managed to apply the second modification to the Save menu item (the `New1` component) because somehow, changes to its OnClick property seems to be ineffective. i.e. the newly assigned handler is never called. Anyone can shed some lights on this?



currentCheatTableName.lua
 Description:

Download
 Filename:  currentCheatTableName.lua
 Filesize:  1.9 KB
 Downloaded:  363 Time(s)

Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

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

PostPosted: Thu Jan 26, 2017 8:04 am    Post subject: Reply with quote

Hi, I'll check your modifications later.
_________________
Back to top
View user's profile Send private message MSN Messenger
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