diff --git a/core/ShopState.lua b/core/ShopState.lua index dc462e4..91b4dd3 100644 --- a/core/ShopState.lua +++ b/core/ShopState.lua @@ -111,6 +111,9 @@ if not turtle then error("Self output but not a turtle!") end + if not state.modem.getNameLocal() then + error("Modem is not connected! Try right clicking it") + end peripheral.call(productSource.inventory, "pushItems", state.modem.getNameLocal(), productSource.slot, productSource.amount, 1) if state.config.settings.dropDirection == "forward" then turtle.drop(productSource.amount) @@ -191,7 +194,7 @@ if sentName and transactionCurrency.name and transactionCurrency.name:find(".") then sentName = sentName .. "." .. nameSuffix end - if transaction.from ~= transactionCurrency.host and (not transactionCurrency.name or sentName and sentName:lower() == transactionCurrency.name:lower()) then + if transaction.from ~= transactionCurrency.host and (not transactionCurrency.name and not sentName) or (sentName and sentName:lower() == transactionCurrency.name:lower()) then local meta = parseMeta(transaction.metadata) if transaction.to == transactionCurrency.host and not transactionCurrency.name and not sentMetaname then sentMetaname = meta[1] diff --git a/core/inventory/ScanInventory.lua b/core/inventory/ScanInventory.lua index 1f04ed5..4b97224 100644 --- a/core/inventory/ScanInventory.lua +++ b/core/inventory/ScanInventory.lua @@ -146,8 +146,10 @@ local item = items[i] local inventory = item.inventory local slot = item.slot - if cached or item.name == product.modid then - item = peripheral.call(inventory, "getItemDetail", slot) + if item.name == product.modid then + if cached or product.predicates then + item = peripheral.call(inventory, "getItemDetail", slot) + end if item then if item.name ~= product.modid or (product.predicates and not partialObjectMatches(product.predicates, item)) then item = nil diff --git a/radon.lua b/radon.lua index c522e58..85490d9 100644 --- a/radon.lua +++ b/radon.lua @@ -1,7 +1,7 @@ local oldPullEvent = os.pullEvent os.pullEvent = os.pullEventRaw -local version = "1.1.6" +local version = "1.1.7" --- Imports local _ = require("util.score") @@ -46,6 +46,9 @@ if not modem then error("No modem found") end + if not modem.getNameLocal() then + error("Modem is not connected! Turn it on by right clicking it!") + end end local shopSyncModem