Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not shell.run("ESGraphics") then
- shell.run("pastebin","get","kDm3zq5E","ESGraphics")
- shell.run("ESGraphics")
- end
- function getmaxpowersave()
- local FileList = fs.list("RMCS/")
- local N=0
- for _, file in ipairs(FileList) do
- N=math.max(N,file)
- end
- return N
- end
- function reader(mode,mode2,name)
- local file = io.open(tostring(name),mode)
- if file then
- text=file:read(mode2)
- file:close()
- end
- return text
- end
- oldfile=reader("r","*l","RMCS/"..getmaxpowersave())
- map={}
- local N=0
- local N2=1
- local N3=1
- local N4=1
- i=0
- maptable={}
- for n in string.gmatch(oldfile, ".") do
- i=i+1
- if i==1 then maptable={n} end
- if n=="&" then maptable[#maptable+1]=n else
- maptable[#maptable]=n
- end
- end
- print(getmaxpowersave())
- for i=1,#maptable do
- if i==1 then mapX=tonumber(maptable[i])
- elseif i==2 then mapY=tonumber(maptable[i])
- elseif i==3 then mapZ=tonumber(maptable[i])
- for x=1, mapX do
- map[x]={}
- for y=1, mapY do
- map[x][y]={}
- for z=1, mapZ do
- map[x][y][z]=-2
- end end end
- else
- if N2> mapX then N2=1 N3=N3+1 end
- if N3> mapY then N3=1 N4=N4+1 end
- map[N2][N3][N4]=tonumber(maptable[i])
- N2=N2+1
- end
- end
- function update()
- end
- function draw()
- gh.text(1,1,1,16,"power:"..getmaxpowersave())
- for z=1,mapZ do
- gh.rectangle("line",mapZ*(z-1)+z,2,mapX+1,mapY+1,"O")
- for y=1,mapY do
- for x=1,mapX do
- if map[x][y][z]==-2 then else
- gh.point(x+(mapZ*(z-1)+z),y+2,1,12,"#")
- end
- end
- end
- end
- end
- while true do
- r.systemupdate()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement