Advertisement
Guest User

bank.lua

a guest
May 17th, 2021
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. local tArgs = {...}
  2. if #tArgs > 0 then
  3.  if tArgs[1] == "help" then
  4.   print("Usages:")
  5.   print("requestStatement(key,name,id)")
  6.   print("sendTransaction(key,name,sum,id)")
  7.  else
  8.   local new = fs.open(tArgs[1]..".lua","w")
  9.   new.writeLine("local id = --UserInput--")
  10.   new.close()
  11.  end
  12. end
  13.  
  14. function requestStatement(lock,name,pc)
  15.  rednet.send(pc,{"read",name,"placeholder",lock})
  16.  local id,message = rednet.receive()
  17.  if id == pc then
  18.   return message
  19.  end
  20. end
  21.  
  22. function sendTransaction(lock,name,sum,pc)
  23.  rednet.send(pc,{"write",name,sum,lock})
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement