Hi, first of all im not a very experienced programer at all, but i was thinking that maybe a GOTO method (like DOS Batch has) inside the scripting system would be very handy.
For example in the wiki, there are 3 script files + autoexec modification to do the Indicator Control (emergency lights not taken in account, making it 4 files)
With this new GOTO method it could be something like this:
-- autoexec.lfs --
/run indicators
-- indicators.lfs --
/button 1 ctrl_f10
/button 2 ctrl_f11
/button 3 ctrl_f12
/goto off
: left
/echo < < < <
/ctrlf 10 /press 0 /goto off
: right
/echo > > > >
/ctrlf 11 /press 0 /goto off
: emergency
/echo < < > >
/ctrlf 12 /press 0 /goto off
: off
/ctrlf 10 /press 7 /goto left
/ctrlf 11 /press 8 /goto right
/ctrlf 12 /press 9 /goto emergency
This would require only 1 script file + autoexec modification... what do you think?
EDITED: I forgot the buttons declarations, fixed
EDITED 2: Another example with the F9-F12 (from 5 scripts to 1)
-- autoexec.lfs --
/run f9-f12
-- f9-f12.lfs --
/button 1 crtl_f12
/goto off
: F9
/ctrlf 12 /press F10 /goto F10
: F10
/ctrlf 12 /press F11 /goto F11
: F11
/ctrlf 12 /press F12 /goto F12
: F12
/ctrlf 12 /press F12 /goto off
: off
/ctrlf 12 /press F9 /goto F9
For example in the wiki, there are 3 script files + autoexec modification to do the Indicator Control (emergency lights not taken in account, making it 4 files)
With this new GOTO method it could be something like this:
-- autoexec.lfs --
/run indicators
-- indicators.lfs --
/button 1 ctrl_f10
/button 2 ctrl_f11
/button 3 ctrl_f12
/goto off
: left
/echo < < < <
/ctrlf 10 /press 0 /goto off
: right
/echo > > > >
/ctrlf 11 /press 0 /goto off
: emergency
/echo < < > >
/ctrlf 12 /press 0 /goto off
: off
/ctrlf 10 /press 7 /goto left
/ctrlf 11 /press 8 /goto right
/ctrlf 12 /press 9 /goto emergency
This would require only 1 script file + autoexec modification... what do you think?
EDITED: I forgot the buttons declarations, fixed
EDITED 2: Another example with the F9-F12 (from 5 scripts to 1)
-- autoexec.lfs --
/run f9-f12
-- f9-f12.lfs --
/button 1 crtl_f12
/goto off
: F9
/ctrlf 12 /press F10 /goto F10
: F10
/ctrlf 12 /press F11 /goto F11
: F11
/ctrlf 12 /press F12 /goto F12
: F12
/ctrlf 12 /press F12 /goto off
: off
/ctrlf 12 /press F9 /goto F9