Zetamatta Expect Versions Save

Expect-lua for Windows

v0.11.0

3 months ago
  • (#35) Add the new function: sendvkey(VIRTUAL_KEYCODE). (Thanks to @chrisdonlan)
  • Fix the Go language version used for building to 1.20.14 for Windows 7,8,Server2008, and 2012R1/R2

Example for sendvkey

local pid = spawn("cmd.exe")
if not pid then
    os.exit(1)
end
send("rem exit")
sleep(1)
sendvkey(0x24) -- HOME
sendvkey(0x2E) -- DELETE
sendvkey(0x2E) -- DELETE
sendvkey(0x2E) -- DELETE
sendvkey(0x2E) -- DELETE
sendln("")
wait(pid)

v0.10.0

1 year ago
  • Add OLE functions.
    • local OBJ=create_object() creates OLE-Object
    • OBJ:method(...) calls method
    • OBJ:_get("PROPERTY") returns the value of the property.
    • OBJ:_set("PROPERTY",value) sets the value to the property.
    • OBJ:_iter() returns an enumerator of the collection.
    • OBJ:_release() releases the COM-instance.
    • local N=to_ole_integer(10) creates the integer value for OLE.

v0.9.0

1 year ago
  • Add the new global variable: capturelines (default:2)
    • It can specify the number of the captured lines when expect() is executed.
  • Add the new function: sleep(SECOND) , usleep(MICROSECOND)

  • 新グローバル変数: capturelines を追加(デフォルトは2)
    • expect() が実行されたときにキャプチャーする行数を指定します。
  • 新関数 sleep(秒)usleep(マイクロ秒) を追加

v0.8.0

1 year ago
  • Add the new function shot(N)

shot(N) is the function to capture the N lines of the screen.

local screen = assert(shot(25))
for i = 1,#screen do
    print( i,screen[i] )
end

  • 新関数shot(N) を追加しました。

shot(N) は画面の N 行をキャプチャーする関数です。

v0.7.1

1 year ago
  • (#31) Fix: expect() crashed on timeout ( Thanks to @horacehylee )

  • (#31) expect がタイムアウトした時にクラッシュする不具合を修正.

v0.7.0

1 year ago
  • Use the default-background-color ESC[49m instead of black ESC[40m
  • Failed to call console-api, show API-name as error
  • Add -nologo option
  • expect(): when the console of STDOUT can not be read, try STDERR.
  • (#30) expect(): Set matching information into the global variables: _MATCHPOSITION , _MATCHLINE , _MATCH , _PREMATCH, and _POSTMATCH. (Thanks to @rdrdrdrd95 )

  • 黒の ESC[40m のかわりに、デフォルトの背景色 ESC[49m を使うようにした
  • コンソールのAPIの呼び出しに失敗した時、APIの名前をエラーに出すようにした。
  • -nologo オプションを追加
  • expect関数は STDOUT のコンソールが使えなかった時に、STDERR の方を試すようにした。
  • (#30) expect 関数は、マッチした情報をグローバル変数の _MATCHPOSITION , _MATCHLINE , _MATCH , _PREMATCH, _POSTMATCH.にセットするようにした。

v0.6.2

2 years ago
  • Fix: filehandle for script was not closed when script did not end with CRLF
  • Show the version string

  • スクリプトが CRLF で終わっていなかった時、スクリプトのハンドルがクローズされていなかった点を修正
  • バージョン文字列を表示するようにした

v0.6.1

2 years ago
  • For #23, fix that when a script did not end with CRLF, the last line was ignored. ( Thanks to @wolf-li )
  • Include the source code of go-console in the package.
  • readme.md and go.mod: change the URLs (Change username: zetamatta to hymkor)
  • Fix warning for golint that the function does not have the header comments.

  • (#23) スクリプトが CRLF で終わっていない時、最終行が無視されていたのを修正
  • go-console のソースコードも本パッケージに含めるようにした。
  • readme.md と go.mod で URL を変更した(ユーザ名 zetamatta を hymkor へ変更)
  • golint の警告に対応(関数がヘッダコメントがない)

v0.6.0

2 years ago
  • Add the new function wait(PID) that waits the process of PID terminates.
    PIDのプロセスが終了するのを待つ関数 wait を追加

Sample :

local pid = assert(spawn("notepad"))
echo("wait ".. pid)
assert(wait(pid))
echo("done ".. pid)

v0.5.0

3 years ago
  • Implement Lua function: spawnctx()
    • The new function spawnctx is the similar one with spawn, but the process started by spawnctx is killed when Ctrl-C is pressed.

  • Lua関数 spawnctx を実装
    • 新関数の spawnctxspawn と似ているが、起動されたプロセスは Ctrl-C が押された時に自動的に kill される