help with a small "loading" question
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

help with a small "loading" question

Started by blackwings, 16 November, 2004, 12:34:25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

blackwings

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?


nErBoS

#1
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
--## nErBoS Spot ##--

blackwings

should I put it in main() or in the DataArrival()?


Psycho_Chihuahua

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
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Herodes

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.. :)

((UKSN))shad_dow

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
creator of Therapy-X? bot

SMF spam blocked by CleanTalk