Jump to content




AE2 Storage Space?


  • You cannot reply to this topic
4 replies to this topic

#1 DonMegel

  • New Members
  • 2 posts

Posted 27 July 2016 - 03:11 PM

So I would like to display the amount of space remaining in my 2 ME Drive racks on a monitor. I used code from http://www.computerc...age-cell-on-cc/ as a base but I have run into a snag. When I run ‘getAvailableItems’ it is looking into my storage drawers as well (I have a set of Storage Drawers to take some of the weight of off the AE2 cells). This throws off my AE2 math. Is there a better way to tell how much space I have left in my AE2 system? If not, how can I fix this?

I am running version rv3-beta-6 of AE2 and 1.75 of ComputerCraft. My server is running Jurassic World Revelations 1.7.10. I have a Storage Interface attached to an Advanced Computer that I am using to interact with the AE2 network. I am new to LUA so please be gentle.

Code:

tpm = peripheral.wrap("left")
mon1 = peripheral.wrap("top")
k64 = "65536"
list = tpm.getAvailableItems()
totalUsed = 0 --totalSize

for number, item in pairs(list) do
totalUsed = totalUsed + 512 + item.size / 8
totalSize2 = number
end

freeSpace = k64 – totalUsed

mon1.clear()

mon1.setCursorPos(1,1)
mon1.write(“Total Bytes: “)
mon1.setCursorPos(10,1)
mon1.write(k64)

mon1.setCursorPos(1,2)
mon1.write(“Used Bytes: “)
mon1.setCursorPos(10,2)
mon1.write(totalUsed)

mon1.setCursorPos(1,3)
mon1.write(“Space Remaining: “)
mon1.setCursorPos(10,3)
mon1.write(freeSpace)


#2 DonMegel

  • New Members
  • 2 posts

Posted 29 July 2016 - 02:17 AM

Was there some important bit of information I omitted?

#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 29 July 2016 - 04:40 PM

It appears that your post has the relevant information needed to answer your question. I don't have much familiarity with interfacing AE2 and ComputerCraft, so I can't offer anything useful to answer your question. What other methods are provided by the peripheral?

#4 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 01 August 2016 - 08:32 AM

Is their not a "getBytesAvailable" function? Maybe not exactly what you are trying to get but from that you could calculate if you can throw 1, 10 or 100 stacks in to the system.

#5 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 02 August 2016 - 10:51 AM

I tried and did not find a getBytesAvailable or something similar. You can try wrap a ME Drive as a peripheral and try to do something with the functions you get from it. Maybe I try it myself later.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users