Last active
June 6, 2024 09:03
-
-
Save tnhung2011/5249855ea28e84030f095c61b007fd13 to your computer and use it in GitHub Desktop.
A handy program for customizing your Roblox cursor (ANSI-encoded)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- : | |
@echo off | |
setlocal | |
set __p=%systemroot%\System32\WindowsPowershell\v1.0\powershell.exe | |
2>nul >nul %__p% /? | |
if not errorlevel 0 goto :eof | |
set stop=:eof | |
set internal=%~n0 | |
set program=RoCursor | |
set version=0.1 | |
set p=%1 | |
for /f %%A in ('"prompt $H &echo on &for %%B in (1) do rem"') do set bs=%%A | |
if [%p%] equ [] ( goto :main | |
) else if [%p%] equ [help] ( goto :help | |
) else if [%p%] equ [/?] ( goto :help | |
) else if [%p%] equ [version] ( goto :version | |
) else if [%p%] equ [dest] ( goto :finstpath | |
) else if [%p%] equ [install] ( call :finstall %2 & goto :eof | |
) | |
set ts= | |
call :error Option %p% is unknown | |
goto :eof | |
:: --------------------------------- | |
:: -- CMDLINE | |
:: --------------------------------- | |
:finstpath | |
call :instpath | |
echo %instpath%\Cursors\KeyboardMouse | |
goto :eof | |
:finstall | |
set p=%1 | |
rem set stop=:eof | |
if [%p% equ [old ( goto :install | |
) else if [%p% equ [new ( goto :install | |
) else if [%p% equ [custom ( goto :install | |
) | |
goto :eof | |
:help | |
echo. | |
echo %~n0 [params...] | |
echo A handy program for customizing your Roblox cursor | |
echo. | |
echo (none) Start the main TUI | |
echo. /?, help Get help for commands | |
rem echo -s, --sched Schedules a specific operation to run at startup | |
echo install Install cursor of type ^<old ^| new ^| custom^> | |
echo dest Show what folder do `install` copy to | |
echo version Show version number and quit | |
goto :eof | |
:install | |
set op=%p% | |
goto :cmdline | |
:version | |
echo %program% v%version% | |
goto :eof | |
:: --------------------------------- | |
:: -- BACKBONE | |
:: --------------------------------- | |
REM // start copya funcs // | |
:copy | |
copy %1 %2 >nul | |
if errorlevel 0 set /a inc+=1 >nul | |
goto :eof | |
:copya | |
echo %ts%[.] Copying files: | |
for %%A IN (.) DO set d=%%~sA | |
echo %ts%(CD'd %d%) | |
set d= | |
set inc=0 | |
set t=. | |
echo %ts% %t%\ArrowCursor.png ~^> Cursors\KeyboardMouse | |
call :copy %t%\ArrowCursor.png Cursors\KeyboardMouse | |
echo %ts% %t%\ArrowFarCursor.png ~^> Cursors\KeyboardMouse | |
call :copy %t%\ArrowFarCursor.png Cursors\KeyboardMouse | |
if [%inc% EQU [2 ( | |
set t=+ | |
) else ( if [%inc% EQU [1 ( set t=~ | |
) else ( set t=- ) | |
) | |
echo. | |
echo %ts%[%t%] Successfully copied %inc% files | |
set inc= | |
goto :eof | |
REM // end copya funcs // | |
:old | |
pushd %instpath%\content\textures | |
call :copya | |
popd | |
goto :eof | |
:new | |
::if not exist cache ( call :nocache | |
::) else ( pushd %instpath%\content\textures | |
::call :copya | |
::popd | |
::) | |
cscript //nologo "%~f0?.wsf" | |
goto :eof | |
:nocache | |
pushd %Temp%\RoCursor | |
%__p% -Command "try { $s = ^"%ts%^"; Write-Host $s^"[.] Downloading cursors from `nhttps://setup.rbxcdn.com/version-70a2467227df4077-content-textures2.zip^"; $ProgressPreference = 'SilentlyContinue'; $z = 'textures.zip'; Invoke-WebRequest -Uri 'https://setup.rbxcdn.com/version-70a2467227df4077-content-textures2.zip' -OutFile $n; $o = New-Object -ComObject Shell.Application; $e = Join-Path (Get-Location).Path $z; $tcpy = ($o.NameSpace($e).Items() | Where-Object {$_.Name -eq 'Cursors'}).GetFolder().Items() | Where-Object {$_.Name -eq 'KeyboardMouse'}; $o.NameSpace((Join-Path %instpath% 'content\textures\Cursors')).CopyHere($tcpy, 20); switch (%t%) {0{}1{$o.NameSpace('%localappdata%\%program%').CopyHere($tcpy);}} } except { Write-Host $s'[-] Exception '$_.FullyQualifiedErrorId': '$_.Exception^"`n^ This may be triggered of allergic reactions to non-existing or tampered files/folders^" } finally { if($e){try{Remove-Item $e -Recurse}except{Write-Host $s^"[-] Error removing`n ^"$s$e^"`n^"$s' You may do a manual cleanup instead.'}} }" | |
popd | |
ren KeyboardMouse cache | |
goto :eof | |
:custom | |
pushd %instpath%\content\textures | |
if %errorlevel% NEQ 0 goto :eof | |
call :copya | |
popd | |
goto :eof | |
:: --------------------------------- | |
:: -- MAIN TUI | |
:: --------------------------------- | |
:main | |
rem https://stackoverflow.com/q/9864620 | |
cls | |
echo. | |
echo ÉÍ %program% v%version% ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» | |
echo º º | |
echo º 1. Restore the 2013 cursor º | |
echo º 2. Restore the 2021 cursor º | |
echo º 3. Use custom cursor º | |
echo º º | |
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ | |
echo. | |
choice /c 123 /m "%bs% Pick an option: " /n | |
set e=%errorlevel% | |
set stop=end | |
set "ts=%bs% " | |
if %e% EQU 1 ( set op=old | |
) else ( if %e% EQU 2 ( set op=new | |
) else ( if %e% EQU 3 ( | |
echo. | |
set /p t=%ts%"Enter a directory: " | |
set op=custom | |
) else ( goto %stop%)) | |
) | |
echo. | |
echo. | |
echo %ts%---- Processing ---- | |
:cmdline | |
2>nul >nul reg query HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\roblox-player /v InstallLocation | |
if errorlevel 1 ( | |
call :error No Roblox installation found (errorlevel %errorlevel%^) | |
goto %stop% | |
) | |
call :instpath | |
call :%op% | |
::cls | |
goto %stop% | |
:: --------------------------------- | |
:: -- OUTPUTS | |
:: --------------------------------- | |
:instpath | |
for /f "tokens=3" %%G in ('2^>nul reg query HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\roblox-player /v InstallLocation') do set instpath=%%G | |
goto :eof | |
:normal | |
echo %ts%[+] %* | |
goto :eof | |
:error | |
echo %ts%[-] %* | |
goto :eof | |
:info | |
echo %ts%[.] %* | |
goto :eof | |
:end | |
endlocal | |
echo. | |
echo. | |
echo [Press any key to exit] | |
pause >nul | |
goto :eof | |
--> | |
<job><script language="VBScript"> | |
strSaveTo = oShell.ExpandEnvironmentStrings("%UserName%") & "\8c6f987d-a83b-4626-9ddd-7a32e6539a2e.zip" | |
' Download | |
WScript.Echo "[.] Downloading cursors from" & vbCrLf & "https://setup.rbxcdn.com/version-70a2467227df4077-content-textures2.zip" | |
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1") | |
objHTTP.Open "GET", "https://setup.rbxcdn.com/version-70a2467227df4077-content-textures2.zip", False | |
objHTTP.Send | |
' Delete if file exist | |
Set objFSO = CreateObject("Scripting.FileSystemObject") | |
If objFSO.FileExists(strSaveTo) then | |
objFSO.DeleteFile(strSaveTo) | |
End If | |
' Save file | |
If objHTTP.Status = 200 then | |
Dim objStream | |
Set objStream = CreateObject("ADODB.Stream") | |
With objStream | |
.Type = 1 'adTypeBinary | |
.Open | |
.Write objHTTP.ResponseBody | |
.SaveToFile strSaveTo | |
.Close | |
End With | |
Set objStream = Nothing | |
End If | |
If objFSO.FileExists(strSaveTo) then | |
WScript.Echo "[-] Download completed successfuly." | |
Else | |
WScript.Echo "[-] Download failed." | |
End If | |
Set oShell = CreateObject("Shell.Application") | |
Set zip = oShell.NameSpace(strSaveTo).items | |
For Each zfile In zip | |
If (Not zfile Is Nothing) Then | |
If (zfile.Name = "Cursors") then | |
Set fold = zfile.GetFolder().Items() | |
Exit For | |
End If | |
End If | |
Next | |
For Each zfile In fold | |
If (Not zfile Is Nothing) Then | |
If (zfile.Name = "KeyboardMouse") then | |
Set tcpy = zfile | |
Exit For | |
End If | |
End If | |
Next | |
oShell.NameSpace(CreateObject("WScript.Shell").RegRead("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\roblox-player\InstallLocation") & "\content\textures\Cursors").CopyHere(tcpy, 20) | |
</script></job> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment