Skip to content
スニペット グループ プロジェクト
O

outvoke

プロジェクトID: 53441769

Outvoke

This is a library, and at the same time a framework, and at the same time an internal DSL.

If you need Japanese Edition of this README, see README.ja.md

CAUTION

The author, cleemy desu wayo, has only tested it on Linux.

Requirements

  • Ruby 3.0 or later

What's This?

Outvoke makes it easy to write code that hooks into the data stream.

Setup

Put outvoke.rb in the current directory and give it execute permission.

Start it using the -e option as follows, and if you see output every 5 seconds, it is running for now.

$ ./outvoke.rb -e 'hook "every-sec", /:.[05] /'
# starting Outvoke 0.1 ---- 2023-12-31 17:50:16 +0900
# ----
# given ruby code:
# hook "every-sec", /:.[05] /
# ----

[2023-12-31 17:50:17 +0900] [outvoke-system] vrchat-001: first time log check has done.
[2023-12-31 17:50:20 +0900] 2023-12-31 17:50:20 +0900
[2023-12-31 17:50:25 +0900] 2023-12-31 17:50:25 +0900
[2023-12-31 17:50:30 +0900] 2023-12-31 17:50:30 +0900
[2023-12-31 17:50:35 +0900] 2023-12-31 17:50:35 +0900
[2023-12-31 17:50:40 +0900] 2023-12-31 17:50:40 +0900

To exit, press Ctrl + C.

There may be error lines if VRChat is not installed or the log files are in a different location.

If you have VRChat installed and it has been a long time since VRChat was started, it may take a long time after Outvoke is started before you see the first time log check has been done. This time can be shortened by restarting VRChat.

Config File

If there is a file outvoke.conf.rb in the current directory, Outvoke will first include that file.

For example, if you have a line like the following in outvoke.conf.rb, you can specify the directory for VRChat log files to look for.

$outvoke.sources['vrchat-001'].log_dir = "#{Dir.home}/.steam/debian-installation/steamapps/compatdata/438100/pfx/drive_c/users/steamuser/AppData/LocalLow/VRChat/VRChat"

Basic Usage

When you run Outvoke with no arguments, it looks for main.rb in the current directory and includes it.

You can specify a file name or write a one-liner using the -e option, but for the sake of clarity, this README.md assumes that you are writing in main.rb.

If you write "using OutvokeDSL" at the beginning of main.rb, you will be in the mode of internal DSL. You can write it as casually as writing a configuration file.

Since main.rb is interpreted as a Ruby script, you can write complex programs.

The following is an example of main.rb.

using OutvokeDSL

hook 'every-sec', / 05:00:00 / do
  spawn 'play', '-q', '-t', 'wav', '-v', '0.6', 'ring.wav', 'repeat', '50'
end

At 5:00 AM, ring.wav in the current directory is played by the play command.

(The rest is currently being written)

With VRChat

Some explanations and samples may be found at the following:

(The rest is currently being written)