PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Help with scripts => Topic started by: Josecar on 05 October, 2008, 04:10:39

Title: dofile problem
Post by: Josecar on 05 October, 2008, 04:10:39
Why this code --> dofile("config.tbl") that works perfectly well in ptokax 0.400 gives me that error in 0.411:

[23:05] S?ntaxis cannot open Config.tbl: No such file or directory

and the same for all dofile ---> dofile("Amistad/Niveles.tbl"), dofile(sCarpetaEstado.."Clonables.tbl") etc.

I'll be grateful if some help comes.

Thanks in advance.

Title: Re: dofile problem
Post by: Thor on 05 October, 2008, 11:05:05
Where is the script? Try ./scripts/Amistad/Niveles.tbl Or you can use Core.GetPtokaXPath() too.
Title: Re: dofile problem
Post by: bastya_elvtars on 05 October, 2008, 15:26:50
Actually, GetPtokaXPath() is the recommended way.
Title: Re: dofile problem
Post by: Josecar on 05 October, 2008, 17:08:40
Worked ok.

I've used Core.GetPtokaXPath() that way:

sPtxFolder = Core.GetPtokaXPath()
dofile(sPtxFolder.."scripts/Amistad/Niveles.tbl") - Core.GetPtokaXPath() returns all via, including the last "/"

Very grateful to both of you.