diff --git a/data/config.example.lua b/data/config.example.lua index ac9200b..fb3eff7 100644 --- a/data/config.example.lua +++ b/data/config.example.lua @@ -8,9 +8,6 @@ -- The Krist name you want to use for the shop. The need for this will be removed later on. Required. name = "", - -- The networkID of your turtle. To get this click the modem your turtle is connected to. - self = "", - -- The tagline for your shop! This is a string, and is optional. Your theme is able to get this field. tagline = "", @@ -85,7 +82,7 @@ -- Modem to send ShopSync data over. Tries to locate an ender or wireless modem if not specified. modem = "", - -- Username of the shop owner. + -- Username of the shop owner. owner = "", -- If multiple shops are ran off of this computer, this should be a unique integer starting at 1. diff --git a/src/backend.lua b/src/backend.lua index 2ccdae4..01f2fa2 100644 --- a/src/backend.lua +++ b/src/backend.lua @@ -9,6 +9,7 @@ local speakerLib = ctx.speakerLib local pulseID = -1 +local turtleID = peripheral.find("modem").getNameLocal() logger:info("Starting Kristify! Thanks for choosing Kristify. <3") logger:debug("Debugging mode is enabled!") @@ -190,12 +191,11 @@ logger:debug("Turn: " .. turn .. ". Turns needed: " .. turns) if turns == turn then logger:debug("Last turn.") - logger:debug("Arguments passed: " .. config.self, " | ", product.id, " | ", tostring(lastTurn)) - storage.pushItems(config.self, product.id, lastTurn, nil, product.nbt, { optimal = false }) + logger:debug("Arguments passed: " .. turtleID, " | ", product.id, " | ", tostring(lastTurn)) + storage.pushItems(turtleID, product.id, lastTurn, nil, product.nbt, { optimal = false }) else logger:debug("Not last turn") - storage.pushItems(config.self, product.id, stackSize * 16, nil, product.nbt, { optimal = false }) - + storage.pushItems(turtleID, product.id, stackSize * 16, nil, product.nbt, { optimal = false }) end for i = 1, 16 do turtle.select(i) @@ -220,7 +220,6 @@ transaction.id, transaction.to ) - elseif webhook.type == "googleChat" then webhooks.googleChat(webhook.URL, message) end diff --git a/src/init.lua b/src/init.lua index 5351a67..6a40e3a 100644 --- a/src/init.lua +++ b/src/init.lua @@ -147,10 +147,6 @@ local modem = peripheral.find("modem") if not modem then error("Kristify is not connected to a network! (aka. wired modem)") - elseif type(ctx.config.self) == "string" and modem.getNameLocal() ~= (ctx.config.self or "") then - error("Given turtle in config does not exist!") - else - configExpect("self", "string") end if configExpect("storage", "table") then