milo tweaks
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
local Config = require('config')
|
local Config = require('config')
|
||||||
local Craft = require('craft2')
|
local Craft = require('craft2')
|
||||||
local itemDB = require('itemDB')
|
local itemDB = require('itemDB')
|
||||||
|
local Sound = require('sound')
|
||||||
local Util = require('util')
|
local Util = require('util')
|
||||||
|
|
||||||
local os = _G.os
|
local os = _G.os
|
||||||
@@ -228,6 +229,7 @@ end
|
|||||||
|
|
||||||
function Milo:eject(item, count)
|
function Milo:eject(item, count)
|
||||||
count = self.context.storage:export(self.context.turtleInventory, nil, count, item)
|
count = self.context.storage:export(self.context.turtleInventory, nil, count, item)
|
||||||
|
Sound.play('ui.button.click')
|
||||||
turtle.emptyInventory()
|
turtle.emptyInventory()
|
||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -157,5 +157,10 @@ Event.on('turtle_inventory', function()
|
|||||||
print('idle')
|
print('idle')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Event.onInterval(5, function()
|
||||||
|
-- for some reason, it keeps stalling ...
|
||||||
|
os.queueEvent('turtle_inventory')
|
||||||
|
end)
|
||||||
|
|
||||||
os.queueEvent('turtle_inventory')
|
os.queueEvent('turtle_inventory')
|
||||||
Event.pullEvents()
|
Event.pullEvents()
|
||||||
|
|||||||
@@ -178,7 +178,6 @@ function page:eject(amount)
|
|||||||
item.count = request.current - request.count
|
item.count = request.current - request.count
|
||||||
if request.count + request.craft > 0 then
|
if request.count + request.craft > 0 then
|
||||||
self.grid:draw()
|
self.grid:draw()
|
||||||
Sound.play('ui.button.click')
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user