Skip to content
Snippets Groups Projects
O

outvoke

Project ID: 53441769
cleemy desu wayo's avatar
f9e844a6

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.

During the summer and fall of 2024, potentially disruptive changes will be made that will result in incompatibility. I will try to make the sample code I put under samples/ work as well as before.

The last version before these changes were made is version 0.0.99.20240619.

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", /[012][0-9]:[0-9][0-9]:[0-9][05]/'
# starting Outvoke 0.1 (version 0.0.99.20240815) ---- 2024-08-16 12:46:06 +0900
# ----
# given ruby code:
# hook "every-sec", /[012][0-9]:[0-9][0-9]:[0-9][05]/
# ----

[2024-08-16 12:46:06 +0900] [outvoke-system] vrchat-001: a new log file was found.
[2024-08-16 12:46:07 +0900] [outvoke-system] vrchat-001: first time log check has done.
[2024-08-16 12:46:10 +0900] 2024-08-16 12:46:10 +0900
[2024-08-16 12:46:15 +0900] 2024-08-16 12:46:15 +0900
[2024-08-16 12:46:20 +0900] 2024-08-16 12:46:20 +0900
[2024-08-16 12:46:25 +0900] 2024-08-16 12:46:25 +0900
[2024-08-16 12:46:30 +0900] 2024-08-16 12:46:30 +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:

Also see the samples below.

a video of samples/2024/vrchat_multiple_ds2.rb in action: https://x.com/metanagi/status/1802512101111689368

(The rest is currently being written)