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 


Closing Your Game Via Lua With A Button

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

Joined: 27 May 2014
Posts: 9

PostPosted: Wed Jun 18, 2014 11:15 am    Post subject: Closing Your Game Via Lua With A Button Reply with quote

I am trying to make a checkbox in my trainer that closes the game and opens it. How can i do that and can you do it via Lua.?
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Wed Jun 18, 2014 11:53 am    Post subject: Reply with quote

Code:
shellExecute('cmd.exe', '/c taskkill /PID ' .. getOpenedProcessID());

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Wed Jun 18, 2014 4:20 pm    Post subject: Reply with quote

For closing you can try to use this:
Code:
autoAssemble([[
alloc(QUAZ,64)
createthread(QUAZ)

QUAZ:
call exit

]])



opening process is simple:
Code:
openProcess(processname)

_________________
Back to top
View user's profile Send private message MSN Messenger
BOSCHDRIFT
How do I cheat?
Reputation: 0

Joined: 27 May 2014
Posts: 9

PostPosted: Thu Jun 19, 2014 12:07 pm    Post subject: Reply with quote

I tried both of the opening codes none worked for me when i click on the button it didnt do anything.
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Fri Jun 20, 2014 3:59 am    Post subject: Reply with quote

You must be attached to a process.

and you must add that script to the button function.

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
BOSCHDRIFT
How do I cheat?
Reputation: 0

Joined: 27 May 2014
Posts: 9

PostPosted: Fri Jun 20, 2014 10:49 am    Post subject: Reply with quote

I did add the script to the button but nothing happened, not even the error box came up?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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