Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drawbox (obj,color,posx,posy,sizex,sizey)
- for x=0,sizex do
- for y=0,sizey do
- obj.setCursorPos(posx+x,posy+y)
- obj.setBackgroundColour(color)
- obj.write(" ")
- end
- end
- end
- function visual_temp(obj,label,c1,c2,value,scale,posx,posy,sizex,sizey,units)
- if sizey > sizex then
- else
- print ("room of bar "..sizex)
- howmuch = value/scale
- print (howmuch)
- bstr=""
- howmuch = math.ceil(howmuch * sizex)
- text = label.." "..value..units
- printamount = howmuch
- if string.len(text) > howmuch then
- printamount = string.len(text)
- end
- for a= 0,printamount do
- if howmuch > a then
- obj.setBackgroundColor(c2)
- obj.setTextColor(c1)
- else
- obj.setBackgroundColor(c1)
- obj.setTextColor(c2)
- end
- obj.setCursorPos(posx+a,posy)
- if a < string.len(text) then
- obj.write(string.sub(text,a,a))
- else
- obj.write(" ")
- end
- end
- obj.setCursorPos(posx,posy)
- end
- end
- function show_side(obj,array,c1,c2)
- msx, msy = obj.getSize()
- for a= 1, table.getn(array) do
- if type(array[a]) =="table" then
- g = array[a]
- print (g[1].." "..g[2].." "..g[3])
- visual_temp(obj,g[1],c1,c2,g[2],g[3],1,msy-a,msx,o,g[4])
- elseif type(array[a]) =="string" then
- obj.write(array[a])
- end
- end
- end
- fakeobj ={"reactor",{"case",200,2000,"C"},
- {"feul",300,2000,"C"},
- {"steam/t",2222,1600,"mb/t"},
- "turbine",{"rpm",1800,2000,"Rpm"},
- {"energy",404030,1000000,"RF"},
- {"valve",1500,2000,"mb"}
- }
- monitor = peripheral.wrap("left")
- monitor.setTextScale(0.5)
- monitor.setBackgroundColor(colors.black)
- monitor.setTextColor(colors.white)
- monitor.clear()
- monx,mony = monitor.getSize()
- show_side(monitor,fakeobj,colors.white,colors.black)
- --lors.black,colors.white,100*a,2000,1,mony-a,monx,0,"C")
- --drawbox (monitor,colors.red,4,4,10,10)
- --drawbox (term,colors.red,4,4,10,10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement