Atom888

Concept: Xegstrery (Data Table Structure) API

Jun 10th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.00 KB | None | 0 0
  1. -- ==== Concept: Xegstery (Data Table Structure) API ==== --
  2. -- ====-By XILION Also Called Atom888-==== --
  3. -- VariableTypes: "lua"
  4. -- Directory Path Locating : [<keyname>][1][<keyname>][1]
  5.  
  6. dat = fs.open("/xeg","r")
  7. data = data.readAll()
  8. dat.close()
  9.  
  10. -- dirpathfunc : "function() <xegpath> = val end"
  11. function configDir(contentfunc,dirpathfunc)
  12.    dat = fs.open("/xeg","r")
  13.    data = dat.readAll()
  14.    dat.close()
  15.    content = contentfunc()
  16.    content[2] = "dir"
  17.    content[3] = nil
  18.    content[4] = true
  19.    dirpathfunc()
  20.    dat = fs.open("/xeg","r")
  21.    dat.write(data)
  22.    dat.close()
  23. end
  24.  
  25. -- readpathfunc : "function() return <"data"xegpath>"
  26. function readData(readpathfunc)
  27.    dat = fs.open("/xeg","r")
  28.    data = data.readAll()
  29.    dat.close()
  30.    rtn = readpathfunc()
  31.    rdt = rtn[1]
  32.    if rtn[2] == "var" then
  33.       if rtn[4] then
  34.          return rdt
  35.       else
  36.          return "XEGERROR:DATA FROM PATH "..rtn.." NOT AVAILIBLE. TechData: TableValueDataArg[1] , AvalibilatyConfig: "..rtn.."[4]"
  37.       end
  38.    else
  39.       return "XEGERROR:KEYTYPE "..rtn.." INVAILD. TechData: keytypeConfig: "..rtn.."[2]"
  40.    end
  41. end
  42.  
  43. -- vardatlistfunc : "function() return <dataVarList: "[<value>,<keytype "var","dir"><if type= var (<variableType *More Data At Beginning*>)>,<availible true/false>]">"
  44. -- mainprocesfunc : "function() <"data"xegpath> = val end"
  45. function configDataX(vardatlistfunc,mainprocesfunc)
  46.    dat = fs.open("/xeg","r")
  47.    data = data.readAll()
  48.    dat.close()
  49.    val = vardatlistfunc()
  50.    mainprocesfunc()
  51.    dat = fs.open("/xeg","r")
  52.    dat.write(data)
  53.    dat.close()
  54.    return "OK."
  55. end
  56.  
  57. -- vallist : "function() return <valueList: "[<value>,<variableType>]"> end"
  58. -- prfunc : "function() <xegpath> = value end"
  59. function configDat(vallist,prfunc)
  60.    dat = fs.open("/xeg","r")
  61.    data = data.readAll()
  62.    dat.close()
  63.    value = vallist
  64.    value[2] = value[3]
  65.    value[2] = "var"
  66.    value[4] = true
  67.    prfunc()
  68.    dat = fs.open("/xeg","r")
  69.    dat.write(data)
  70.    dat.close()
  71. end
Advertisement
Add Comment
Please, Sign In to add comment