Advertisement
yeeeeeeeeeeeee

eee

Mar 20th, 2025
227
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. print("Programming Environment")
  2. print("Commands: 'run <file>', 'save <file>', 'load <file>', 'exit'")
  3. while true do
  4.     write("> ")
  5.     local input = read()
  6.     local command, arg = string.match(input, "^(%S+)%s*(.*)$")
  7.     if command == "run" and arg then
  8.         if fs.exists(arg) then
  9.             local success, err = pcall(function() shell.run(arg) end)
  10.             if not success then
  11.                 print("Error: " .. err)
  12.                 local log = fs.open("/error_log.txt", "a")
  13.                 log.writeLine("Error while running " .. arg .. ": " .. err)
  14.                 log.close()
  15.             end
  16.         else
  17.             print("File not found.")
  18.         end
  19.     elseif command == "save" and arg then
  20.         write("Enter your code. Type 'end' to finish.")
  21.         local code = ""
  22.         while true do
  23.             local line = read()
  24.             if line == "end" then break end
  25.             code = code .. line .. "\n"
  26.         end
  27.         local file = fs.open(arg, "w")
  28.         file.write(code)
  29.         file.close()
  30.         print("File saved as " .. arg)
  31.     elseif command == "load" and arg then
  32.         if fs.exists(arg) then
  33.             local file = fs.open(arg, "r")
  34.             print(file.readAll())
  35.             file.close()
  36.         else
  37.             print("File not found.")
  38.         end
  39.     elseif command == "exit" then
  40.         break
  41.     else
  42.         print("Invalid command.")
  43.     end
  44. end
  45.  
Advertisement
Comments
  • responsive02
    14 hours
    # text 0.82 KB | 0 0
    1.  
    2. https://upfiles.com/XKUzY
    3.  
    4. https://upfiles.com/DZ0R4GPq
    5.  
    6. https://upfiles.com/pdC7LJ
    7. https://upfiles.com/AHjK6cF
    8.  
    9. https://upfiles.com/SYa5z9oB
    10. https://upfiles.com/Nq50ub
    11.  
    12. https://upfiles.com/09KH
    13. https://upfiles.com/JOB5A8
    14.  
    15. https://upfiles.com/5awI
    16. https://upfiles.com/7iX84aQA
    17.  
    18. https://upfiles.com/8w3F
    19. https://upfiles.com/n8Aj
    20. https://upfiles.com/lRwHx
    21.  
    22. https://upfiles.com/fRdZ
    23. https://upfiles.com/w4Fn
    24. https://upfiles.com/tBj5
    25.  
    26. https://upfiles.com/LSayX
    27. https://upfiles.com/D1ICtLyq
    28. https://upfiles.com/U5kq
    29.  
    30. https://upfiles.com/OOKTpYO
    31. https://upfiles.com/1OANvd
    32.  
    33. https://upfiles.com/4lYCJJ3v
    34. https://upfiles.com/icYwoqQZ
    35.  
    36. https://upfiles.com/hDAEwOV
    37. https://upfiles.com/PG8cyJ
    38.  
    39. https://upfiles.com/mrEqGsT5
    40. https://upfiles.com/pFdorL
    41.  
    42. https://upfiles.com/EKoZ
    43. https://upfiles.com/wclBkBb
  • responsive02
    14 hours
    # text 1.64 KB | 0 0
    1. https://bigwarp.io/7txvvw88j47z
    2.  
    3. https://bigwarp.io/37cal9qxtkfd
    4.  
    5. https://bigwarp.io/yojwi7en1pvq
    6.  
    7. https://bigwarp.io/qijd9p456n3q
    8.  
    9. https://bigwarp.io/8q8rweiy8jbr
    10.  
    11. https://bigwarp.io/twu7014koab0
    12.  
    13. https://bigwarp.io/a52gx3me2yb6
    14.  
    15. https://bigwarp.io/vbg8tr63zpg7
    16.  
    17. https://bigwarp.io/0buj2xybbiya
    18.  
    19. https://bigwarp.io/bpkjblxxvcne
    20.  
    21. https://bigwarp.io/2uybz9tn4ylx
    22.  
    23. https://bigwarp.io/zgj5po6pvxzi
    24.  
    25. https://bigwarp.io/mku1zg635c3p
    26.  
    27. https://bigwarp.io/ehrx7oehy8dz
    28.  
    29. https://bigwarp.io/sgrz07aqfp65
    30.  
    31. https://bigwarp.io/xrhv7lzwf1lg
    32.  
    33. https://bigwarp.io/lng31yy8nn5t
    34.  
    35. https://bigwarp.io/1m2pzph656py
    36.  
    37. https://bigwarp.io/qigrntkn99pb
    38.  
    39. https://bigwarp.io/8zndb2n6jiwy
    40.  
    41. https://bigwarp.io/8ekzkk952yu3
    42.  
    43. https://bigwarp.io/1u99fslfyel0
    44.  
    45. https://bigwarp.io/n6cq48ytrt2i
    46.  
    47. https://bigwarp.io/u1id0cxubkyb
    48.  
    49. https://bigwarp.io/256mpeyeztk7
    50.  
    51. https://bigwarp.io/4tj0wc77cwa6
    52.  
    53. https://bigwarp.io/smia0be9sl37
    54.  
    55. https://bigwarp.io/4ewhxoikf7h5
    56.  
    57. https://bigwarp.io/2in30egwonhl
    58.  
    59. https://bigwarp.io/tqy9xpjngixh
    60.  
    61. https://bigwarp.io/h9xehnci6u8h
    62.  
    63. https://bigwarp.io/qwpzfxbpgu4g
    64.  
    65. https://bigwarp.io/l3cf70paqezn
    66.  
    67. https://bigwarp.io/d0t4fi81l11u
    68.  
    69. https://bigwarp.io/0gzjnnvnrtu3
    70.  
    71. https://bigwarp.io/aak8g4hw082r
    72.  
    73. https://bigwarp.io/if31zbaew096
    74.  
    75. https://bigwarp.io/afpl9j47wc3p
    76.  
    77. https://bigwarp.io/fphgzk153qxu
    78.  
    79. https://bigwarp.io/c16cno5bjc4e
    80.  
    81. https://bigwarp.io/x6xtle3ba6u0
    82.  
    83. https://bigwarp.io/aav4uxfa6vy4
    84.  
    85. https://bigwarp.io/rxzo4cgcquty
    86.  
    87. https://bigwarp.io/tga6z9h6iblh
    88.  
    89. https://bigwarp.io/mux73oomlrk4
    90.  
    91. https://bigwarp.io/ojso2y0iiqla
    92.  
    93. https://bigwarp.io/r2x3ww3buw4q
    94.  
    95. https://bigwarp.io/43a823em4m6g
    96.  
Add Comment
Please, Sign In to add comment
Advertisement