So I made myself a little lua script to read the inventory of my me storage system and also list the amount of bytes they require.
Its my first script so I'm sure there are better ways to do all of this.
The Me Network is connected to the Computer via an adapter on the me controller of the network.
Now what it does is it uses the getItemsInNetwork function to list all items in a loop and display the name and amount of Bytes of each item in one line.
A line counter goes up for each of the items added which is needed later.
After all Items are listed it displays the total amount of Bytes available as well as the amount of bytes used and then the percentage of used storage.
And finally at the very end a timer is displayed that counts down from 60.
Once this timer is over the script refreshes and goes through the list of items again so that the item counts are updated.
here is where I used the line counter so that the very last line could get cleared and replaced with the new timer that displays one second less on every loop until it hits zero and the script refreshes.
This script has worked for me for quite a while and on a second me system that only holds 3 different types of items it still does.
On my main me storage however this script is starting to break at the very end with the timer line no longer being overwritten and instead adding multiple lines alongside the new timer line like so:
And here is how it looks on the other me system:
Here the line "Time until refresh: n" is replaced the way its supposed to.
The only difference between the two scripts is that the one that works uses the getFluidsInNetwork function instead.
Is there a way for me to fix this or is it a problem of having too many items in storage ?
Additionally tips on how to improve this script in general are welcome as its my first and could probably be improved a lot.