Quote from: philmoz on 21 / December / 2014, 16:14:33Quote from: waterwingz on 21 / December / 2014, 14:55:07Quote from: philmoz on 21 / December / 2014, 14:06:04I'd also suggest saving and restoring the timeout value in the C code in case the script forgets or is cancelled by the user.I think you only need the restore part of that - just reset to whatever is in the conf.console_timeout value on script exit.But isn't this the value the new function is going to change to give the script control over the console?AFAIK, only needed while the script is running?edit : srsa_4c's complaint was the console timing out while a script was using it for output IIRC. You can tweak the value stored in the conf.console_timeout but that doesn't get reset when the script exits.
Quote from: waterwingz on 21 / December / 2014, 14:55:07Quote from: philmoz on 21 / December / 2014, 14:06:04I'd also suggest saving and restoring the timeout value in the C code in case the script forgets or is cancelled by the user.I think you only need the restore part of that - just reset to whatever is in the conf.console_timeout value on script exit.But isn't this the value the new function is going to change to give the script control over the console?
Quote from: philmoz on 21 / December / 2014, 14:06:04I'd also suggest saving and restoring the timeout value in the C code in case the script forgets or is cancelled by the user.I think you only need the restore part of that - just reset to whatever is in the conf.console_timeout value on script exit.
I'd also suggest saving and restoring the timeout value in the C code in case the script forgets or is cancelled by the user.
I was suggesting a new function (e.g. console_timeout(N)) to allow scripts to update conf.console_timout without needing to use a magic number or load cnf_osd.lua.To remove the need for scripts to save & restore the value (and to cater for the user cancelling the script) I was suggesting the core C code save and restore conf.console_timeout when running a script (same as it now does for the script autosave flag).
Quote from: philmoz on 21 / December / 2014, 16:37:58I was suggesting a new function (e.g. console_timeout(N)) to allow scripts to update conf.console_timout without needing to use a magic number or load cnf_osd.lua.To remove the need for scripts to save & restore the value (and to cater for the user cancelling the script) I was suggesting the core C code save and restore conf.console_timeout when running a script (same as it now does for the script autosave flag).If we're about to introduce a new function (or extend an existing one), I wonder if it would be better to add a new variable, instead of saving/changing/restoring the timeout value.
Quote from: srsa_4c on 21 / December / 2014, 17:20:21Quote from: philmoz on 21 / December / 2014, 16:37:58I was suggesting a new function (e.g. console_timeout(N)) to allow scripts to update conf.console_timout without needing to use a magic number or load cnf_osd.lua.To remove the need for scripts to save & restore the value (and to cater for the user cancelling the script) I was suggesting the core C code save and restore conf.console_timeout when running a script (same as it now does for the script autosave flag).If we're about to introduce a new function (or extend an existing one), I wonder if it would be better to add a new variable, instead of saving/changing/restoring the timeout value.That's what I was thinking too - sorry for the confusion. Add a flag to the console timeout logic that can be set by a script function ( disable_console_timeout(0/1) ). Regardless of how the script uses that function, clear the flag on script exit.
Would you also want the ability to turn the console off completely while the script was running?Not needed - the console_autoredraw function takes care of it.Edit: Why not just disable the console timeout if a script is running and leave the console displayed? No change required to any scripts that way. When the script exits the timeout kicks back in.
Revision 3840 should:- disable the console timeout and erase if a script is running- force console on if a script error is writtenPhil.
Started by intrinsic « 1 2 » General Discussion and Assistance
Started by wrybread Script Writing
Started by Duncan Feature Requests
Started by acid2000 DryOS Development
Started by waterwingz General Discussion and Assistance