Marlingaming

Central Interface and Personality Disk Operating Reader Base

Jun 13th, 2022 (edited)
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.92 KB | None | 0 0
  1. --CIaPDOR
  2. --Central Interface and Personality Disk Operating Reader
  3. --//Basic Formats//
  4. --colon is used to define B as A (A:B, ex. "Funct:Setup" defines B as a Function)
  5. --semi colon is used to add Variables or arguements to a statement(A;B, ex. "Funct:PrintItem;Var1:Y;Var2:text)
  6. --[]brackets are used to grab, set, or erase the variable at the desired position of a list
  7. --()
  8. --{} is used to define a list and its contents, to define a list that has no variables you would need to do A:{}, for defining a list with preset items you would need to do A:{B,C,etc}
  9. --//functions//
  10. --To start a function you need to first do "Funct:A", if you want the function to use predefined variables you would need to add a semi colon then do "A:B" replace A with the name of the variable would be in the function and B with the desired variable.
  11. --to end a function you need to do "Funct:(name);end"
  12. --to call a function you need to do "Call:(name)", to call a function with a variable add ";(Variable)", repeat for each variable desired
  13. --//Operators//
  14. --==Math
  15.  
  16. --==Rednet
  17.  
  18. --==Peripherals
  19.  
  20. --==Memory
  21.  
  22. --==
  23.  
  24. --//ProgramProper//
  25. --dont mess with anything below here
  26. local User_Menu = "home"
  27. local User_Pos = 1
  28. local DiskState = -1 -- -1 = empty, 0 = incompatible disk, 1 = compatible disk, 2 = disk in use
  29. local SystemPath = "n"
  30.  
  31. local Display_MPos = 1
  32. local Display_Text = {}
  33.  
  34.  
  35. function Main()
  36. parallel.waitForAny(Display,Loop)
  37. os.reboot()
  38. end
  39.  
  40. function Display()
  41. while true do
  42.     if User_Menu == "home" then
  43.         Display_Text = {{"run disk",
  44.     elseif User_Menu == "settings" then
  45.            
  46.     elseif User_Menu == "setup" then
  47.            
  48.     end
  49.     term.clear()
  50.    
  51.  
  52. function ReadDisk()
  53. local file = fs.open(SystemPath,"r")
  54. local Functions = {}
  55. local Variables = {}
  56. local Content
  57. local FunctionI = 1
  58. local ReadingFunction = false
  59. repeat
  60.     Content = file.readLine()
  61.     if Content ~= "END" then
  62.         if Content.find("Funct:") then
  63.             if Content.find(";end") then
  64.                 FunctionI = FunctionI + 1
  65.                 ReadingFunction = falsw
  66.             else
  67.                 Functions[FunctionsI][1] = Content.sub(Content.find("Funct:") + 1, Content.find(";") -1)
  68.                 ReadingFunction = true
  69.             end
  70.         elseif
  71.  
  72.         end
  73.         if ReadingFunction == true then
  74.             Functions[FunctionI][#Functions[FunctionI]] = Content
  75.         end
  76.     end
  77. until Content == "END"
  78. while true do
  79.     local event, a, b, c, d = os.pullEvent("Disk_Operation")
  80.     for i = 1, #Functions do
  81.         if a == Functions[i][1] then
  82.             RunFunction(Functions[i])
  83.         end
  84.     end
  85. end
  86. end
  87.  
  88. function RunFunction(List)
  89. for i = 2, #List.len -1 do
  90.     if List[i][1] == "Math" then
  91.  
  92.     elseif List[i][1] == "Rednet" then
  93.  
  94.     elseif List[i][1] == "Peripheral" then
  95.  
  96.     elseif List[i][1] == "Memory" then
  97.  
  98.     elseif List[i][1] == "Power" then
  99.  
  100.     end
  101. end
  102. end
  103.  
  104.  
Add Comment
Please, Sign In to add comment