Hello! I would like to know how to load code from a file without an api like os.loadApi() or shell.run() tnx ~GreenGene
Load code from a file
Started by GreenGene, Oct 29 2015 02:03 AM
4 replies to this topic
#1
Posted 29 October 2015 - 02:03 AM
#2
Posted 29 October 2015 - 02:09 AM
I found that loadstring() works, thank you for viewing this topic though
#3
Posted 29 October 2015 - 05:21 AM
or dofile("path")
#4
Posted 29 October 2015 - 07:38 AM
dofile is better I think
#5
Posted 29 October 2015 - 11:38 AM
Dofile uses loadstring, so it really is up to preference. Since he said load code from a file out of the two loadstring is definitely the better direct solution.
However, there is a function defined in the bios that will save you a little time, if you only want to load the file as a function but not have it automatically executed like if you were to use dofile. loadfile just loads the file at the given path, and iirc you can pass an environment as the second arg which is used when loadstringing the file.
However, there is a function defined in the bios that will save you a little time, if you only want to load the file as a function but not have it automatically executed like if you were to use dofile. loadfile just loads the file at the given path, and iirc you can pass an environment as the second arg which is used when loadstringing the file.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











