Skip to content

peroxdev/gamer-ui

Repository files navigation

Gamer UI

Gamer UI Screenshot
forthebadge forthebadge forthebadge

I made this project so that others could learn how to make a Synapse X custom UI using WinForms. I've seen a lot of people who are clueless on how to do it, so this should serve as a good example. I myself am not very experienced in C#, so the code might not be the best.

Features

  • Monaco Editor with custom Synapse global highlighting and intellisense
  • Automatically add custom globals on inject
  • Script Hub
  • Synapse X WebSocket API Interoperability
  • Local HTTP server for relaying information across Gamer UI and Roblox
  • Themes

Dependencies

WebSocket API Re-Implementation

Gamer UI has a WebSocket API that aims to be interoperable with the native Synapse X API. The following services are to be implemented:

  • Execute
  • Editor
  • Script Hub
  • Attach
  • Custom

Script Hub Service

Gamer UI not only emulates the Synapse X WebSocket API, it expands upon it. With the Script Hub service, you can execute scripts from the Synapse X script hub. Below are response codes and examples in Node.js and C#.

Response Codes

  • OK - The script was successfully executed.
  • NOT_READY - SxLib is either not loaded or not attached.
  • INVALID_ENTRY - The entry provided was not found in the script hub.

Examples:

  • Node
const WebSocket = require("ws");
const ws = new WebSocket("ws://localhost:24892/scripthub");

ws.on("open", function open() 
{
  ws.send("Dark Dex");
});

ws.on("message", function incoming(data)
{
  console.log(data); //Response Code
});
  • C#
using System;
using WebSocketSharp;

namespace TestWebSocket
{
    public class Program
    {
        public static void Main(string[] args)
        {
            using (var ws = new WebSocket("ws://localhost:24892/scripthub"))
            {
                ws.OnMessage += (sender, e) =>
                    Console.WriteLine(e.Data); //Response Code"

                ws.Connect();
                ws.Send("Dark Dex");

                Console.ReadKey(true);
            }
        }
    }
}