Advertisement
Guest User

api

a guest
Jan 24th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1.  
  2.  
  3. dLoader = {
  4.  
  5. ["setPath"] = function(_f, _r)
  6. if _f == "pwPath" then
  7. _fp = ".passwordField./auth/pwpath./password"
  8. else
  9. _fp = _f
  10. end
  11. file = fs.open(_f, _r)
  12. end,
  13.  
  14. ["getData"] = function(_ch)
  15. if _ch == "line" then
  16. return file.readLine()
  17. file.close()
  18. elseif _ch == "lines" then
  19. tLines = {}
  20. sLine = file.readLine()
  21. while sLine do
  22. table.insert(tLines, sLine)
  23. sLine = file.readLine()
  24. end
  25. file.close()
  26. elseif _ch == "all" then
  27. return file.readAll()
  28. file.close()
  29. end
  30. end,
  31.  
  32. ["setData"] = function(_ch, _c)
  33.  
  34. if type(_ch) == "table" then
  35. for i=1, _ch do
  36. file.writeLine(_ch[i])
  37. end
  38. elseif type(_ch) == "function" then
  39. return
  40. else
  41. file.writeLine(_ch)
  42. end
  43. if _c == true then
  44. file.close()
  45. end
  46. end,
  47.  
  48.  
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement