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 


shellExecute(local filename) not work

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Tue Sep 29, 2015 8:57 pm    Post subject: shellExecute(local filename) not work Reply with quote

I made a CE Trainer with a button function click to execute a local file.

Code:

function CEButton3Click(sender)
shellExecute("flename.exe")
end


The trainer is work fine when click a button to run filename.exe use the function above, with filename.exe placed in same diretory/folder (path) with the trainer.
But when trainer has save as a exe file (stand alone trainer), when click a button, it won't run filename.exe anymore.

Do i need use sheelExecute(path to file) or dofile() or io.popen() or is it able we add a local exe file and run it from/as stream file?
Hope some experts should tell or give an examples to fix the problem.

Is there any lua script (pure lua and no need "require") as a browser function to locating a local file we want to open, except luaBrowser.lua ?

Regards
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Tue Sep 29, 2015 9:42 pm    Post subject: Reply with quote

You need to provide shellExecute with the full path

If the filename is next to the trainer's .exe use TrainerOrigin else use getCheatEngineDir() to get the path to the extracted temp folder

e.g:
Code:

if TrainerOrigin~=nil then
  path=TrainerOrigin
else
  path=getCheatEngineDir()
end

--add dir seperator if needed
if string.sub(path,#path, #path)~="\\" then
  path=path.."\\"
end

shellExecute(path.."filename.exe")


Of course, if the filename.exe has been added using the exe generator add file(s) then use getCheatEngineDir() only

_________________
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
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Wed Sep 30, 2015 9:21 am    Post subject: Reply with quote

Thank you Dark Byte, I understood and implemented the method as your instructions. Now the trainer working properly..

Regards
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