|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
MaxLak How do I cheat? Reputation: 0
Joined: 14 Jun 2018 Posts: 1
|
Posted: Fri Jun 15, 2018 12:23 pm Post subject: Generating a trainer from a cheat table? |
|
|
Is it possible to generate a stand-alone trainer that allows the user to actually modify the value of the thing that is being set, for example, health? I know how to make the trainer set it to a predefined value, but I don't know how to make that value able to be defined by the user.
I'm sorry if this is in the wrong section, I was unsure where to post.
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Fri Jun 15, 2018 2:50 pm Post subject: |
|
|
sure, though you'd need to modify the gui and use a little lua, actually you could do it without changing the gui using inputQuery if you wanted
basically create a regular trainer and save it as a CT file then edit the table's lua script to add something like the following at the end after the auto-generated comment, tailored to your table/game of course, and then save it as an exe file to get a standalone trainer.
Code: | --code example based on the tutorial step 2 with a memory record named "Step 2"
Step2MemRec = addresslist.getMemoryRecordByDescription("Step 2")
Step2HotKeyFunction = function(hk)
local value = inputQuery('Set step 2', 'What value?', '1000') -- prompt user for value
if not value then return end -- user clicked cancel or something
Step2MemRec.Value = value -- auto converts to string which is how the value is stored
end
-- table of Virtual Key codes that trigger hotkey
Step2HotKeyTrigger = {VK_F2}
--create hotkey that will run the function when the key(s) are pressed
Step2HotKey = createHotKey(Step2HotKeyFunction, Step2HotKeyTrigger) |
Of course, if you take the GUI route then you'd create an edit box that the user would fill and detect when they're done somehow (like clicking a button) and then you could write whatever value the CETrainer.CEEditBox1.Text has (with the name of the edit box being replaced with whatever your edit box's name is, though that's the format CE auto-generates iirc). There's a video or two showing the basics on youtube, otherwise you can browse through the celua.txt file to find most of the information you might need if you know a bit of lua (which has a website and several tutorials online).
edit: just thought about allowing the user to change the value a "regular" hotkey uses, most of the code is the same but instead of setting the memory records' value you'd get the hotkey attached to the memory record using Step2MemRec.Hotkey[0].Value = ... (of course if you had multiple hotkeys on the memory record you'd need to use the right index to select the right hotkey, the first is 0, the next 1, etc.)
_________________
|
|
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 can download files in this forum
|
|