Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
Icpmcp

Help required with me storage reading script

Question

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.

Pastebin here

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:

image.png.5211273f805dc90aea3065000ecd6ded.png

 

And here is how it looks on the other me system:

image.png.38a079393d583553cb69fa3bbdf011b4.png

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.

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.