Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local server = 0
- local sides = {"top","bottom","left","right","front","back"}
- for i = 1,6 do
- a = sides[i]
- if peripheral.getType(a) == "modem" then
- rednet.open(a)
- break
- end
- end
- while true do
- for i = 1,6 do
- a = sides[i]
- if peripheral.getType(a) == "drive" then
- dr = a
- drive = peripheral.wrap(a)
- d = disk.getID(a)
- break
- end
- end
- print("Input protocol ('money','pay')")
- protocol = io.read()
- if protocol == "money" then
- rednet.send(server,d,"money")
- id,msg,_ = rednet.receive()
- b = tostring(msg)
- if b == "new" then
- print("Account Created (0$)")
- else
- print("You have "..b.."$")
- end
- elseif protocol == "pay" then
- print("Pay to?")
- to = io.read()
- print("How many money?")
- money = io.read()
- e = #tostring(d)
- f = 4-e
- g = ""
- for i = 1,f do
- g = g.."0"
- end
- g = tonumber(g..d..money)
- rednet.send(server,g,to)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement