Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local m=peripheral.wrap('top')
- local col=m.setTextColor
- local colB=m.setBackgroundColor
- local c=colors
- m.pos=m.setCursorPos
- local lvl=0
- local done=0
- local guess=0
- local maxexp=0
- local exp=0
- function mwri(co, stri)
- col(co)
- m.write(tostring(stri))
- end
- while true do
- m.clear()
- m.setTextScale(1)
- m.pos(1,1)
- term.clear()
- term.setCursorPos(1,1)
- lxp=peripheral.call('bottom','getTankInfo')[1].contents.amount
- exp=lxp/20
- print(lxp,' mB of Liquid XP')
- print()
- print('Total: ',exp,' EXP')
- mwri(c.cyan,lxp)
- mwri(c.lime,' mB ')
- m.pos(1,2)
- mwri(c.cyan,exp)
- mwri(c.lime,' XP ')
- lvl=0
- done=0
- repeat
- if lvl>=30 then
- guess =3.5*(lvl^2)-151.5*lvl+2220
- maxexp= 7*lvl-148
- elseif lvl>=15 then
- guess =1.5*(lvl^2)-29.5*lvl+360
- maxexp= 3*lvl-28
- else --lvl<15
- guess =17*lvl
- maxexp=17
- end
- if guess-exp>0 then
- done=1
- else
- lvl=lvl+1
- end
- until done==1
- local lowexp=maxexp-(guess-exp)
- local hundo=0
- if lowexp>0 then
- hundo=math.floor(lowexp/maxexp*100)
- end
- print('Level: ',lvl-1)
- print('EXP: ',lowexp,'/',maxexp,' (',hundo,'%)')
- m.pos(1,3)
- mwri(c.cyan,'Lvl: ')
- mwri(c.lime,lvl-1)
- m.pos(1,4)
- mwri(c.cyan,'EXP: ')
- mwri(c.lime,lowexp)
- mwri(c.cyan,'/')
- mwri(c.lime,maxexp)
- mwri(c.cyan,' (')
- mwri(c.lime,hundo)
- mwri(c.cyan,'%)')
- sizeX=m.getSize()
- for i=1,sizeX do
- m.pos(i,5)
- procent = math.floor(i/sizeX*100)
- if procent < hundo then
- colB(c.lime)
- else
- colB(c.cyan)
- end
- mwri(c.white,' ')
- end
- colB(c.black)
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement