How do you code so that another .lua folder in a subfolder gets started and loaded into ptokax,
as if it were located in the script folder?
Hi,
You can use the function...
dofile("PATH")
..you can also use a combination wiht the assert function to appear what ever you want in the script editor if the function dofile returns nil...
asset(dofile("PATH"), "FILE NOT FOUND")
Best regards, nErBoS
should I put it in main() or in the DataArrival()?
asset(dofile("PATH"), "FILE NOT FOUND")
should work if you put it in before anything else :D
first asset then Main() then DataArrival()
Thats how i did it.
Hope it helps u 2
assert(some_condition, error_message)
the assert function is used for checking if the "some_condition" ,
which means stuff like type("is this a string") == "string".
If the "some_condition" part isnt "true" then it halts execution,
of the function, and issues an error_message.
The error message has to be a returned or resolved string and can be customised.
thats just spreading lua around.. :)
well heres how i added my addons folder aka other scripters scripts with out moding there code
Scripts = { ["foldername/Scriptname.lua"] = 1 , ["foldername/Scriptname2.lua"] = 1
}
function Main()
for i,v in Scripts do
if v == 1 then
assert(dofile(i), i.." is not found") --//loads all scripts in the scripts array
end
end
end
yours
shad