Skip to content

Commit

Permalink
Merge pull request #1 from keplerHaloxx/dev
Browse files Browse the repository at this point in the history
server auto colours text + updated rayfield
  • Loading branch information
keplerHaloxx authored Dec 20, 2024
2 parents b068ece + 6ba031f commit 121c40f
Show file tree
Hide file tree
Showing 11 changed files with 277 additions and 201 deletions.
12 changes: 6 additions & 6 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
"license": "MIT",
"devDependencies": {
"@rbxts/compiler-types": "3.0.0-types.0",
"@rbxts/types": "^1.0.810",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.1",
"@rbxts/types": "^1.0.813",
"@typescript-eslint/eslint-plugin": "^8.18.1",
"@typescript-eslint/parser": "^8.18.1",
"cross-env": "^7.0.3",
"eslint": "^9.12.0",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-roblox-ts": "^0.0.36",
"mkdirp": "^3.0.1",
"prettier": "^3.3.3",
"prettier": "^3.4.2",
"roblox-ts": "^3.0.0",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"dependencies": {
"@rbxts/services": "^1.5.5",
Expand Down
136 changes: 95 additions & 41 deletions client/src/libs/Rayfield.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,48 @@ by Sirius
shlex | Designing + Programming
iRay | Programming
Max | Programming
]]

local InterfaceBuild = "K7GD"
local Release = "Build 1.54"
local InterfaceBuild = "1VEX"
local Release = "Build 1.55"
local RayfieldFolder = "Rayfield"
local ConfigurationFolder = RayfieldFolder .. "/Configurations"
local ConfigurationExtension = ".rfld"

local HttpService = game:GetService("HttpService")
local request = (syn and syn.request)
or (fluxus and fluxus.request)
or (http and http.request)
or http_request
or request

local function getExecutor()
local name, version
if identifyexecutor then
name, version = identifyexecutor()
end
return { Name = name or "", Version = version or "" }
end

if request then
pcall(request, {
Url = "https://analytics.sirius.menu/v1/report/0193dbf8-7da1-79de-b399-2c0f68b0a9ad",
Method = "POST",
Headers = {
["Content-Type"] = "application/json",
},
Body = HttpService:JSONEncode({
Executor = getExecutor(),
Script = {
Interface = InterfaceBuild,
Release = Release,
},
}),
})
end

