Skip to content

Instantly share code, notes, and snippets.

@Salads
Created November 18, 2019 23:08
Show Gist options
  • Save Salads/f38240cce31fc4bbb4007e00c85c61f3 to your computer and use it in GitHub Desktop.
Save Salads/f38240cce31fc4bbb4007e00c85c61f3 to your computer and use it in GitHub Desktop.
-- 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