kingToolbox / WindTerm

A professional cross-platform SSH/Sftp/Shell/Telnet/Serial terminal.
https://kingtoolbox.github.io
22.78k stars 1.76k forks source link

How to use the "trigger->script" function? #2475

Open ybyllc opened 1 month ago

ybyllc commented 1 month ago

How to use the "trigger->script" function? Is is used "Javascript" language? I want to implement "telnet auto login“ function,like MobaXterm's macros: image image

if I use "send text" function,I can't get 'delay 10ms' function to able to login to the server. I would be grateful to receive your answer.

ybyllc commented 1 month ago

I can't learn more from author's guide https://kingtoolbox.github.io/2023/06/06/trigger/ It's too simple to me image

lbhzy commented 1 month ago

似乎使用的是QJSEngine,需要编写javascript函数,captures.match就是匹配到的字符串,函数return返回值作为文本发送

lbhzy commented 1 month ago

目前有个需求在通过这里的javascript获取post请求数据发送出去,但不支持XMLHttpRequest,不知道还能否实现 image

kasini3000 commented 1 month ago

我写的批量运维脚本框架中,有个脚本,或许合适,欢迎了解下: https://gitee.com/chuanjiao10/kasini3000/blob/master/master_script/ptelnet_v1.01.ps1