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 


Lua and VBS script interaction

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

Joined: 10 Jan 2016
Posts: 68

PostPosted: Thu Mar 17, 2016 2:22 pm    Post subject: Lua and VBS script interaction Reply with quote

hi guys

concerning the following...

MyPath = TrainerOrigin
--MyPath = "c:\\"



settingsFile = io.open(MyPath.."bp_subscr.ini", "r");


os.execute("wscript " ..MyPath.."Firefox.vbs")


TrainerOrigin works fine for reading data from a file...<"bp_subscr.ini">
but when i try to use TrainerOrigin as part of my path for where the .vbs script is located, it gives me an error that it cant find it at the path...though when i copy my vbs file to c:/ and run it through os.execute("wscript c:/Firefox.vbs") it executes corectly...any idea why?
Back to top
View user's profile Send private message
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Sun Mar 20, 2016 6:14 am    Post subject: Reply with quote

the popup i get with using trainerorigin for the vbs script is "There is no file extension in "C:\.....<the correct path wher the .vbs files and trainer is being kept>...though what baffles me, is im using the same trainer origin in the same script to read other files...AND...the moment i move my files to c:\...and put myPath as "C:\\"...it works fine...
any idea as to where my fault is, or how i can fix it?...as its a bit anoying to work with to different paths and install files to mainroot dir...
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 958

PostPosted: Sun Mar 20, 2016 6:41 am    Post subject: Reply with quote

Only some suggestions.

Have you check if the path has space or unicode character? They may need to be quote in command line,eg:
Code:

local cmd = 'wscript "' ..MyPath..'Firefox.vbs"'
os.execute(cmd)


Try print cmd and see what it is, and may paste in a command prompt to see if it work.

Also, the execution of wscript may need some command prompt environment variable setup.
Try
Code:
local p = io.popen('set')
local ret = p:read('*a')
p:close()
print(ret)

to see if the environment is right,eg. user and system environment may be different.

btw, the TrainerOrigin only exist as a path if the ce is started by clicking '*.ct' '*.cetrainer' or '*.exe(ce save trainer as exe)' from windows explorer (or command prompt), and it won't change if loading another *.ct etc. into ce (by menu file/load or open cheat table icon button ) from another directory.

_________________
- Retarded.
Back to top
View user's profile Send private message
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Sun Mar 20, 2016 7:16 am    Post subject: Reply with quote

panraven wrote:
Only some suggestions.

Have you check if the path has space or unicode character? They may need to be quote in command line,eg:
Code:

local cmd = 'wscript "' ..MyPath..'Firefox.vbs"'
os.execute(cmd)





Laughing Laughing

thnx...that did the trick...Smile
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