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(menuItem_help,'Target is ?').setOnClick( function () if getMainForm().ProcessLabel.Caption=='No Process Selected' then return end if targetIs64Bit() then messageDialog("target is 64 bit",mtInformation,mbOK) else messageDialog("target is 32 bit",mtInformation,mbOK) end end) addMenuItem = nil menuItem_help = nil opposite = nil