Advertisement
electronic_steve

ccs : viewer no color

Mar 15th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.56 KB | None | 0 0
  1. if not shell.run("ESGraphics") then
  2. shell.run("pastebin","get","kDm3zq5E","ESGraphics")
  3. shell.run("ESGraphics")
  4.  end
  5. function getmaxpowersave()
  6. local FileList = fs.list("RMCS/")
  7.  
  8. local N=0
  9. for _, file in ipairs(FileList) do
  10.  N=math.max(N,file)
  11. end
  12.  
  13. return N
  14. end
  15. function reader(mode,mode2,name)
  16.  local file = io.open(tostring(name),mode)
  17.                 if file then
  18.                 text=file:read(mode2)
  19.                 file:close()
  20.         end
  21.         return text
  22. end
  23.  
  24. oldfile=reader("r","*l","RMCS/"..getmaxpowersave())
  25.  
  26. map={}
  27.  local N=0
  28.  local N2=1
  29.  local N3=1
  30.  local N4=1
  31.  i=0
  32.  maptable={}
  33.  for n in string.gmatch(oldfile, ".") do
  34.  i=i+1
  35. if i==1 then    maptable={n} end
  36.  if n=="&" then  maptable[#maptable+1]=n else
  37.  maptable[#maptable]=n
  38.  end
  39. end
  40. print(getmaxpowersave())
  41. for i=1,#maptable do
  42.  
  43.  
  44. if i==1 then mapX=tonumber(maptable[i])
  45. elseif i==2 then mapY=tonumber(maptable[i])
  46. elseif i==3 then mapZ=tonumber(maptable[i])
  47. for x=1, mapX do
  48. map[x]={}
  49. for y=1, mapY do
  50. map[x][y]={}
  51. for z=1, mapZ do
  52.  map[x][y][z]=-2
  53. end end end
  54. else
  55.  
  56.  
  57.  
  58. if N2> mapX then N2=1 N3=N3+1 end
  59. if N3> mapY then N3=1 N4=N4+1 end
  60.  
  61. map[N2][N3][N4]=tonumber(maptable[i])
  62.  
  63.  
  64.  N2=N2+1
  65. end
  66.  
  67.  
  68. end
  69. function update()
  70. end
  71. function draw()
  72. gh.text(1,1,1,16,"power:"..getmaxpowersave())
  73. for z=1,mapZ do
  74.  gh.rectangle("line",mapZ*(z-1)+z,2,mapX+1,mapY+1,"O")
  75. for y=1,mapY do
  76. for x=1,mapX do
  77. if  map[x][y][z]==-2 then   else
  78.  
  79. gh.point(x+(mapZ*(z-1)+z),y+2,1,12,"#")
  80. end
  81. end
  82. end
  83.  
  84.  
  85.  
  86.  
  87. end
  88. end
  89. while true do
  90. r.systemupdate()
  91. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement