Update 0.01 F
This commit is contained in:
@@ -52,7 +52,8 @@ namespace Lithium
|
|||||||
t.Start();
|
t.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RecoilLoop() => RecoilEngine.Start();
|
private void RecoilLoop() => RecoilEngine.Start(this);
|
||||||
|
|
||||||
|
|
||||||
private void HotkeyLoop() => HotkeyHandler.Start(this);
|
private void HotkeyLoop() => HotkeyHandler.Start(this);
|
||||||
|
|
||||||
|
|||||||
+34
-29
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using Lithium;
|
||||||
|
using System;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace Lua
|
namespace Lua
|
||||||
@@ -15,11 +16,11 @@ namespace Lua
|
|||||||
private static double _remainderX, _remainderY;
|
private static double _remainderX, _remainderY;
|
||||||
private static double _jitterMultiplierX, _jitterMultiplierY;
|
private static double _jitterMultiplierX, _jitterMultiplierY;
|
||||||
|
|
||||||
public static void Start()
|
public static void Start(MainWindow window)
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (Utils.IsCapsLockOn() && Utils.IsPressed(VK_RBUTTON))
|
if (window.IsRecoilEnabled && Utils.IsPressed(VK_LBUTTON) && Utils.IsPressed(VK_RBUTTON))
|
||||||
{
|
{
|
||||||
HandleRecoilTick();
|
HandleRecoilTick();
|
||||||
}
|
}
|
||||||
@@ -28,10 +29,14 @@ namespace Lua
|
|||||||
_remainderX = _remainderY = 0;
|
_remainderX = _remainderY = 0;
|
||||||
_jitterActive = false;
|
_jitterActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Thread.Sleep(2);
|
Thread.Sleep(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static void HandleRecoilTick()
|
private static void HandleRecoilTick()
|
||||||
{
|
{
|
||||||
if (!Utils.IsPressed(VK_LBUTTON)) return;
|
if (!Utils.IsPressed(VK_LBUTTON)) return;
|
||||||
@@ -48,48 +53,47 @@ namespace Lua
|
|||||||
|
|
||||||
private static void HandleJitter(int now)
|
private static void HandleJitter(int now)
|
||||||
{
|
{
|
||||||
if (ConfigLoader.jitterEnabled)
|
if (!ConfigLoader.jitterEnabled) return;
|
||||||
|
|
||||||
|
if (!_jitterActive && now - _lastJitterEnd >= ConfigLoader.jitterCooldown)
|
||||||
{
|
{
|
||||||
if (!_jitterActive && now - _lastJitterEnd >= ConfigLoader.jitterCooldown)
|
_jitterActive = true;
|
||||||
{
|
_jitterStart = now;
|
||||||
_jitterActive = true;
|
|
||||||
_jitterStart = now;
|
|
||||||
|
|
||||||
double strength = 0.1 + _rng.NextDouble() * 0.8;
|
// Set small random jitter multipliers
|
||||||
_jitterMultiplierX = _jitterMultiplierY = 0;
|
_jitterMultiplierX = (_rng.NextDouble() - 0.5) * 0.2; // ±0.1
|
||||||
|
_jitterMultiplierY = (_rng.NextDouble() - 0.5) * 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
switch (_rng.Next(1, 5))
|
if (_jitterActive && now - _jitterStart >= ConfigLoader.jitterBurstTime)
|
||||||
{
|
{
|
||||||
case 1: _jitterMultiplierX = -strength; break;
|
_jitterActive = false;
|
||||||
case 2: _jitterMultiplierX = strength; break;
|
_lastJitterEnd = now;
|
||||||
case 3: _jitterMultiplierY = -strength; break;
|
_jitterMultiplierX = _jitterMultiplierY = 0;
|
||||||
case 4: _jitterMultiplierY = strength; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_jitterActive && now - _jitterStart >= ConfigLoader.jitterBurstTime)
|
|
||||||
{
|
|
||||||
_jitterActive = false;
|
|
||||||
_lastJitterEnd = now;
|
|
||||||
_jitterMultiplierX = _jitterMultiplierY = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ApplyRecoil((double recoilX, double recoilY) recoil)
|
private static void ApplyRecoil((double recoilX, double recoilY) recoil)
|
||||||
{
|
{
|
||||||
double jitterX = recoil.recoilX * _jitterMultiplierX;
|
// Apply base recoil first
|
||||||
double jitterY = recoil.recoilY * _jitterMultiplierY;
|
double moveX = recoil.recoilX;
|
||||||
|
double moveY = recoil.recoilY;
|
||||||
|
|
||||||
double moveX = recoil.recoilX + _remainderX + jitterX;
|
// Apply optional multiplier for jitter
|
||||||
double moveY = recoil.recoilY + _remainderY + jitterY;
|
moveX += recoil.recoilX * _jitterMultiplierX;
|
||||||
|
moveY += recoil.recoilY * _jitterMultiplierY;
|
||||||
|
|
||||||
|
// Apply any global scaling
|
||||||
if (ConfigLoader.debitFlag1)
|
if (ConfigLoader.debitFlag1)
|
||||||
{
|
{
|
||||||
moveX *= 1.282;
|
moveX *= 1.282;
|
||||||
moveY *= 1.351;
|
moveY *= 1.351;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add remainder for precision
|
||||||
|
moveX += _remainderX;
|
||||||
|
moveY += _remainderY;
|
||||||
|
|
||||||
int ix = (int)Math.Round(moveX);
|
int ix = (int)Math.Round(moveX);
|
||||||
int iy = (int)Math.Round(moveY);
|
int iy = (int)Math.Round(moveY);
|
||||||
|
|
||||||
@@ -98,5 +102,6 @@ namespace Lua
|
|||||||
|
|
||||||
Utils.MoveMouse(ix, iy);
|
Utils.MoveMouse(ix, iy);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user