Пытаюсь собрать отправку "Заявок"
Обработчик
<code>
-- Orders
function sendorders() if orders_table_handle == nil then news_table_handle = ml.find_table('Заявки') end -- "Заявки" window caption if orders_table_handle ~= nil then local i = 1 local id = nil repeat local row = ml.get_row(orders_table_handle, i) if row ~= nil then if id == nil then id = row[5] end if last_orders_id ~= row[5] then tsq["telegram_queue"] = {quik_id = current_quik_id, message = row[2] .. " " .. row[3] .. ": " .. row[4]} if (i >= 1) then row = nil end else row = nil end i = i + 1 end until row == nil if id ~= nil then last_orders_id = id end end end
</code>
запуск функции
<code>
-- orders if (os.time() - last_os_time >= 5) then else if orders_poll_enabled then sendorders() end end
</code>
Подписка на завки
<code>
if data ~= nil then local command = data.message:lower() if command == 'orders start' then orders_poll_enabled = true tsq["telegram_queue"] = {quik_id = current_quik_id, user_id = data.user_id, message = "orders polling started"} end end until data == nil sleep(100) end
</code>
Почему не работает?