View previous topic :: View next topic |
Author |
Message |
akikazu12 Newbie cheater
Reputation: 0
Joined: 08 Apr 2020 Posts: 14
|
Posted: Wed May 13, 2020 2:21 am Post subject: Add files from local disk to table file via script |
|
|
Hello
I want to add file to table via script
I know createTableFile, but not sure how to use it
I have the files in my local disk, lets say the path is D:\test
the file is png, and the file name is same as value on address list(the address keep changing, yes, there are like 50 files/different values)
example : if the value is 123, then the file name is 123.png (the file exists in D:\test\123.png)
so I want to make it roughly like this
Code: | local Almemrec=addresslist_getMemoryRecordByDescription(getAddressList(), "address1")
local Alvalue=memoryrecord_getValue(Almemrec)
if Alvalue..".png" is not in tablefile then --i know this is so wrong, but you got the point right?
if D:\test\(Alvalue).png exists then --also wrong but you got the point
createTableFile(Alvalue..".png", "D:\test") --not sure how to use this
end
end |
the point is I want to add the D:\test\(Alvalue).png to table files with script(no need to add it again if it already exist in table)
the reason I dont add manually is because sometime I need to add some files again when there is something new, I dont want to generate the trainer again and again
thank you
|
|
Back to top |
|
 |
blankTM Cheater
Reputation: 1
Joined: 03 May 2020 Posts: 49
|
Posted: Wed May 13, 2020 3:01 am Post subject: Re: Add files from local disk to table file via script |
|
|
You need the full path
Instead of
createTableFile(Alvalue..".png", "D:/test/"..Alvalue..".png")
|
|
Back to top |
|
 |
akikazu12 Newbie cheater
Reputation: 0
Joined: 08 Apr 2020 Posts: 14
|
Posted: Wed May 13, 2020 10:44 am Post subject: |
|
|
found it
closed, thank you!
Code: | function file_exists(pathF)
local f=io.open(pathF,"r")
if f~=nil then io.close(f) return true else return false end
end
local Almemrec=addresslist_getMemoryRecordByDescription(getAddressList(), "asd")
local Alvalue=memoryrecord_getValue(Almemrec)
local name = "_"..Alvalue..".png"
if findTableFile(name) == nil then
if file_exists("D:\\test\\"..Alvalue..".png") == true then
createTableFile(Alvalue..".png", "D:\\test\\"..Alvalue..".png")
end
end |
|
|
Back to top |
|
 |
|