diff --git a/core/ShopState.lua b/core/ShopState.lua index d4a1649..58902ca 100644 --- a/core/ShopState.lua +++ b/core/ShopState.lua @@ -382,6 +382,15 @@ end end, function() while self.running do + -- Run event hook for the parallel constant running task + -- This can do things like listen to events or host applications + if self.eventHooks and self.eventHooks.parallel then + eventHook.execute(self.eventHooks.parallel) + end + sleep(blinkFrequency) + end + end, function() + while self.running do sleep(shopSyncFrequency) if self.config.shopSync and self.config.shopSync.enabled and self.peripherals.shopSyncModem then local items = {} diff --git a/eventHooks.lua b/eventHooks.lua index 15a8b24..1a18b9e 100644 --- a/eventHooks.lua +++ b/eventHooks.lua @@ -13,4 +13,5 @@ productsSaved = nil, -- function(products) called when products object is edited (replaced) onInventoryRefresh = nil, -- function(products, items) called when inventory is refreshed, product quantity can be set through products table onProductSelected = nil, -- function(product, currency) called when product is clicked on the shop screen + parallel = nil, -- function() called in parallel constantly. Allowed to be blocking for usage in creating parallel apps. } \ No newline at end of file diff --git a/radon.lua b/radon.lua index 6035801..d772715 100644 --- a/radon.lua +++ b/radon.lua @@ -1,4 +1,4 @@ -local version = "1.3.18" +local version = "1.3.19" local configHelpers = require "util.configHelpers" local schemas = require "core.schemas" local oldPullEvent = os.pullEvent