Created
April 9, 2019 12:40
-
-
Save eggist77/679a80f2cf52e3d0fd78197ab34ce1e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;autocmd.ttl | |
macroname = 'autocmd' | |
cmdlist = 'cmdlist.txt' | |
prompt1 = '$' | |
prompt2 = '#' | |
timeout = 15 | |
;コマンドリストチェック | |
filesearch cmdlist | |
if result=0 then | |
yesnobox 'コマンドリストが見つかりません。作成しますか?' macroname | |
if result=1 then | |
filecreate fhandle cmdlist | |
filewriteln fhandle ';;でコメントアウトできます' | |
filewriteln fhandle ';実行できるコマンドはshowコマンドとpingコマンドです。' | |
fileclose fhandle | |
else | |
messagebox '処理を終了します。' macroname | |
goto end | |
endif | |
endif | |
;コマンドリスト編集 | |
strconcat cmd 'notepad ' | |
strconcat cmd cmdlist | |
exec cmd 'show' 1 | |
fileopen fhandle cmdlist 0 | |
:loop | |
filereadln fhandle line | |
if result=1 goto fclose | |
;コメントアウト判定 | |
strcopy line 1 1 tmp | |
strcompare tmp ';' | |
if result<>0 then | |
strcopy line 1 4 cmdname | |
strcompare cmdname 'show' | |
if result=0 then | |
sendln line | |
wait prompt1 prompt2 | |
endif | |
strcompare cmdname 'ping' | |
if result=0 then | |
sendln line | |
wait prompt1 prompt2 | |
endif | |
endif | |
goto loop | |
:fclose | |
fileclose fhandle | |
:end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment