Created
November 18, 2019 23:08
-
-
Save Salads/f38240cce31fc4bbb4007e00c85c61f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- HoneyDrone.lua | |
-- Get Component APIs via proxy, since we are in a drone BIOS. | |
local control_drone = component.proxy(component.list("drone")()) | |
local control_inv = component.proxy(component.list("inventory_controller")()) | |
local control_nav = component.proxy(component.list("navigation")()) | |
local Sides = component.proxy(component.list("sides")()) | |
function SearchInventoryBelow() | |
local inventorySize | |
local error | |
inventorySize, error = control_inv.getInventorySize(Sides.bottom) | |
if inventorySize == nil and error ~= nil then | |
control_drone.setStatusText(error) | |
else | |
control_drone.setStatusText(inventorySize .. " slots in inventory.") | |
end | |
end | |
-- Entry Point | |
function DroneMain() | |
while true do | |
SearchInventoryBelow() | |
end | |
end | |
-- Finally, after all our code has been defined, call our main self-defined entry point! | |
DroneMain() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment