 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
mgr.inz.Player I post too much
Reputation: 153
Joined: 07 Nov 2008 Posts: 4219 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Jul 15, 2013 11:20 am Post subject: Add few new useful menu entries. |
|
|
I often open main.lua (doc file) and defines.lua when I'm creating not so generic trainers. Script below adds two new entries inside Help submenu:
Code: | function addMenuItem(parent,caption)
if parent==nil then return nil end
local newItem = createMenuItem(parent); parent.add(newItem)
newItem.Caption = caption
return newItem
end
menuItem_help = getMainForm().findComponentByName('Help1')
--add two new useful entries
addMenuItem(menuItem_help,'-')
addMenuItem(menuItem_help,'main.lua').setOnClick(
function ()
shellExecute('main.lua','',getCheatEngineDir())
end)
addMenuItem(menuItem_help,'defines.lua').setOnClick(
function ()
shellExecute('defines.lua','',getCheatEngineDir())
end)
addMenuItem = nil
menuItem_help = nil |
Of course, you have to associate .lua files with notepad or notepad++
_________________
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 153
Joined: 07 Nov 2008 Posts: 4219 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Jul 27, 2013 6:56 pm Post subject: |
|
|
Another version,
added new entry: "Switch to 32/64 bit" and
Code: | function addMenuItem(parent,caption)
if parent==nil then return nil end
local newItem = createMenuItem(parent); parent.add(newItem)
newItem.Caption = caption
return newItem
end
-- which CE ?
if cheatEngineIs64Bit() then
getMainForm().Caption = getMainForm().Caption .. ' 64bit'
else
getMainForm().Caption = getMainForm().Caption .. ' 32bit'
end
-- add few new useful entries
menuItem_help = getMainForm().Help1
addMenuItem(menuItem_help,'-')
addMenuItem(menuItem_help,'Open main.lua').setOnClick(
function ()
shellExecute('main.lua','',getCheatEngineDir())
end)
addMenuItem(menuItem_help,'Open defines.lua').setOnClick(
function ()
shellExecute('defines.lua','',getCheatEngineDir())
end)
opposite = cheatEngineIs64Bit() and '32bit' or '64bit'
addMenuItem(menuItem_help,'Switch to '..opposite..' CE').setOnClick(
function ()
local canNotSwitch = (cheatEngineIs64Bit()==false) and (os.getenv("PROCESSOR_ARCHITEW6432")==nil)
if canNotSwitch then
messageDialog('You can not switch to 64bit CE, you have Win32.',mtInformation,mbOK)
return
end
oppositeBinary = cheatEngineIs64Bit() and 'cheatengine-i386.exe'
or 'cheatengine-x86_64.exe'
local mr=messageDialog('Are you sure?',mtConfirmation,mbYes,mbNo)
if mr==mrNo then return end
shellExecute(oppositeBinary,'',getCheatEngineDir())
createTimer(nil,true).OnTimer = function() closeCE() end
end)
addMenuItem = nil
menuItem_help = nil
opposite = nil |
_________________
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 153
Joined: 07 Nov 2008 Posts: 4219 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Fri Jan 10, 2014 10:29 pm Post subject: |
|
|
CE6.3+ have new Option entry for every parenting(has children) memoryrecord:
"manual expand/collapse"
it shows small square next to "active square". This square contains tiny "-" when memoryrecord is collapsed, and tiny "+" when expanded.
This code will set "manual expand/collapse" for all memoryrecords which have hidden children:
Code: | addMenuItem(menuItem_help,'Reveal expandable memory records...').setOnClick(
function ()
local al = getAddressList()
for i=0,al.Count-1 do
local mr = al.getMemoryRecord(i)
if mr.Count>=1 and mr.Options:match("%[moHideChildren%]") then
mr.Options = "[moHideChildren,moManualExpandCollapse]"
end
end
end) |
paste it before this line
addMenuItem = nil
_________________
|
|
Back to top |
|
 |
|
|
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 cannot download files in this forum
|
|