This commit is contained in:
Baipyrus 2023-10-29 13:51:44 +01:00
parent 42f97d98fb
commit 11a78fd263

View File

@ -4,9 +4,9 @@ local convert_joules = mekanismEnergyHelper[
string.format('joulesTo%s', 'FE')
]
function set_converter(unit)
function set_converter(options)
convert_joules = mekanismEnergyHelper[
string.format('joulesTo%s', unit)
string.format('joulesTo%s', options.unit)
]
end
@ -56,7 +56,7 @@ function scan_components(name)
local modem = peripheral.find('modem')
-- check if components were found
local found_component = not matrix
local found_component = not component
local found_modem = not modem
-- output corresponding error messages
if found_component or found_modem then
@ -134,7 +134,7 @@ function init_modem(options, system)
end
-- scan for components and retry on fail
function wait_for_components(system)
function wait_for_components(options, system, component)
system.timeout = false
local count = 1
-- fixed print out
@ -149,7 +149,7 @@ function wait_for_components(system)
count = count + 1
-- scan for components
local components = scan_components('inductionPort')
local components = scan_components(component)
if components.success then
-- output success message
print('Success!')
@ -164,6 +164,7 @@ function wait_for_components(system)
-- components not found, wait to retry
print('Failed!')
os.sleep(options.timeout)
end
end