Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Add files from local disk to table file via script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
akikazu12
Newbie cheater
Reputation: 0

Joined: 08 Apr 2020
Posts: 14

PostPosted: Wed May 13, 2020 2:21 am    Post subject: Add files from local disk to table file via script Reply with quote

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
View user's profile Send private message
blankTM
Cheater
Reputation: 1

Joined: 03 May 2020
Posts: 49

PostPosted: Wed May 13, 2020 3:01 am    Post subject: Re: Add files from local disk to table file via script Reply with quote

You need the full path

Code:
/

Instead of
Code:
\


createTableFile(Alvalue..".png", "D:/test/"..Alvalue..".png")
Back to top
View user's profile Send private message
akikazu12
Newbie cheater
Reputation: 0

Joined: 08 Apr 2020
Posts: 14

PostPosted: Wed May 13, 2020 10:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites