Script

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
xapo
What is cheating?
What is cheating?
Posts: 2
Joined: Fri Oct 27, 2023 3:33 pm
Reputation: 0

Script

Post by xapo »

Hello, can someone help me?
i'd like to create an Script that change a SpeedHack between a specific time..

like SpeedHack is 1 then chante to 1.05 time ( 1000 ) change back to 1, wait (1000) change back to 1.05.. this in a infinite while until i press the key to stop it

Thank you

User avatar
LeFiXER
LeFixer
LeFixer
Posts: 482
Joined: Wed Mar 24, 2021 9:35 am
Reputation: 243

Re: Script

Post by LeFiXER »

xapo wrote:
Fri Oct 27, 2023 3:36 pm
Hello, can someone help me?
i'd like to create an Script that change a SpeedHack between a specific time..

like SpeedHack is 1 then chante to 1.05 time ( 1000 ) change back to 1, wait (1000) change back to 1.05.. this in a infinite while until i press the key to stop it

Thank you
This works as intended:

Code: Select all

[ENABLE]
{$LUA}
if syntaxcheck then return end
-- Interval in seconds
local interval = 1
local active = true
speedhackTimer = createTimer(getMainForm())
speedhackTimer.Interval = interval * 1000
speedhackTimer.OnTimer = function ()
                            if active then
                               speedhack_setSpeed(1)
                            else
                               speedhack_setSpeed(1.05)
                            end
                            active = not active
                          end
{$ASM}
[DISABLE]
{$LUA}
if syntaxcheck then return end
if speedhackTimer then speedhackTimer.destroy(); speedhackTimer = nil end

xapo
What is cheating?
What is cheating?
Posts: 2
Joined: Fri Oct 27, 2023 3:33 pm
Reputation: 0

Re: Script

Post by xapo »

thank you, i can run it, i don't know why..... i'm trying

User avatar
LeFiXER
LeFixer
LeFixer
Posts: 482
Joined: Wed Mar 24, 2021 9:35 am
Reputation: 243

Re: Script

Post by LeFiXER »

xapo wrote:
Fri Oct 27, 2023 10:56 pm
thank you, i can run it, i don't know why..... i'm trying
It's because you need to add it as a script. Click the Memory View button on the main window of Cheat Engine, In the new window that shows up click Tools on the menu and at the bottom will be Auto Assemble script. Paste the code in there, click File > Assign to current cheat table.

Post Reply

Who is online

Users browsing this forum: No registered users