Skip to content

Commit

Permalink
Implemented draw aimbot fov + fixed projecile autofire not saving
Browse files Browse the repository at this point in the history
  • Loading branch information
dyrkuwu committed Feb 9, 2024
1 parent 8985aa8 commit 59911e0
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 49 deletions.
2 changes: 2 additions & 0 deletions Seth/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ static void from_json(const json& j, Config::Aimbot::Projectile& p)
{
read(j, "Enabled", p.enabled);
read(j, "Aimlock", p.aimlock);
read(j, "Auto shoot", p.autoShoot);
read(j, "Silent", p.silent);
read(j, "Friendly fire", p.friendlyFire);
read(j, "Ignore cloaked", p.ignoreCloaked);
Expand Down Expand Up @@ -696,6 +697,7 @@ static void to_json(json& j, const Config::Aimbot::Projectile& o, const Config::
{
WRITE("Enabled", enabled);
WRITE("Aimlock", aimlock);
WRITE("Auto shoot", autoShoot);
WRITE("Silent", silent);
WRITE("Friendly fire", friendlyFire);
WRITE("Ignore cloaked", ignoreCloaked);
Expand Down
37 changes: 37 additions & 0 deletions Seth/Hacks/Misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,43 @@ void Misc::showKeybinds() noexcept
ImGui::End();
}

void Misc::drawAimbotFov(ImDrawList* drawList) noexcept
{
if (!config->aimbotFov.enabled)
return;

if (!interfaces->engine->isInGame() || !localPlayer)
return;

const auto activeWeapon = localPlayer->getActiveWeapon();
if (!activeWeapon)
return;

int aimFov;

const auto weaponType = activeWeapon->getWeaponType();
switch (weaponType)
{
case WeaponType::HITSCAN:
aimFov = config->aimbot.hitscan.fov;
break;
case WeaponType::PROJECTILE:
aimFov = config->aimbot.projectile.fov;
break;
case WeaponType::MELEE:
aimFov = config->aimbot.melee.fov;
break;
default:
return;
}

const auto& displaySize = ImGui::GetIO().DisplaySize;

const auto radius = std::tan(Helpers::deg2rad(aimFov) / (16.0f / 6.0f)) / std::tan(Helpers::deg2rad(localPlayer->isScoped() ? localPlayer->fov() : (config->visuals.fov + 90.0f)) / 2.0f) * displaySize.x;

drawList->AddCircle(displaySize / 2, radius, Helpers::calculateColor(config->aimbotFov));
}

void Misc::spectatorList() noexcept
{
if (!config->misc.spectatorList.enabled)
Expand Down
2 changes: 2 additions & 0 deletions Seth/Hacks/Misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ namespace Misc

void showKeybinds() noexcept;

void drawAimbotFov(ImDrawList* drawList) noexcept;

void spectatorList() noexcept;

void updateInput() noexcept;
Expand Down
48 changes: 0 additions & 48 deletions Seth/Hacks/Visuals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,55 +30,7 @@
#include "../SDK/Vector.h"

#include "../SDK/ViewSetup.h"
/*
void Visuals::drawAimbotFov(ImDrawList* drawList) noexcept
{
if (!config->legitbotFov.enabled || !config->legitbotKey.isActive())
return;
if (!localPlayer || !localPlayer->isAlive())
return;
GameData::Lock lock;
const auto& local = GameData::local();

if (!local.exists || !local.alive || local.aimPunch.null())
return;
if (memory->input->isCameraInThirdPerson())
return;
const auto activeWeapon = localPlayer->getActiveWeapon();
if (!activeWeapon)
return;
auto weaponIndex = getWeaponIndex(activeWeapon->itemDefinitionIndex2());
if (!weaponIndex)
return;
const auto& cfg = config->legitbot;
auto weaponClass = getWeaponClass(activeWeapon->itemDefinitionIndex2());
if (!cfg[weaponIndex].enabled)
weaponIndex = weaponClass;
if (!cfg[weaponIndex].enabled)
weaponIndex = 0;
if (ImVec2 pos; Helpers::worldToScreen(local.aimPunch, pos))
{
const auto& displaySize = ImGui::GetIO().DisplaySize;
const auto radius = std::tan(Helpers::deg2rad(cfg[weaponIndex].fov) / (16.0f/6.0f)) / std::tan(Helpers::deg2rad(localPlayer->isScoped() ? localPlayer->fov() : (config->visuals.fov + 90.0f)) / 2.0f) * displaySize.x;
if (radius > displaySize.x || radius > displaySize.y || !std::isfinite(radius))
return;
const auto color = Helpers::calculateColor(config->legitbotFov);
drawList->AddCircleFilled(localPlayer->shotsFired() > 1 ? pos : displaySize / 2.0f, radius, color);
if (config->legitbotFov.outline)
drawList->AddCircle(localPlayer->shotsFired() > 1 ? pos : displaySize / 2.0f, radius, color | IM_COL32_A_MASK, 360);
}
}
*/

void Visuals::thirdperson() noexcept
{
Expand Down
1 change: 0 additions & 1 deletion Seth/Hacks/Visuals.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ struct UserCmd;

namespace Visuals
{
void drawAimbotFov(ImDrawList* drawList) noexcept;
void thirdperson() noexcept;
void disablePostProcessing(FrameStage stage) noexcept;

Expand Down
1 change: 1 addition & 0 deletions Seth/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ static HRESULT __stdcall present(IDirect3DDevice9* device, const RECT* src, cons

Misc::drawPlayerList();
Crithack::draw(ImGui::GetForegroundDrawList());
Misc::drawAimbotFov(ImGui::GetForegroundDrawList());

gui->handleToggle();

Expand Down

0 comments on commit 59911e0

Please sign in to comment.