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 


Help Dark Byte How To Make Run Game Button In Lua?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Wheel Of Fate
Advanced Cheater
Reputation: 0

Joined: 01 Oct 2010
Posts: 75

PostPosted: Thu Jun 30, 2011 1:21 am    Post subject: Help Dark Byte How To Make Run Game Button In Lua? Reply with quote

Hi I Want To Make Run Game Button In Lua Script That Run Exe Directly Without Browse & I Know The Trainer Must Be In The Same Directory With The Game
Any Idea Any Sample?

Waiting Reply
Back to top
View user's profile Send private message AIM Address
Shahryar
Advanced Cheater
Reputation: 0

Joined: 11 Jun 2011
Posts: 85

PostPosted: Thu Jun 30, 2011 6:28 am    Post subject: Re: Help Dark Byte How To Make Run Game Button In Lua? Reply with quote

Hello. I'm not Dark Byte but I asked him The same question, and he also told me the following methods.
if you don't know the file path, you can use of following code:
Code:
function LaunchClick()
local filetolaunch=openDialog_execute(CETrainer_OD)
if filetolaunch~='' then
local f = shellExecute(filetolaunch);
end
end

for use of this code, create OpenDialog object in your trainer.
also you can use of following code.
Code:
function LaunchClick()
local filetolaunch=openDialog_execute(CETrainer_OD)
if filetolaunch~='' then
local f = io.popen( '"'..filetolaunch..'"');
end
end

also for use of this code, create OpenDialog object in your trainer.
OD in this codes is OpenDialog object's name.
Main code is:
Code:
shellExecute(filetolaunch);

and
Code:
local f=io.popen( '"'..filetolaunch..'"');

if you know the file path just put the file path instead Path
for example:
Code:
shellExecute([[c:\program files\game folder\file.exe]]);

also you can use of following code:
Code:
local f=io.popen( "c:\\program files\\game folder\\file.exe");

I hope your problem is solved.


Last edited by Shahryar on Thu Jun 30, 2011 3:06 pm; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Wheel Of Fate
Advanced Cheater
Reputation: 0

Joined: 01 Oct 2010
Posts: 75

PostPosted: Thu Jun 30, 2011 8:17 am    Post subject: Reply with quote

not working
Its Open Cmd.exe Dos Window
can you give me a full script that worked with you
for opening exe directly?

and i will try to learn from it
Back to top
View user's profile Send private message AIM Address
Shahryar
Advanced Cheater
Reputation: 0

Joined: 11 Jun 2011
Posts: 85

PostPosted: Thu Jun 30, 2011 9:57 am    Post subject: Reply with quote

Wheel Of Fate wrote:
not working
Its Open Cmd.exe Dos Window
can you give me a full script that worked with you
for opening exe directly?

and i will try to learn from it


try this code:
Code:
function LaunchClick()
local filetolaunch=openDialog_execute(CETrainer_OD)
if filetolaunch~='' then
local f = shellExecute(filetolaunch);
end
end

CETrainer is trainer's form name and OD is openDialog object name. you can create openDialog object by choosing from FormDesigner in trainer maker and click a free space in your trainer. you must change openDialog's name to OD.

or
Code:
shellExecute([[c:\program files\game folder\file.exe]]);

just put it under the onClick event handler of a button and change the path in script.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Wheel Of Fate
Advanced Cheater
Reputation: 0

Joined: 01 Oct 2010
Posts: 75

PostPosted: Thu Jun 30, 2011 2:42 pm    Post subject: Reply with quote

Code:
shellExecute([[c:\program files\game folder\file.exe]]);


This One Working But Crash The Game At Start
Back to top
View user's profile Send private message AIM Address
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Jun 30, 2011 2:54 pm    Post subject: Reply with quote

try
shellExecute([[c:\program files\game folder\file.exe]],'', [[c:\program files\game folder\]] );

_________________
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
View user's profile Send private message MSN Messenger
Shahryar
Advanced Cheater
Reputation: 0

Joined: 11 Jun 2011
Posts: 85

PostPosted: Thu Jun 30, 2011 3:00 pm    Post subject: Reply with quote

Wheel Of Fate wrote:
Code:
shellExecute([[c:\program files\game folder\file.exe]]);


This One Working But Crash The Game At Start


if you know the game's path use following code:
Code:
shellExecute([[c:\program files\game folder\file.exe]], "", [[c:\program files\game folder\]], SW_MINIMIZE);

I've tried and worked.
but if you don't know the game's path, I'm sorry, I do not know what to do. Sad
I asked the same question, but I still have not received a response from others.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Jun 30, 2011 4:10 pm    Post subject: Reply with quote

try a registry lua package (or call the command line registry command manually) and find the address where it is installed
check some lua sites on information on how to do that

_________________
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
View user's profile Send private message MSN Messenger
Wheel Of Fate
Advanced Cheater
Reputation: 0

Joined: 01 Oct 2010
Posts: 75

PostPosted: Thu Jun 30, 2011 4:50 pm    Post subject: Reply with quote

im sorry but i wans’t mean that
i was mean that the trainer and the game in the same
directory and i want the trainer to give command to windows to open
the game .exe but from the trainer thats all
is that possible?

like this one :
http://s000.tinyupload.com/index.php?file_id=85354419592327772146





As We See In The Picture That The Game Called From The Same Directory
Where Trainer Is Exist Not From Registry


Last edited by Wheel Of Fate on Thu Jun 30, 2011 5:09 pm; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Jun 30, 2011 5:09 pm    Post subject: Reply with quote

no, the standalone trainer does not run in the same folder as the game
_________________
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
View user's profile Send private message MSN Messenger
Wheel Of Fate
Advanced Cheater
Reputation: 0

Joined: 01 Oct 2010
Posts: 75

PostPosted: Thu Jun 30, 2011 5:12 pm    Post subject: Reply with quote

Dark Byte wrote:
no, the standalone trainer does not run in the same folder as the game


So Whats Your explanation For The Pictures I Posted Above?
you try it yourself rename any game to the the executable that this trainer want and it will run
Back to top
View user's profile Send private message AIM Address
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Jun 30, 2011 5:37 pm    Post subject: Reply with quote

What I am saying is that the Cheat Engine generated trainers do not run in the same folder as where they get executed from

you can of course use command line parameters to find the executable path of the origin trainer exe and use that to fetch the location of the game, you could then just as well use the registry command line parameter to fetch the location of the game

_________________
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
View user's profile Send private message MSN Messenger
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