Jamieq Posted September 1, 2024 Posted September 1, 2024 This is script I wrote but won't read/ open file , need help local file = io.open("/storage/emulated/0/data/data/files/game_status.bin", "wb") if file then local status = gg.getResults(gg.getResultsCount()) for i, v in ipairs(status) do file:write(string.format("%s\n", v.value)) end file:close() gg.toast("Game status saved to Download folder.") else gg.toast("Failed to open file for writing.") end
Count_Nosferatu Posted September 1, 2024 Posted September 1, 2024 After executing your script, what does file */game_status.bin contain ?
Jamieq Posted September 1, 2024 Author Posted September 1, 2024 Says can't open game status file I figured it out but had to write new script, still if anyone knows easy ways to accomplish this fuction I'll try
Jamieq Posted September 1, 2024 Author Posted September 1, 2024 The full script I'm trying to create is a game status bin replacement with modded game status bin in storage, download ,(for hcr2)
Jamieq Posted September 1, 2024 Author Posted September 1, 2024 This 1 worked ,used to see if I can copy game status bin to storage download. I'm having a hard time finding or opening main game status bin (usually), I learn by trial & error or lucky enough to have a lua script with similar functions. local gg = require("gg") local function replaceGameStatus() local packageName = "com.fingersoft.hcr2" local originalPath = "/data/data/" .. packageName .. "/files/gamestatus.bin" local moddedPath = "/storage/emulated/0/Download/gamestatus.bin" if gg.getFile(originalPath) then gg.copyFile(moddedPath, originalPath) gg.alert("Game status file replaced successfully!") else gg.alert("Original game status file not found!") end end replaceGameStatus()
Count_Nosferatu Posted September 1, 2024 Posted September 1, 2024 Each file has a permission: read, write, executable. Each folder has permission: read, write, and to view its content. This is for owner of file and for group owner belongs to. You won't be able to change this using GG. Standard lua function os.execute(command), blocked for security reasons.
HEROGAMEOfficial Posted September 2, 2024 Posted September 2, 2024 Before ask learn it, or read website game guardian topics
Question
Jamieq
This is script I wrote but won't read/ open file , need help
local file = io.open("/storage/emulated/0/data/data/files/game_status.bin", "wb")
if file then
local status = gg.getResults(gg.getResultsCount())
for i, v in ipairs(status) do
file:write(string.format("%s\n", v.value))
end
file:close()
gg.toast("Game status saved to Download folder.")
else
gg.toast("Failed to open file for writing.")
end
8 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.