View difference between Paste ID: 0h5dtpLX and VEpZqbYj
SHOW: | | - or go back to the newest paste.
1
local thing
2-
local function TROLL(name, TorS)
2+
local function TROLL(name, TorS, name2)
3
if TorS == "table" or TorS == "t" then
4
local file = fs.open(name,"r")
5
local sContents = file.readAll()
6
file.close()
7
thing = textutils.unserialize(sContents)
8-
h=fs.open("TROLLBACKUP", "a")
8+
h=fs.open(name2, "a")
9-
h.writeLine("--------------------------")
9+
10-
h.writeLine("|  "..name.."  |")
10+
11-
h.writeLine("--------------------------")
11+
12
local file = fs.open(name,"r")
13-
h.writeLine("--------------------------")
13+
14-
h.writeLine("|          END           |")
14+
15-
h.writeLine("--------------------------")
15+
16
h=fs.open(name2, "a")
17
h.writeLine(thing)
18
h.close()
19
end
20
end
21
22-
h=fs.open("TROLLBACKUP", "a")
22+
print("File/program name that you want to copy?")
23-
h.writeLine("--------------------------")
23+
24-
h.writeLine("|  "..name.."  |")
24+
25-
h.writeLine("--------------------------")
25+
26
print(">                                         ")
27-
h.writeLine("--------------------------")
27+
print("File/program name that you want to paste?")
28-
h.writeLine("|          END           |")
28+
29-
h.writeLine("--------------------------")
29+
30
local name = read()
31
term.setCursorPos(2,5)
32-
fs.delete(name)
32+
33
term.setCursorPos(2,7)
34
local name2 = read()
35-
print("File name?")
35+
TROLL(name, TorS, name2)
36
print(thing)