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 


open special folder in C: [help]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Lynxz Gaming
Expert Cheater
Reputation: 4

Joined: 01 Jul 2017
Posts: 208
Location: help

PostPosted: Mon Feb 19, 2018 7:12 am    Post subject: open special folder in C: [help] Reply with quote

how to open special folder in CConfused
like:
shellExecute("C:\Users\(pcname)\AppData\Local\Growtopia")
how to make it work on all computer
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Mon Feb 19, 2018 8:46 am    Post subject: Re: open special folder in C: [help] Reply with quote

Lynxz Gaming wrote:
how to open special folder in CConfused
like:
shellExecute("C:\Users\(pcname)\AppData\Local\Growtopia")
how to make it work on all computer


Instead of typing full path like "C:\Users\(pcname)\AppData\Local\Growtopia", I prefer giving users the option to search for the files they want to open.

example to try :

Code:
f = createForm()
f.width,f.height = 130, 50
f.caption = ' '
b = createButton(f)
b.left,b.top,b.width,b.height = 10,10,110,30
b.Caption = 'Open File'

function GetFileName(f)
 local str = f
 local temp = ""
 local result = ""
 for i = str:len(), 1, -1 do
 if str:sub(i,i) ~= "/"  then
 temp = temp..str:sub(i,i)
 else
 break
 end
 end
 for j = temp:len(), 1, -1 do
 result = result..temp:sub(j,j)
 end
 return result
end

function exploFile()
 load_dialog = createOpenDialog(self)
 load_dialog.InitalDir = os.getenv('%USERPROFILE%')
 load_dialog.execute()
 file = load_dialog.FileName
 a = GetFileName(file)
 if a == nil then
 return a
 else
 -- print(a)  --- should be change to shellExecute here...
 shellExecute(a)
 end
end

b.onClick = exploFile
f.show()


_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Mon Feb 19, 2018 9:13 am    Post subject: Reply with quote

Environment variables.

local path = os.getenv('localappdata') .. '\\Growtopia'

Though letting the user provide the path is a nice extra, particularly for files that can be in different places (ie, game files don't always have to be in program files!)

Alternatively, read the path from the game... it's probably in there somewhere.

_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
Lynxz Gaming
Expert Cheater
Reputation: 4

Joined: 01 Jul 2017
Posts: 208
Location: help

PostPosted: Mon Feb 19, 2018 10:09 am    Post subject: Reply with quote

thank you corroder and FreeEr
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Mon Feb 19, 2018 10:51 am    Post subject: Re: open special folder in C: [help] Reply with quote

Lynxz Gaming wrote:
how to open special folder in CConfused
like:
shellExecute("C:\Users\(pcname)\AppData\Local\Growtopia")
how to make it work on all computer


The covers you are using are arranged to take out.
With this code internally, it will enable you to open each .EXE!
Code:
shellExecute([[C:\Users\(pcname)\AppData\Local\Growtopia.exe]]);


The game you open,
with an onClick or
If you want to close with Trainer Close, tell it absolutely.
I can suggest a way. Wink

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website 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