コアダンプの数だけ強くなれるよ

見習いエンジニアの備忘log

Teratermマクロでカウンタ表示

Teratermマクロで実行回数を表示する。


カウンタ表示マクロ(counter.ttl)

; グローバル変数
Count = 0
true = 1
false = 0

; 以下、dateコマンドを無限に繰り返す
while true
  call show_counter
  sendln "date"
  wait ']$'
  pause 1
endwhile

; カウンタの表示
:show_counter
sprintf2 str "%d 回目" Count
statusbox str "カウンタ"
Count = Count + 1
return


実行結果
f:id:segmentation-fault:20170218200125p:plain




画面ログに残すだけなら下記。

1秒毎にカウントアップ

count = 1 
true = 1

while true
  int2str counts count
  sendln '##### ' counts ' times ' 
  pause 1
  count = count + 1 
endwhile


実行結果

$ ##### 1 times
$ ##### 2 times
$ ##### 3 times
$ ##### 4 times
$ ##### 5 times