I am trying to implement the following logic using C#/Lua:
Inside my C# application, I have a form with a textbox that allows me to enter a signal value and pass it then to the Lua script via (state["timeToCollection"] = signalValue.Text;). The idea is that when this value is equal to "low", some other calls will happen.
The issue that I am facing currently is that this signalValue.Text needs to be filled out before executing the Lua script and not after executing it (desired behavior). Is there a way to do this dynamically, meaning, I execute the Lua script, Lua script checks for signalValue.Text value, if the value is not low, it just keeps running until the user enters low in the form.
Thanks
C#
state.DoFile(luaScriptFile); //execute lua script
state["timeToCollection"] = signalValue.Text; // pass signal value
Lua Script:
function DM()
while (timeToCollision == 'low')
do
UDC:eventImageDataReq('AutoHitch',01)
end
end
DM()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…