Replies: 3 comments 4 replies
-
this is far out of scope for VRCX, most of VRCX logic is within Javascript, only small parts of VRCX is Csharp you would have to find a compatible library. desktop notifcations are handled here and can be triggered manually from the JS console with example being
|
Beta Was this translation helpful? Give feedback.
-
Below is a full private bool ParseLogNotification(FileInfo fileInfo, LogContext logContext, string line, int offset)
{
// 1) Check if it's a "[API] Received Notification: <" line
if (string.Compare(line, offset, "[API] Received Notification: <", 0, 30, StringComparison.Ordinal) != 0)
return false;
// 2) Find the "received at " portion so we can isolate the notification's text
var pos = line.LastIndexOf("> received at ", StringComparison.Ordinal);
if (pos < 0)
return false;
// 3) Extract the substring containing the notification data
var data = line.Substring(offset + 30, pos - (offset + 30));
// 4) Check if the notification data includes "type: invite" or "type: requestInvite"
if (data.Contains(" type: invite") || data.Contains(" type: requestInvite"))
{
// Optional: write a line in VRCX.log to confirm we recognized it
logger.Info("Detected an invite line. Data={0}", data);
try
{
// 4A) Append a line to your custom text file, e.g. "C:\a\inviteLog.txt"
Directory.CreateDirectory(@"C:\a"); // ensure folder exists
File.AppendAllText(@"C:\a\inviteLog.txt", $"{DateTime.Now}: {data}\r\n");
}
catch (Exception ex)
{
// If there's any file/permission error, log it
logger.Warn(ex, "Failed to append invite log to C:\\a\\inviteLog.txt");
}
}
// 5) Append to the *internal* VRCX log list (so normal code sees it)
AppendLog(new[]
{
fileInfo.Name,
ConvertLogTimeToISO8601(line),
"notification",
data
});
return true;
} What This Does
Once you build and run VRCX with this code in
I can give you everything I tried so far. I've been using Gpt o1 to get me this far. |
Beta Was this translation helpful? Give feedback.
-
this would be 1000x easier and more reasonable going through the OpenRGB API, which supports all kinds of peripherals and can be implemented significantly easier than what you are trying to do. |
Beta Was this translation helpful? Give feedback.
-
I'm trying like hell to figure out a way to got my Logitech 915 keyboard to light up a certain way when I receive notification. I was thinking all I need for vrcx or the vrchat API to do is print out a log for invites where my C++ script interacting with my keyboard can scan periodically.
There a way I can do this?
Beta Was this translation helpful? Give feedback.
All reactions