| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| zort How do I cheat?
 
 ![]() Reputation: 0 
 Joined: 03 Aug 2011
 Posts: 1
 
 
 | 
			
				|  Posted: Wed Aug 03, 2011 12:51 pm    Post subject: [SOLVED] Delay execution of main.lua? |   |  
				| 
 |  
				| I only use Cheat Engine for one thing, and that is to play a certain game slower than normal. So I put this in main.lua: 
  	  | Code: |  	  | openProcess("lf2.exe") speedhack_setSpeed(0.2)
 | 
 Apparently main.lua is executed too early though, because the code does what it's supposed to do when I execute it using "Show Cheat Table Lua Script", but doesn't do anything when Cheat Engine starts. Is there some way to delay its execution, like a hook?
 
 Last edited by zort on Tue Aug 14, 2012 6:14 pm; edited 2 times in total
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| atom0s Moderator
 
  Reputation: 205 
 Joined: 25 Jan 2006
 Posts: 8587
 Location: 127.0.0.1
 
 | 
			
				|  Posted: Wed Aug 03, 2011 12:57 pm    Post subject: |   |  
				| 
 |  
				| Try doing something like this instead with the auto attach list: 
 
  	  | Code: |  	  | local attachList = getAutoAttachList();
 stringlist_add( attachList, "lf2.exe" );
 
 function onOpenProcess( processid )
 speedhack_setSpeed( 0.2 );
 end
 
 | 
 _________________
 
 - Retired. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Dark Byte Site Admin
 
  Reputation: 470 
 Joined: 09 May 2003
 Posts: 25807
 Location: The netherlands
 
 | 
			
				|  Posted: Wed Aug 03, 2011 12:59 pm    Post subject: |   |  
				| 
 |  
				| You can create a timer that runs once after 1 millisecond. 
 I think i posted a script like this somewhere else
 
 edit, here: http://forum.cheatengine.org/viewtopic.php?t=538052
 _________________
 
 Do not ask me about online cheats. I don't know any and wont help finding them.
 Like my help? Join me on Patreon so i can keep helping
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  |