Logic Machine Forum
event start part of the script - 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: event start part of the script (/showthread.php?tid=3971)



event start part of the script - Dré - 02.04.2022

I try to find out how i can trigger a part of a script.

i think i need to use event.dst.

I add tags on the groupsobject who trigger the script.

The script have multiple part what to do.

If the script is trigger by 1/1/1 i will just run the first part of a script.
if it is trigger by 1/1/2 i just run the second part of the script.

i think i need to use event.dst and elseif, but don't know how to use it.

Somebody who can help me with this?


RE: event start part of the script - Erwin van der Zwart - 02.04.2022

if event.dst == '1/1/1' then
-- do something
elseif event.dst == '1/1/2' then
-- do something
elseif event.dst == '1/1/3' then
-- do something
else
-- do something when nothing matches event.dst
end


RE: event start part of the script - Dré - 03.04.2022

Thank you Erwin,

is it also posible to use this if '1/1/1' = false?
and when 1/1/1 is between 0 and 50

Or can we only use it when it is true?


RE: event start part of the script - Erwin van der Zwart - 03.04.2022

Replace — do something with:

if event.getvalue() == false then
— do something 
end

or

value = event.getvalue()
if value >= 0 and value <= 50 then
— do something 
end


RE: event start part of the script - Dré - 08.05.2022

Thank you Erwin, i will try this.