file = fs.open("/rom/programs/computer/Nightfall/savedvars/SFGarageDoorStatus.txt", "w")
if file then
input = read()
file.write(input)
file.close()
print("Saved "..input..".")
else
print("Failed")
end
[LUA][Help] writing text to a file
#1
Posted 07 October 2012 - 11:20 PM
#2
Posted 07 October 2012 - 11:32 PM
#4
Posted 07 October 2012 - 11:57 PM
#5
Posted 08 October 2012 - 12:02 AM
#6
Posted 08 October 2012 - 12:17 AM
Kingdaro, on 08 October 2012 - 12:02 AM, said:
Okay, I put the file in the same folder as the script that is doing it but it still doesn't work. Even if I delete the lol.txt file it still wants me to type it therefor indicating that it found the file :? It doesn't write inside the file though .
file = fs.open("lol.txt", "w")
if file then
input = read()
file.write(input)
file.close()
print("read "..input..".")
else
print("Failed")
end
#7
Posted 08 October 2012 - 12:25 AM
#9
Posted 08 October 2012 - 01:40 AM
Is the code in your /saves/[you world name]/computer/[your computer id]?
#10
Posted 08 October 2012 - 01:59 AM
Kingdaro, on 08 October 2012 - 01:40 AM, said:
Is the code in your /saves/[you world name]/computer/[your computer id]?
I'm using a multiplayer server, might this be the problem?
Path for code: H:HurrdurrGamesMCTekkit_Server_3.1.2modsComputerCraftluaromprogramscomputerNightfallsave.lua
Path for file: H:HurrdurrGamesMCTekkit_Server_3.1.2modsComputerCraftluaromprogramscomputerNightfalllol.txt
#11
Posted 08 October 2012 - 04:31 AM
#12
Posted 08 October 2012 - 05:03 AM
sidekick_, on 08 October 2012 - 01:59 AM, said:
Kingdaro, on 08 October 2012 - 01:40 AM, said:
Is the code in your /saves/[you world name]/computer/[your computer id]?
I'm using a multiplayer server, might this be the problem?
Path for code: H:HurrdurrGamesMCTekkit_Server_3.1.2modsComputerCraftluaromprogramscomputerNightfallsave.lua
Path for file: H:HurrdurrGamesMCTekkit_Server_3.1.2modsComputerCraftluaromprogramscomputerNightfalllol.txt
Future notice,
when someone asks for the path.. they mean in CC, not on your literal computer... thank you Mr. Hurrdurr
#13
Posted 08 October 2012 - 08:55 PM
hego555, on 08 October 2012 - 05:03 AM, said:
sidekick_, on 08 October 2012 - 01:59 AM, said:
Kingdaro, on 08 October 2012 - 01:40 AM, said:
Is the code in your /saves/[you world name]/computer/[your computer id]?
I'm using a multiplayer server, might this be the problem?
Path for code: H:HurrdurrGamesMCTekkit_Server_3.1.2modsComputerCraftluaromprogramscomputerNightfallsave.lua
Path for file: H:HurrdurrGamesMCTekkit_Server_3.1.2modsComputerCraftluaromprogramscomputerNightfalllol.txt
Future notice,
when someone asks for the path.. they mean in CC, not on your literal computer... thank you Mr. Hurrdurr
Yeah I had no clue what to name my hdd...
The file im trying to write to now is at path: H:/Hurrdurr/Games/MC/Tekkit_Server_3.1.2/RandomStuff/computer/388/SFGarageDoorStatus.txt
-- RandomStuff is the name of the world map. I've tried that path and "RandomStuff/computer/388/SFGarageDoorStatus.txt" but it doesn't work.
How do I get it work?
#14
Posted 08 October 2012 - 11:39 PM
sidekick_, on 08 October 2012 - 08:55 PM, said:
hego555, on 08 October 2012 - 05:03 AM, said:
sidekick_, on 08 October 2012 - 01:59 AM, said:
Kingdaro, on 08 October 2012 - 01:40 AM, said:
Is the code in your /saves/[you world name]/computer/[your computer id]?
I'm using a multiplayer server, might this be the problem?
Path for code: H:HurrdurrGamesMCTekkit_Server_3.1.2modsComputerCraftluaromprogramscomputerNightfallsave.lua
Path for file: H:HurrdurrGamesMCTekkit_Server_3.1.2modsComputerCraftluaromprogramscomputerNightfalllol.txt
Future notice,
when someone asks for the path.. they mean in CC, not on your literal computer... thank you Mr. Hurrdurr
Yeah I had no clue what to name my hdd...
The file im trying to write to now is at path: H:/Hurrdurr/Games/MC/Tekkit_Server_3.1.2/RandomStuff/computer/388/SFGarageDoorStatus.txt
-- RandomStuff is the name of the world map. I've tried that path and "RandomStuff/computer/388/SFGarageDoorStatus.txt" but it doesn't work.
How do I get it work?
...
you just did it again
you dont have to give us all that!!!
Just /SFGarageDoorStatus.txt
means the same thing!
#15
Posted 09 October 2012 - 11:00 AM
hego555, on 08 October 2012 - 11:39 PM, said:
sidekick_, on 08 October 2012 - 08:55 PM, said:
hego555, on 08 October 2012 - 05:03 AM, said:
sidekick_, on 08 October 2012 - 01:59 AM, said:
Kingdaro, on 08 October 2012 - 01:40 AM, said:
Is the code in your /saves/[you world name]/computer/[your computer id]?
I'm using a multiplayer server, might this be the problem?
Path for code: H:HurrdurrGamesMCTekkit_Server_3.1.2modsComputerCraftluaromprogramscomputerNightfallsave.lua
Path for file: H:HurrdurrGamesMCTekkit_Server_3.1.2modsComputerCraftluaromprogramscomputerNightfalllol.txt
Future notice,
when someone asks for the path.. they mean in CC, not on your literal computer... thank you Mr. Hurrdurr
Yeah I had no clue what to name my hdd...
The file im trying to write to now is at path: H:/Hurrdurr/Games/MC/Tekkit_Server_3.1.2/RandomStuff/computer/388/SFGarageDoorStatus.txt
-- RandomStuff is the name of the world map. I've tried that path and "RandomStuff/computer/388/SFGarageDoorStatus.txt" but it doesn't work.
How do I get it work?
...
you just did it again
you dont have to give us all that!!!
Just /SFGarageDoorStatus.txt
means the same thing!
I tried that too, it didn't work
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











