Advertisement
Marlingaming

CC Tweaked CCSPS 20 - SPF Code Runner

Feb 22nd, 2022 (edited)
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. local tArg = {...}
  2. local Path = tArg[1]
  3. local API = {{"print","(",")","print(A)"}}
  4. local w, h = term.getSize()
  5.  
  6. local Buttons = {}
  7. local functions = {}
  8. local Base = {}
  9. local Variables = {}
  10. local FullScreen = false
  11. local Window
  12.  
  13. function UpdateVar(i)
  14. local Name = string.sub(Content,1,string.find(Content," = ") - 1)
  15. local Eq = string.sub(Content,string.find(Content," = ") + 2,string.len(Content))
  16. for I = 1, #Variables do
  17. if Variables[I][1] == Name then
  18. if string.find(Eq,Name) then Variables[I][2] = Variables[I][2] + Eq else Variables[I][2] = Eq end
  19. end
  20. end
  21. end
  22.  
  23. function RunFunction(I)
  24. for i = 1, #functions[I][2] do
  25. local Task = functions[I][2][i]
  26. if string.find(Task,"print") then load.string(Task) end
  27. end
  28. end
  29.  
  30. function Start()
  31. Decode()
  32. end
  33.  
  34. function Decode()
  35. local file = fs.open(Path,"r")
  36. local Content = "no"
  37. local PathingFun = false
  38. local I = 0
  39. repeat
  40. Content = file.readLine()
  41. Base[#Base + 1] = Content
  42. until Content == nil
  43. file.close()
  44. RunProgram()
  45. end
  46.  
  47. function RunProgram()
  48. local B
  49. for i = 1, #Base do
  50. for I = 1, #API do
  51. if string.find(Base[i],API[I][1]) then
  52. B = string.sub(Base[i],string.find(Base[i],API[I][2] + 1),string.find(Base[i],API[I][3] - 1))
  53. local Ex = API[I][4].."("..string.sub(Base[i],string.len(API[I][1]) + string.len(API[I][2]),string.len(Base[i]) - string.len(API[I][3]))..")"
  54. loadstring(Ex)
  55. end
  56. end
  57. end
  58. end
  59.  
  60. Start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement