milo cleanup + shop

This commit is contained in:
kepler155c@gmail.com
2019-01-11 10:01:37 -05:00
parent 42e72cf3c8
commit bfa528756e
23 changed files with 1141 additions and 101 deletions

View File

@@ -8,7 +8,7 @@ local Util = require('util')
local colors = _G.colors
local os = _G.os
local config = Config.load('store')
local config = Config.load('shop')
--[[ Display ]]--
local function createPage(node)
@@ -123,18 +123,14 @@ local pages = { }
-- called when an item to sell has been changed
Event.on('store_refresh', function()
config = Config.load('store')
config = Config.load('shop')
end)
Event.on('store_provide', function(_, item, quantity)
local count = 0
for k, v in pairs(config) do
if v.name == item then
count = Milo:eject(itemDB:splitKey(k), quantity)
break
end
end
os.queueEvent('store_provided', item, count)
Event.on('store_provide', function(_, item, quantity, uid)
Milo:queueRequest({ }, function()
local count = Milo:eject(item, quantity)
os.queueEvent('store_provided', uid, count)
end)
end)
--[[ Task ]]--