Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Criteria
- -- must be from getAvailableItems()
- -- ID of 4403
- -- Dmg value seems to be internal fluid dictionary value
- -- rawName is "extracells.[fluidname]", including literal spaces
- -- for eg, "extracells.liquid xp"
- --
- -- Qty is in mB
- function findMEAccess()
- return peripheral.wrap('right')
- end
- function findMonitor()
- return peripheral.wrap('left')
- end
- function xpToLv(xp)
- local lv = 1
- while xp > 0 do
- if lv < 16 then xp = xp - ((2*lv)+7)
- elseif lv < 30 then xp = xp - ((5*lv)-38)
- else xp = xp - ((9*lv)-158)
- end
- if xp > 0 then lv = lv + 1 end
- end
- return lv
- end
- function lvToXp(lv)
- local lookupTable = {[40] = 2920,[30] = 1395}
- return lookupTable[lv]
- end
- --function findPeripheralType():
- -- return peripheral.wrap('right')
- me = findMEAccess()
- mon = findMonitor()
- function countFluidByName(fluidName)
- local items = me.getAvailableItems()
- for k,v in pairs(items) do
- if v.id == 4403 and v.rawName == ("extracells."..fluidName) then
- return v.qty
- end
- end
- return 0
- end
- --print(countFluidByName('liquid xp'))
- mon.clear()
- mon.setTextScale(0.5)
- term.redirect(mon)
- xpAmount = countFluidByName('liquid xp')
- print((xpAmount/1000)..'B of XP')
- print(xpToLv(xpAmount/20)..' Lvs')
- print( math.floor((xpAmount/20) / lvToXp(40))..' bookdups' )
- print( math.floor((xpAmount/20) / lvToXp(30))..' enchants' )
- term.restore()
Advertisement
Add Comment
Please, Sign In to add comment