Quarter187 Newbie cheater Reputation: 0
Joined: 13 Aug 2022 Posts: 13
|
Posted: Wed Aug 17, 2022 12:47 am Post subject: Writing Value From Text File |
|
|
With this script I can successfully write a value to a text file from an address and have it constantly update itself.
Code: | {$lua}
if syntaxcheck then return end
[ENABLE]
function writefile(path, content)
local file = io.open(path,"w+b")
if file then
file:write(content)
file:close()
return true
else
return false
end
end
Timer=createTimer(MainForm)
Timer.Interval=100
Timer.OnTimer= function(timer)
writefile('shared.txt',readInteger ("21CEAD45E80")..'\n')
end
[DISABLE]
Timer.Enabled=false
Timer.destroy() |
Read with this:
Code: | local file = io.open("shared.txt", "r")
local read = file:read("*all")
file:close()
print(read) |
My question is how do I reverse this action? I want to make a script that will read this value from the text file, write it to a different address, and constantly update itself as well.
|
|