Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Using batch to automatically enable sppedhack to 0 for a gam

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
krepsy3
How do I cheat?
Reputation: 0

Joined: 17 Feb 2017
Posts: 1

PostPosted: Fri Feb 17, 2017 10:18 am    Post subject: Using batch to automatically enable sppedhack to 0 for a gam Reply with quote

I have a special request: Is it possible to create some batch file to automate the process I allways do before playing a game? The steps for the batch would be as follows:
1. Start my game (process name is allways the same)
2. Start the cheat engine
3. Select the process by it's name
4. Enable speedhack for that process
5. Set the speedhack's speed value to zero

So that I don't have to do that manually everytime I launch the game?
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3672

PostPosted: Fri Feb 17, 2017 10:41 am    Post subject: Reply with quote

You can write an LUA script to do this so that when you open the table, everything is done for you, automatically, including launching of the game, attaching and setting speedhack.

For example, something like this (although, I am a newbie when it comes to LUA, so I cannot get this to set the speedhack value correctly):

Code:
function onOpenProcess(pid)
 end

shellExecute("C:\\Program Files (x86)\\Cheat Engine 6.6\\Tutorial-i386.exe")
openProcess("Tutorial-i386.exe")
speedhack_setSpeed(0.5)


Maybe someone with more experience can point out what I am doing wrong.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 121

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Feb 17, 2017 6:09 pm    Post subject: Reply with quote

Enable Always run lua scripts from tables and add this script to your table.
Code:
shellExecute("C:\\path_to_game\\game.exe")
getAutoAttachList().add("game.exe")
function onOpenProcess()
  reinitializeSymbolhandler()
  speedhack_setSpeed(0.5)
end
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3672

PostPosted: Fri Feb 17, 2017 6:59 pm    Post subject: Reply with quote

Unfortunately, this produces the same results as the example that I posted (i.e. the speedhack value is not being set properly for some reason).

If executing manually, from within CE, the value is set correctly. However, executing automatically, by way of double-clicking on the CT file, the value is not properly set.

Thanks.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 121

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Feb 17, 2017 7:20 pm    Post subject: Reply with quote

I see what you mean. Odd...
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3672

PostPosted: Fri Feb 17, 2017 7:24 pm    Post subject: Reply with quote

Must be a bug.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 345

Joined: 09 May 2003
Posts: 20115
Location: The netherlands

PostPosted: Sun Feb 19, 2017 2:41 pm    Post subject: This post has 1 review(s) Reply with quote

try
queue(function() speedhack_setSpeed(0.5) end)
or
launch a timer in onOpenProcess with an interval of 1 which disables itself on run


also, speedhack can not be used on a process that has just started. it hasn't fully loaded yet

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 75

Joined: 29 Oct 2010
Posts: 3672

PostPosted: Sun Feb 19, 2017 3:43 pm    Post subject: Reply with quote

Thanks, Dark Byte.

With your advice, and a lot of trial and error, I managed to get this working:

Code:
function onOpenProcess(pid)
 end

shellExecute("C:\\Program Files (x86)\\Cheat Engine 6.6\\Tutorial-i386.exe")
openProcess("Tutorial-i386.exe")

tmer = createTimer(nil, false)
tmer.OnTimer = function(timer)
  speedhack_setSpeed(0.5)
  timer.Destroy()
end
tmer.Interval = 100
tmer.Enabled = true
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites