View difference between Paste ID: MbQahMmD and TDkqXTdP
SHOW: | | - or go back to the newest paste.
1
-- bank.lua
2
local tArgs = {...}
3-
 if tArgs[1] == "help" then
3+
4-
  print("Usages:")
4+
5-
  print("requestStatement(key,name,id)")
5+
	if tArgs[1] == "help" then
6-
  print("sendTransaction(key,name,sum,id)")
6+
		print("Usages:")
7-
 else
7+
		print("requestStatement(key, name, id)")
8-
  local new = fs.open(tArgs[1]..".lua","w")
8+
		print("sendTransaction(key, name, sum, id)")
9-
  new.writeLine("local id = --UserInput--")
9+
10-
  new.close()
10+
	else
11-
 end
11+
		local new = fs.open(tArgs[1] .. ".lua", "w")
12
		new.writeLine("local id = --UserInput--")
13
		new.close()
14-
function requestStatement(lock,name,pc)
14+
	end
15-
 rednet.send(pc,{"read",name,"placeholder",lock})
15+
16-
 local id,message = rednet.receive()
16+
17-
 if id == pc then
17+
function requestStatement(lock, name, pc)
18-
  return message
18+
	rednet.send(pc, {"read", name, "placeholder", lock})
19-
 end
19+
	local id, message = rednet.receive()
20
	if id == pc then
21
		return message
22-
function sendTransaction(lock,name,sum,pc)
22+
	end
23-
 rednet.send(pc,{"write",name,sum,lock})
23+
24
25
function sendTransaction(lock, name, sum, pc)
26
	rednet.send(pc, {"write", name, sum, lock})
27
end