CheatMaker 论坛

首页 » 游戏相关版块 » 游戏工具及相关 » cheat-engine6.x --- ram-watch-cheat-engine
dfzetcc - 2015/3/28 14:58:23
ram-watch-cheat-engineRAM watch display examples, using Lua scripts in Cheat Engine.
Basic use of Cheat Engine lets you display RAM values in real time while a game is running, but with scripting you can get a much more customized display, which has several advantages:
Included here are examples for a few Dolphin emulator games, and a PC game.
What you'll needHow to useRunning for the first timeStart up Cheat Engine. In the Cheat Engine menu, go to Table -> Show Cheat Table Lua Script. Paste the following script in there:
local name = "sample"local scriptDir = "C:\\path\\to\\Cheat\\Engine\\scripts\\directory"if package.loaded[name] then  -- Not first load; clear cache  package.loaded[name] = nilelse  -- First load; add our script directories to the Lua path  package.path = package.path .. ";" .. scriptDir .. "\\?.lua"  package.path = package.path .. ";" .. scriptDir .. "\\games\\?.lua"endrequire(name)You need to edit the first two lines of this script:
Start up the game you want to RAM watch. For Dolphin, this means starting Dolphin and then starting the game of your choice. Then in Cheat Engine, open your game's process (e.g. Dolphin.exe).
Now, click the Execute Script button at the bottom of the Lua script window. If all went well, a little window should appear, displaying RAM values from the game. (If it's a Dolphin game and you have it paused, you will have to advance at least one frame for the values to display.)
If you get an error, check the error message. (Note: The latest Lua error appears BELOW previous errors in the Lua Engine window.) The error message may have suggestions for you to fix the situation. For example, it may tell you to specify an address in dolphin.lua.
Saving a Cheat Table for next sessionWith Lua scripts, you don't have to save addresses to the address list in Cheat Engine's normal UI. However, it's still useful to save a cheat table (.CT) file to save the script where you've specified the game name and your scriptDir. So click the save icon in Cheat Engine and save as a .CT file. Next time you do RAM watching, you can open this cheat table instead of having to paste in the Lua script again.
Note: Cheat Engine sometimes crashes when you are trying to open a cheat table. I think this either happens if you open it too quickly after starting Cheat Engine, or open it too quickly after selecting your game's process. If it happens to you, then you'll have to move a little slower next time. It's not a huge deal, but it can be annoying if you have to keep re-opening Cheat Engine for whatever reason.
Trying different GUI layoutsIn each game-specific script (such as fzerogx.lua for F-Zero GX), there's a line that says *** CHOOSE YOUR LAYOUT HERE ***.
Above that line you can find the names of the various layouts; for example, sample.lua has layoutA and layoutB.
Below that line you can specify which display layout you want to use. Try editing this line of code to specify a different layout, then save your changes. Go back to Cheat Engine and click Execute Script again. A new window should appear with the new layout. (You can now close the old window, as it's no longer in use.)
Some of the example layouts include a button that lets you take RAM values to a stats.txt file. This file will be in one of two places: (A) The same directory as the cheat table you have open, or (B) The same directory as the Cheat Engine .exe file, if you don't have a cheat table open. The file will contain one value per line, with one value taken per frame. You can copy the entire file's contents and paste into a spreadsheet column for further analysis.
Making your own game specific scriptIf you are ready to do some scripting of your own, I recommend starting with sample.lua. This is the simplest script to understand. The other scripts have more structure to them, which can be useful if you have a bunch of possible RAM values to look at or a bunch of different layouts. But to start off, start by using sample.lua as a template, modify the code within layoutA or layoutB, and try it out.
Tips if (more like when) your script isn't working as expected:
Common issuesPerformance noteRunning one of these scripts alongside your game may cause the game to run slower, especially if the script uses a breakpoint to run the code. Using Cheat Engine's Timer class has noticeably better performance than using breakpoints, even for very simple Lua scripts. (Credit to Miles for finding that the Timer class was better.)
Also, it seems like the script may run slower if you've clicked Execute Script many times while testing, and in this case closing and re-opening Cheat Engine may make it better. (But I could be wrong.)
If you can identify a particular part of the example scripts that is making things slow, feel free to post a GitHub issue about it, and I'll look into it.
Future plansAcknowledgmentsMasterjun, for writing the RAM watch script (2013/08/26) that this project was based on: http://pastebin.com/vUCmhwMQ

ram-watch-cheat-engine-master.zip (, 下载次数:1302)
1
查看完整版本: cheat-engine6.x --- ram-watch-cheat-engine