local RayfieldLibrary = {
Flags = {},
Theme = {
Expand Down Expand Up @@ -399,7 +432,6 @@ local RayfieldLibrary = {
-- Services
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local HttpService = game:GetService("HttpService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local CoreGui = game:GetService("CoreGui")
Expand Down Expand Up @@ -501,12 +533,19 @@ local dragBar = Rayfield:FindFirstChild("Drag")
local dragInteract = dragBar and dragBar.Interact or nil
local dragBarCosmetic = dragBar and dragBar.Drag or nil

local dragOffset = 255
local dragOffsetMobile = 150

Rayfield.DisplayOrder = 100
LoadingFrame.Version.Text = Release

local Icons = useStudio and require(script.Parent.icons)
or loadstring(
game:HttpGet("https://raw.githubusercontent.com/SiriusSoftwareLtd/Rayfield/refs/heads/main/icons.lua")
)()

-- Variables

local request = (syn and syn.request) or (http and http.request) or http_request
local CFileName = nil
local CEnabled = false
local Minimised = false
Expand Down Expand Up @@ -570,17 +609,12 @@ local function ChangeTheme(Theme)
end

local function getIcon(name: string)
-- full credit to latte softworks :)
local iconData = not useStudio
and game:HttpGet("https://raw.githubusercontent.com/latte-soft/lucide-roblox/refs/heads/master/lib/Icons.luau")
local icons = useStudio and require(script.Parent.icons) or loadstring(iconData)()

name = string.match(string.lower(name), "^%s*(.*)%s*$") :: string
local sizedicons = icons["48px"]
local sizedicons = Icons["48px"]

local r = sizedicons[name]
if not r then
error('Lucide Icons: Failed to find icon by the name of "' .. name .. ".", 2)
error('Lucide Icons: Failed to find icon by the name of "' .. name .. '".', 2)
end

local rirs = r[2]
Expand Down Expand Up @@ -615,7 +649,7 @@ local function makeDraggable(object, dragObject, enableTaptic, tapticOffset)
local function connectFunctions()
if dragBar and enableTaptic then
dragBar.MouseEnter:Connect(function()
if not dragging then
if not dragging and not Hidden then
TweenService:Create(
dragBarCosmetic,
TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out),
Expand All @@ -625,7 +659,7 @@ local function makeDraggable(object, dragObject, enableTaptic, tapticOffset)
end)

dragBar.MouseLeave:Connect(function()
if not dragging then
if not dragging and not Hidden then
TweenService:Create(
dragBarCosmetic,
TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out),
Expand All @@ -650,7 +684,7 @@ local function makeDraggable(object, dragObject, enableTaptic, tapticOffset)
relative = object.AbsolutePosition
+ object.AbsoluteSize * object.AnchorPoint
- UserInputService:GetMouseLocation()
if enableTaptic then
if enableTaptic and not Hidden then
TweenService:Create(
dragBarCosmetic,
TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out),
Expand All @@ -671,7 +705,7 @@ local function makeDraggable(object, dragObject, enableTaptic, tapticOffset)

connectFunctions()

if enableTaptic then
if enableTaptic and not Hidden then
TweenService:Create(
dragBarCosmetic,
TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out),
Expand All @@ -682,7 +716,7 @@ local function makeDraggable(object, dragObject, enableTaptic, tapticOffset)
end)

local renderStepped = RunService.RenderStepped:Connect(function()
if dragging then
if dragging and not Hidden then
local position = UserInputService:GetMouseLocation() + relative + offset
if enableTaptic and tapticOffset then
TweenService:Create(
Expand Down Expand Up @@ -1150,6 +1184,8 @@ local function Hide(notify: boolean?)
end
end

dragInteract.Visible = false

for _, tab in ipairs(Elements:GetChildren()) do
if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
for _, element in ipairs(tab:GetChildren()) do
Expand Down Expand Up @@ -1382,6 +1418,11 @@ local function Unhide()
task.spawn(Maximise)
end

dragBar.Position = useMobileSizing and UDim2.new(0.5, 0, 0.5, dragOffsetMobile)
or UDim2.new(0.5, 0, 0.5, dragOffset)

dragInteract.Visible = true

for _, TopbarButton in ipairs(Topbar:GetChildren()) do
if TopbarButton.ClassName == "ImageButton" then
if TopbarButton.Name == "Icon" then
Expand Down Expand Up @@ -1713,10 +1754,11 @@ function RayfieldLibrary:CreateWindow(Settings)
end
end)

makeDraggable(Main, Topbar, false, { 255, 150 })
makeDraggable(Main, Topbar, false, { dragOffset, dragOffsetMobile })
if dragBar then
dragBar.Position = useMobileSizing and UDim2.new(0.5, 0, 0.5, 150) or UDim2.new(0.5, 0, 0.5, 255)
makeDraggable(Main, dragInteract, true, { 255, 150 })
dragBar.Position = useMobileSizing and UDim2.new(0.5, 0, 0.5, dragOffsetMobile)
or UDim2.new(0.5, 0, 0.5, dragOffset)
makeDraggable(Main, dragInteract, true, { dragOffset, dragOffsetMobile })
end

for _, TabButton in ipairs(TabList:GetChildren()) do
Expand All @@ -1729,27 +1771,32 @@ function RayfieldLibrary:CreateWindow(Settings)
end

if Settings.Discord and not useStudio then
if not isfolder(RayfieldFolder .. "/Discord Invites") then
if isfolder and not isfolder(RayfieldFolder .. "/Discord Invites") then
makefolder(RayfieldFolder .. "/Discord Invites")
end

if
not isfile(RayfieldFolder .. "/Discord Invites" .. "/" .. Settings.Discord.Invite .. ConfigurationExtension)
isfile
and not isfile(
RayfieldFolder .. "/Discord Invites" .. "/" .. Settings.Discord.Invite .. ConfigurationExtension
)
then
if request then
request({
Url = "http://127.0.0.1:6463/rpc?v=1",
Method = "POST",
Headers = {
["Content-Type"] = "application/json",
Origin = "https://discord.com",
},
Body = HttpService:JSONEncode({
cmd = "INVITE_BROWSER",
nonce = HttpService:GenerateGUID(false),
args = { code = Settings.Discord.Invite },
}),
})
pcall(function()
request({
Url = "http://127.0.0.1:6463/rpc?v=1",
Method = "POST",
Headers = {
["Content-Type"] = "application/json",
Origin = "https://discord.com",
},
Body = HttpService:JSONEncode({
cmd = "INVITE_BROWSER",
nonce = HttpService:GenerateGUID(false),
args = { code = Settings.Discord.Invite },
}),
})
end)
end

if Settings.Discord.RememberJoins then -- We do logic this way so if the developer changes this setting, the user still won't be prompted, only new users
Expand Down Expand Up @@ -1793,8 +1840,7 @@ function RayfieldLibrary:CreateWindow(Settings)
end

if
isfile
and isfile(
isfile and isfile(
RayfieldFolder .. "/Key System" .. "/" .. Settings.KeySettings.FileName .. ConfigurationExtension
)
then
Expand Down Expand Up @@ -2088,7 +2134,7 @@ function RayfieldLibrary:CreateWindow(Settings)
{ ImageTransparency = 1 }
):Play()
task.wait(0.45)
game.Players.LocalPlayer:Kick("No Attempts Remaining")
Players.LocalPlayer:Kick("No Attempts Remaining")
game:Shutdown()
end
KeyMain.Input.InputBox.Text = ""
Expand Down Expand Up @@ -2573,7 +2619,7 @@ function RayfieldLibrary:CreateWindow(Settings)
ColorPicker.HexInput.UIStroke.Color = SelectedTheme.InputStroke

local opened = false
local mouse = game.Players.LocalPlayer:GetMouse()
local mouse = Players.LocalPlayer:GetMouse()
Main.Image = "http://www.roblox.com/asset/?id=11415645739"
local mainDragging = false
local sliderDragging = false
Expand Down Expand Up @@ -4353,6 +4399,8 @@ function RayfieldLibrary:CreateWindow(Settings)
NewValue = math.floor(NewValue / SliderSettings.Increment + 0.5)
* (SliderSettings.Increment * 10000000)
/ 10000000
NewValue = math.clamp(NewValue, SliderSettings.Range[1], SliderSettings.Range[2])

if not SliderSettings.Suffix then
Slider.Main.Information.Text = tostring(NewValue)
else
Expand Down Expand Up @@ -4415,6 +4463,8 @@ function RayfieldLibrary:CreateWindow(Settings)
end)

function SliderSettings:Set(NewVal)
local NewVal = math.clamp(NewVal, SliderSettings.Range[1], SliderSettings.Range[2])

TweenService:Create(
Slider.Main.Progress,
TweenInfo.new(0.45, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out),
Expand All @@ -4432,9 +4482,11 @@ function RayfieldLibrary:CreateWindow(Settings)
}
):Play()
Slider.Main.Information.Text = tostring(NewVal) .. " " .. (SliderSettings.Suffix or "")

local Success, Response = pcall(function()
SliderSettings.Callback(NewVal)
end)

if not Success then
TweenService:Create(
Slider,
Expand All @@ -4458,6 +4510,7 @@ function RayfieldLibrary:CreateWindow(Settings)
:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), { Transparency = 0 })
:Play()
end

SliderSettings.CurrentValue = NewVal
SaveConfiguration()
end
Expand Down Expand Up @@ -4608,6 +4661,7 @@ function RayfieldLibrary:IsVisible(): boolean
end

function RayfieldLibrary:Destroy()
hideHotkeyConnection:Disconnect()
Rayfield:Destroy()
end

Expand Down Expand Up @@ -4686,7 +4740,7 @@ Topbar.Hide.MouseButton1Click:Connect(function()
setVisibility(Hidden, not useMobileSizing)
end)

UserInputService.InputBegan:Connect(function(input, processed)
hideHotkeyConnection = UserInputService.InputBegan:Connect(function(input, processed)
if input.KeyCode == Enum.KeyCode.K and not processed then
if Debounce then
return
Expand Down Expand Up @@ -4734,7 +4788,7 @@ function RayfieldLibrary:LoadConfiguration()

if useStudio then
config =
[[{"Toggle1adwawd":"false","Keybind1":"Q","InputExample":"","Slider1dawd":40,"ColorPicfsefker1":{"B":255,"G":255,"R":255},"Slidefefsr1":80,"dawdawd":"","ColorPicker1awd":{"B":255,"G":255,"R":255},"Dropdown1":["Ocean"]}]]
[[{"Toggle1adwawd":"false","Keybind1":"Q","InputExample":"","Slider1dawd":120,"ColorPicfsefker1":{"B":255,"G":255,"R":255},"Slidefefsr1":80,"dawdawd":"","ColorPicker1awd":{"B":255,"G":255,"R":255},"Dropdown1":["Ocean"]}]]
end

if CEnabled then
Expand Down Expand Up @@ -4811,7 +4865,7 @@ if useStudio then
},
})

