Advertisement
incinirate

Startup For Apartment Code

Nov 16th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. term.clear()
  2. rednet.open("back")
  3. print "DexCorp Technoligies v1.0"
  4. id, input = rednet.receive()
  5. print(input)
  6. if input == "new" then
  7. id, newname = rednet.receive()
  8. newacc = fs.open(newname, "w")
  9. newacc.writeLine(100)
  10. newacc.close()
  11. shell.run("startup")
  12. end
  13. handle = fs.open(input,"r")
  14. balance = tonumber(handle.readLine())
  15. if balance > 10 then
  16. balance = balance - 10
  17. else
  18. --no acceptance
  19. end
  20. handle.close()
  21. handle = fs.open(input,"w")
  22. handle.write(balance)
  23. handle.close()
  24. print ("Name:"..input)
  25. print ("Current Bal:"..tostring(balance+10))
  26. print ("New Bal:"..balance)
  27. print ("Accepted")
  28. sleep(5)
  29. shell.run("startup")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement