This is a question about how TeraTerm works with macros.
I'd like to create a system where the show commands are repeated every few seconds on While, and when Enter is pressed, it will fall out, but can I use If and Wait to do something about it?
In the image, when waiting for one #
on Wait, #
is displayed twice by pressing Enter, so if two #
are followed in the If statement, would it be difficult to break?
;Repeat the command
cnt = 1
while cnt
sendln 'show log | grep up'
wait'#'
sendln 'show log | grep down'
wait'#'
yesnobox 'One more time? 'Message'
if result = 0 then
cnt = cnt-1
endif
endwhile
mpause 5000
Currently, I don't know how to do it, and as mentioned above, I use yesnobox
.
The equipment uses YAMAHA's FWX-120
If there is any way, please take care of me.
teraterm
Wait a few seconds mpause
to replace mtimeout
and Can I wait while waiting for interrupt input by combining cvln ?
The code below is looped indefinitely on linux, repeating arbitrary processing (ping and sleep in this case) and waiting for 3 seconds.
check_input
Wait up to 3 seconds each time a label is called, and if only blank characters (spaces or newline characters) are entered during that time, the regular expression is hit and the macro ends with exit
.
while1
sendln'ping 127.0.0.1-c2-i 0.5'; arbitrary action
wait'#'$';wait for processing to complete
call check_input
sendln ssleep1 ;;any action 2
wait'#'$';wait for processing to complete
call check_input
endwhile
; Check input while sleeping
—check_input
timeout = 3; set the timeout to 3 seconds
recvln;Input check while sleeping until timeout
if result = 1 then; something entered
strmatch inputstr'.+[$#]\s*$'; only blank characters (space or newline characters) after $ or #
if result=1 then; matches the above regular expression
exit; macro termination
endif
endif
timeout = 0; returns the timeout to infinity (initial value)
return;return to caller
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
578 Understanding How to Configure Google API Key
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.