Open icewolfz opened 1 week ago
Another version:
//Pattern: ^--More--.*$
//Style: script
//Trigger type: regular expression
//Trigger on prompt enabled
//Trigger on newline disabled
//Value:
//use a once fire event on next time any text is sent from the client meaning any valid command was sent to the mud, with data argument for more advanced testing if desired
//store event so it can be manually removed for cleanup
window.moreprompt_event = data => {
clearTimeout(window.moreprompt || 0);
window.moreprompt = 0;
window.moreprompt_event = 0;
}
client.once('parse-command',window.moreprompt_event);
if(!window.moreprompt) // check if already triggerd
window.moreprompt = setTimeout(()=>{
client.sendCommand('\n');
window.moreprompt = 0; //clear here just in case the 2nd trigger fails to fire
client.removeListener('parse-command', window.moreprompt_event); //clear event to prevent clearing early
window.moreprompt_event = 0;
}, 6000);
//store the timeout id to let it be cleared in case manually did a prompt command
An option to allow users send a return to auto page the more prompt after a period of time
2 settings, enabled/disabled and the amount of time to wait
can be done in jimud at the time using 2 triggers and script type or 1 trigger with 2 trigger states
1st
2nd trigger