diff --git a/getStorageEnergy.lua b/getStorageEnergy.lua index fb19a66..8c2a616 100644 --- a/getStorageEnergy.lua +++ b/getStorageEnergy.lua @@ -1,28 +1,3 @@ -print("Enter the direction of the peripheral (left, right, top, bottom, front, back):") -local direction = io.read() -if not direction or direction == "quit" or direction == "exit" then - print("No direction specified, exiting.") - return -end -local info = {} +local storageEnergy = peripheral.getMethods("left").getStoredEnergy() -info = peripheral.getMethods(direction) -if not info then - print("No peripheral found in that direction.") - return -end - --- list the methods from info - -local nbOfMethods = 0 -for methodName, methodInfo in pairs(info) do - nbOfMethods = nbOfMethods + 1 - if nbOfMethods > 10 then - print("Too many methods, please press a key to continue...") - event, p1 = os.pullEvent("key") - nbOfMethods = 0 - term.clear() - term.setCursorPos(1, 1) - end - print(methodName .. ' ' .. methodInfo) -end +print("Stored energy: " .. storageEnergy .. " RF")