local Tab = Window:CreateTab("Tab Example", "badge-minus") -- Title, Image
local Tab = Window:CreateTab("Tab Example", "key-round") -- Title, Image
local Tab2 = Window:CreateTab("Tab Example 2", 4483362458) -- Title, Image

local Section = Tab2:CreateSection("Section")
Expand Down
2 changes: 1 addition & 1 deletion client/src/main.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ findOrCreateFolder(CoreGui, "HighlightCache", "Folder") // create highlight cach

const window = Rayfield.CreateWindow({
Name: "Chess",
LoadingTitle: "Loading 🔃",
LoadingTitle: "Chess ♟️",
LoadingSubtitle: "By Haloxx",

DisableBuildWarnings: false,
Expand Down
10 changes: 5 additions & 5 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "roblox-chess-script"
version = "0.1.4"
version = "0.1.5"
edition = "2021"

[dependencies]
actix-web = "4"
serde = {version = "1.0.210", features = ["derive"]}
inline_colorization = "0.1.6"
serde = {version = "1.0.216", features = ["derive"]}
rfd = "0.15.0"
sysinfo = "0.31.4"
sysinfo = "0.33.0"
thousands = "0.2.0"
shakmaty = "0.27.2"
log = "0.4.22"
log = "0.4.22"
termcolor = "1.4.1"
Loading

0 comments on commit 121c40f

Please sign in to comment.