"Use lua io for work with files. Read lua reference manual." Thanks Enyby I read the tutorial it's very good.
The functions that I wrote are to obtain the directory where the script is being executed (current directory), I give an example of what I am using in case one of them serves: this is the principal file "All.lua":
local path=p:sub(2,-string.len(string.gsub(p,".*\/",""))-1) gg.toast('First Character CHANGES',true)
dofile(path .. "Character1.lua") gg.toast('Second Character CHANGES',true)
dofile(path .. "Character2.lua") The file Character1.lua it is in the same directory and contains (this is an extract of the file) :
gg.clearResults() gg.toast('Defenses',true) gg.searchNumber ('9012D;159F::32', gg.TYPE_FLOAT) gg.searchNumber ('159', gg.TYPE_FLOAT) gg.getResults(gg.getResultCount()) gg.editAll('999999', gg.TYPE_FLOAT)
[... more changes etc...]
***( The second file changes the search number for the 2 character)
In this way we can place the script in any directory and can find the files that have to execute and be able to have the most ordered and shortest code. Dividing, in my case by characters, so when I upload the level and the values change I just have to open the corresponding character file and do the changes.
I hope I explained well. Sorry for my English