Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local nameOfDraconicEnergyStorage = peripheral.find( "draconic_rf_storage" )
- local currentEnergyStoredRaw = nameOfDraconicEnergyStorage.getEnergyStored()
- local currentEnergyStored = textutils.serialise( currentEnergyStoredRaw )
- term.setCursorPos(1,1)
- term.clearLine()
- if currentEnergyStored then
- if string.len( currentEnergyStored ) == 1 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,1)
- print( "After: "..first)
- end
- if string.len( currentEnergyStored ) == 2 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,2)
- print( "After: "..first)
- end
- if string.len( currentEnergyStored ) == 3 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,3)
- print( "After: "..first)
- end
- end
- if currentEnergyStored then
- if string.len( currentEnergyStored ) == 4 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,1)
- local other = string.sub(currentEnergyStoredRaw,2,4)
- print( "After: "..first..","..other)
- end
- if string.len( currentEnergyStored ) == 5 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,2)
- local other = string.sub(currentEnergyStoredRaw,3,5)
- print( "After: "..first..","..other)
- end
- if string.len( currentEnergyStored ) == 6 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,3)
- local other = string.sub(currentEnergyStoredRaw,4,6)
- print( "After: "..first..","..other)
- end
- end
- if currentEnergyStored then
- if string.len( currentEnergyStored ) == 7 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,1)
- local other1 = string.sub(currentEnergyStoredRaw,2,4)
- local other2 = string.sub(currentEnergyStoredRaw,5,7)
- print( "After: "..first..","..other1..","..other2)
- end
- if string.len( currentEnergyStored ) == 8 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,2)
- local other1 = string.sub(currentEnergyStoredRaw,3,5)
- local other2 = string.sub(currentEnergyStoredRaw,6,8)
- print( "After: "..first..","..other1..","..other2)
- end
- if string.len( currentEnergyStored ) == 9 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,3)
- local other1 = string.sub(currentEnergyStoredRaw,4,6)
- local other2 = string.sub(currentEnergyStoredRaw,7,9)
- print( "After: "..first..","..other1..","..other2)
- end
- end
- if currentEnergyStored then
- if string.len( currentEnergyStored ) == 10 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,1)
- local other1 = string.sub(currentEnergyStoredRaw,2,4)
- local other2 = string.sub(currentEnergyStoredRaw,5,7)
- local other3 = string.sub(currentEnergyStoredRaw,8,10)
- print( "After: "..first..","..other1..","..other2..","..other3)
- end
- if string.len( currentEnergyStored ) == 11 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,2)
- local other1 = string.sub(currentEnergyStoredRaw,3,5)
- local other2 = string.sub(currentEnergyStoredRaw,6,8)
- local other3 = string.sub(currentEnergyStoredRaw,9,11)
- print( "After: "..first..","..other1..","..other2..","..other3)
- end
- if string.len( currentEnergyStored ) == 12 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,3)
- local other1 = string.sub(currentEnergyStoredRaw,4,6)
- local other2 = string.sub(currentEnergyStoredRaw,7,9)
- local other3 = string.sub(currentEnergyStoredRaw,10,12)
- print( "After: "..first..","..other1..","..other2..","..other3)
- end
- end
- if currentEnergyStored then
- if string.len( currentEnergyStored ) == 13 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,1)
- local other1 = string.sub(currentEnergyStoredRaw,2,4)
- local other2 = string.sub(currentEnergyStoredRaw,5,7)
- local other3 = string.sub(currentEnergyStoredRaw,8,10)
- local other4 = string.sub(currentEnergyStoredRaw,11,13)
- print( "After: "..first..","..other1..","..other2..","..other3..","..other4)
- end
- if string.len( currentEnergyStored ) == 14 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,2)
- local other1 = string.sub(currentEnergyStoredRaw,3,5)
- local other2 = string.sub(currentEnergyStoredRaw,6,8)
- local other3 = string.sub(currentEnergyStoredRaw,9,11)
- local other4 = string.sub(currentEnergyStoredRaw,12,14)
- print( "After: "..first..","..other1..","..other2..","..other3..","..other4)
- end
- if string.len( currentEnergyStored ) == 15 then
- --print( "Befor: "..currentEnergyStored )
- local first = string.sub(currentEnergyStoredRaw,1,3)
- local other1 = string.sub(currentEnergyStoredRaw,4,6)
- local other2 = string.sub(currentEnergyStoredRaw,7,9)
- local other3 = string.sub(currentEnergyStoredRaw,10,12)
- local other4 = string.sub(currentEnergyStoredRaw,13,15)
- print( "After: "..first..","..other1..","..other2..","..other3..","..other4)
- end
- end
- sleep(0)
- shell.run("test.sys")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement