View Full Version : Whats the difference between LoadScript and RunScriptFile??
SonG0han
02-08-2006, 08:12 AM
hi! could anyone tell me whats the difference between application.loadscript and applicatoin.RunScriptFile please? :huh
and is it possible to load a encrypted txt file, decrypt it and execute the lua script in it?? (in "memory" without having to decrypt it to TEMP folder and execute it there and then delete it - or is there any other way to do it?)
TJ_Tigger
02-08-2006, 09:00 AM
In my understanding LoadScript will load the script to make it available to the project, where as RunScriptFile, will not only load but execute the code contained in the script file. As far as when I would use one over the other, I have used LoadScript to load a group of functions that are a core part of a project I have then the functions are available for the application to leverage. The run script I would use when I want the contents of the script available to the application but I want the script to actually perform its job at that time as well.
On your second question, a couple of ways to do this would be to use the crypto plugin to encrypt and decrypt the file as approptriate. I have also used the LUA Compile (http://www.indigorose.com/forums/showpost.php?p=36900&postcount=4) file that was posted in the forum to convert my lua script to a binary file to help hide it contents.
Tigg
and is it possible to load a encrypted txt file, decrypt it and execute the lua script in it?? (in "memory" without having to decrypt it to TEMP folder and execute it there and then delete it - or is there any other way to do it?)
I have found the Crypto.Blowfish actions to be very useful. If you intend to deliver pre-encrypted files with your application, you may need to write a separate program that will allow you to encrypt the files.
Intrigued
02-08-2006, 04:11 PM
One might be interested in my offering here:
http://www.indigorose.com/forums/showthread.php?t=11759&highlight=RC4
Roboblue
02-08-2006, 05:32 PM
Even the Crypto files have to be unencoded to some location before the app can use them.
I unencrypt to an obscure temp location, have the app load the file (text, lua script, whatever) then immediately delete the file in the temp location in the very next line of code. I cannot even see the process if I watch the temp location. Maybe if it was a HUGE file, it would be available long enough for it to show in the temp location, but that would be a rare case. I have instances of decrypting, loading, and deleting the same file several times on a page. I haven't noticed a slow down or any of the files showing up in the temp location.
Also, having just done a menu bar with lua script, one way to hide them is to put them in the audio, video, flash, or even button folders. Then build the project with the resource folder (AutoPlay) renamed. This will hide them pretty well in the dat01 folder.
SonG0han
02-16-2006, 02:41 AM
@TJ_Tigger: Ah.., thanks! ;)
So LoadScript is only good for functions? If I load a script that.... opens a txt file or does anything else, nothwing would happen because it is not executed, right?
an the LuaCompile.exe looks like the perfect solution! :yes
But do you know some kind of readme that explains the params more detailed? what does "process stdin" or "parse only"? :huh
@Intrigued: this one looks very good too, I will test it. :yes
@everyone else: Thanks for your suggestions. :)
TJ_Tigger
02-16-2006, 08:52 AM
an the LuaCompile.exe looks like the perfect solution! :yes
But do you know some kind of readme that explains the params more detailed? what does "process stdin" or "parse only"? :huh
I don't know much about the options other than what it tells you when you type the luacompile and it gives you the help menu. The option of process stdin allows you to type the lua code at the command prompt (in UNIX this is often referred to stdin or Standard In).
As for Parse only, I don't know what it is designed to do.
HTH Tigg
SonG0han
02-16-2006, 01:55 PM
thanks :)
then I will just try and play around with it. :D
Intrigued
02-16-2006, 02:16 PM
I don't know much about the options other than what it tells you when you type the luacompile and it gives you the help menu. The option of process stdin allows you to type the lua code at the command prompt (in UNIX this is often referred to stdin or Standard In).
As for Parse only, I don't know what it is designed to do.
HTH Tigg
It will test the code for errors I believe.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.