Logic Machine Forum
plans that are visible only in usermode or touch - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: plans that are visible only in usermode or touch (/showthread.php?tid=561)



plans that are visible only in usermode or touch - akn - 16.01.2017

It is necessary to make visualization in which can be selected languages.

I created a script but I do not work.

--------------------

-- 1byte object, 0 = RUS, 1 = ENG, 2= LVL
language = event.getvalue()

-- names of plans that are visible only in rus mode
rus_plans_usermode = { 'Главная', 'Языки' }
-- names of plans that are visible only in eng mode
eng_plans_usermode = { 'main'}
-- names of plans that are visible only in lvl mode
lvl_plans_usermode = { 'Galvena'}


-- names of plans that are visible only in rus mode
rus_plans_touch = { 'Главная' }
-- names of plans that are visible only in eng mode
eng_plans_touch = { 'main'}
-- names of plans that are visible only in lvl mode
lvl_plans_touch = { 'Galvena'}


if language==0 then
  rus_plans_usermode, rus_param_touch, eng_plans_usermode, eng_param_touch, lvl_plans_usermode, lvl_param_touch  = '', '', 'H', 'H', 'H', 'H'
end

if language==1 then
  rus_plans_usermode, rus_param_touch, eng_plans_usermode, eng_param_touch, lvl_plans_usermode, lvl_param_touch  = 'H', 'H', '', '', 'H', 'H'
end

if language==2 then
  rus_plans_usermode, rus_param_touch, eng_plans_usermode, eng_param_touch, lvl_plans_usermode, lvl_param_touch  = 'H', 'H', 'H', 'H', '', ''
end


update = { usermode_param = rus_plans_usermode }
for _, name in ipairs(rus_plans_usermode) do
  db:update('visfloors', update, { name = name })
end

update = {touch_param = rus_param_touch }
for _, name in ipairs(rus_param_touch) do
  db:update('visfloors', update, { name = name })
end

update = { usermode_param = eng_plans_usermod}
for _, name in ipairs(eng_plans_usermod) do
  db:update('visfloors', update, { name = name })
end

update = { touch_param = eng_param_touch }
for _, name in ipairs(eng_param_touch) do
  db:update('visfloors', update, { name = name })
end

update = { usermode_param = lvl_plans_usermode}
for _, name in ipairs(lvl_plans_usermode) do
  db:update('visfloors', update, { name = name })
end

update = { touch_param = lvl_param_touch }
for _, name in ipairs(lvl_param_touch) do
  db:update('visfloors', update, { name = name })
end