Skip to content

Commit

Permalink
Added hitboxes
Browse files Browse the repository at this point in the history
Added hitboxes
  • Loading branch information
Lefraudeur committed Oct 23, 2023
2 parents d5f5154 + 123bffd commit 8590099
Show file tree
Hide file tree
Showing 12 changed files with 268 additions and 116 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Change mappings to add new versions
- Xray (only on 1.7.10 and 1.8.9)
- WTap
- Sprint
- HitBoxes

![image](https://github.com/Lefraudeur/RiptermsGhost/assets/91006387/39690baa-859a-4ea2-a9b0-dfbc8cbfe472)

Expand All @@ -42,13 +43,22 @@ You have to inject while in game (otherwise some classes are not loaded)


Help would be appreciated, this repo is here to share your knowledge with other people. You can also make suggestions. (open an issue or a pull request to dev branch)

TODO:
- Good world to screen, to make player and block ESP (so I can get rid of the xray)
- Customizable key binds
- Enabled modules list

You can also test the cheat and tell me about bugs you find, you can try the dev branch, it sometimes contains unstable modules that only works with lunar 1.8.9.

### Future of the project ?
There are some cool jvm tricks I can't implement in the current base, and I also have less time to work on Ripterms.
So future updates will be mainly bug fixes / code restructure for better scalability.

Thanks to t0r-onion for the GUI

Current Contributors:
Lefraudeur,
t0r-onion

Feel free to use this project how ever you want. Credits would be appreciated
Feel free to use this project how ever you want. Credits would be appreciated
5 changes: 5 additions & 0 deletions Ripterms Ghost.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,18 @@
<ClCompile Include="Ripterms\Modules\AimAssist.cpp" />
<ClCompile Include="Ripterms\Modules\Blink.cpp" />
<ClCompile Include="Ripterms\Modules\ClientBrandChanger.cpp" />
<ClCompile Include="Ripterms\Modules\FastPlace.cpp" />
<ClCompile Include="Ripterms\Modules\FullBright.cpp" />
<ClCompile Include="Ripterms\Modules\HitBoxes.cpp" />
<ClCompile Include="Ripterms\Modules\LeftClicker.cpp" />
<ClCompile Include="Ripterms\Modules\LegitScaffold.cpp" />
<ClCompile Include="Ripterms\Modules\Modules.cpp" />
<ClCompile Include="Ripterms\Modules\Reach.cpp" />
<ClCompile Include="Ripterms\Modules\Sprint.cpp" />
<ClCompile Include="Ripterms\Modules\Test.cpp" />
<ClCompile Include="Ripterms\Modules\Velocity.cpp" />
<ClCompile Include="Ripterms\Modules\WTap.cpp" />
<ClCompile Include="Ripterms\Modules\Xray.cpp" />
<ClCompile Include="Ripterms\Patcher\Patcher.cpp" />
<ClCompile Include="Ripterms\Ripterms.cpp" />
<ClCompile Include="Ripterms\CTimer.cpp" />
Expand Down
15 changes: 15 additions & 0 deletions Ripterms Ghost.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,21 @@
<ClCompile Include="java\nio\IntBuffer\IntBuffer.cpp">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="Ripterms\Modules\HitBoxes.cpp">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="Ripterms\Modules\Sprint.cpp">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="Ripterms\Modules\WTap.cpp">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="Ripterms\Modules\Xray.cpp">
<Filter>Fichiers sources</Filter>
</ClCompile>
<ClCompile Include="Ripterms\Modules\FastPlace.cpp">
<Filter>Fichiers sources</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Ripterms\Ripterms.h">
Expand Down
35 changes: 35 additions & 0 deletions Ripterms/Modules/FastPlace.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "Modules.h"
#include <imgui.h>
#include "../Cache/Cache.h"

void Ripterms::Modules::FastPlace::run()
{
if (!enabled || !GetAsyncKeyState(VK_RBUTTON)) return;
if (Ripterms::cache->theMinecraft.getRightClickDelayTimer() == 4)
{
Ripterms::cache->theMinecraft.setRightClickDelayTimer(tickDelay);
}
}

void Ripterms::Modules::FastPlace::renderGUI()
{
static bool display_options = false;
ImGui::PushStyleVar(ImGuiStyleVar_ItemInnerSpacing, ImVec2(20.0f, 0.0f));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(250.0f, ImGui::GetStyle().FramePadding.y));
ImGui::Checkbox("Fast Place", &enabled);
ImGui::PopStyleVar();
if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) display_options = !display_options;
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 30.0f);
if (ImGui::ArrowButton("fastplaceopt", ImGuiDir_Down)) display_options = !display_options;
if (display_options)
{
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 10.0f);
ImGui::BeginGroup();
{
ImGui::SliderInt("Tick Delay", &tickDelay, 0, 3);
}
ImGui::EndGroup();
}
ImGui::PopStyleVar();
}
60 changes: 60 additions & 0 deletions Ripterms/Modules/HitBoxes.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#include "Modules.h"
#include <ImGui/imgui.h>
#include "../../net/minecraft/client/entity/AbstractClientPlayer/AbstractClientPlayer.h"
#include "../Cache/Cache.h"

void Ripterms::Modules::HitBoxes::run()
{
static Ripterms::CTimer timer(std::chrono::milliseconds(15));
if (!enabled || !timer.isElapsed())
return;

Ripterms::Maths::Vector3d thePlayer_position = cache->thePlayer.getPosition();

for (EntityPlayer& target : cache->playerEntities.toVector<EntityPlayer>())
{
if
(
target.isEqualTo(cache->thePlayer) ||
(target.getPosition() - thePlayer_position).distance() > 9.0f
)
continue;

AxisAlignedBB target_bb = target.getBoundingBox();
if
(
(target_bb.getMaxX() - target_bb.getMinX()) > 0.61f ||
(target_bb.getMaxY() - target_bb.getMinY()) > 1.81f
)
continue;

target_bb.setMinX(target_bb.getMinX() - x_expand);
target_bb.setMaxX(target_bb.getMaxX() + x_expand);
target_bb.setMinZ(target_bb.getMinZ() - x_expand);
target_bb.setMaxZ(target_bb.getMaxZ() + x_expand);

target_bb.setMinY(target_bb.getMinY() - y_expand);
target_bb.setMaxY(target_bb.getMaxY() + y_expand);
}
}

void Ripterms::Modules::HitBoxes::renderGUI()
{
static bool display_options = false;
ImGui::PushStyleVar(ImGuiStyleVar_ItemInnerSpacing, ImVec2(20.0f, 0.0f));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(250.0f, ImGui::GetStyle().FramePadding.y));
ImGui::Checkbox("HitBoxes", &enabled);
ImGui::PopStyleVar();
ImGui::PopStyleVar();
if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) display_options = !display_options;
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 30.0f);
if (ImGui::ArrowButton("hbopt", ImGuiDir_Down)) display_options = !display_options;
if (display_options) {
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 10.0f);
ImGui::BeginGroup();
ImGui::SliderFloat("X Expand", &x_expand, 0.01f, 2.0f, "%.01f");
ImGui::SliderFloat("Y Expand", &y_expand, 0.01f, 2.0f, "%.01f");
ImGui::EndGroup();
}
}
114 changes: 0 additions & 114 deletions Ripterms/Modules/Modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,120 +46,6 @@ void Ripterms::Modules::cleanAll()
}
}

void Ripterms::Modules::FastPlace::run()
{
if (!enabled || !GetAsyncKeyState(VK_RBUTTON)) return;
if (Ripterms::cache->theMinecraft.getRightClickDelayTimer() == 4)
{
Ripterms::cache->theMinecraft.setRightClickDelayTimer(tickDelay);
}
}

void Ripterms::Modules::FastPlace::renderGUI()
{
static bool display_options = false;
ImGui::PushStyleVar(ImGuiStyleVar_ItemInnerSpacing, ImVec2(20.0f, 0.0f));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(250.0f, ImGui::GetStyle().FramePadding.y));
ImGui::Checkbox("Fast Place", &enabled);
ImGui::PopStyleVar();
if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) display_options = !display_options;
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 30.0f);
if (ImGui::ArrowButton("fastplaceopt", ImGuiDir_Down)) display_options = !display_options;
if (display_options)
{
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 10.0f);
ImGui::BeginGroup();
{
ImGui::SliderInt("Tick Delay", &tickDelay, 0, 3);
}
ImGui::EndGroup();
}
ImGui::PopStyleVar();
}



void Ripterms::Modules::Xray::run()
{
static bool prev_enabled = false;
if (!enabled)
{
if (prev_enabled)
{
disable();
prev_enabled = false;
}
return;
}
if (!prev_enabled)
{
Ripterms::cache->EMPTY_MAP.put(String("xray_enabled"), String("1"));
prev_enabled = true;
}
}

void Ripterms::Modules::Xray::renderGUI()
{
ImGui::PushStyleVar(ImGuiStyleVar_ItemInnerSpacing, ImVec2(20.0f, 0.0f));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(250.0f, ImGui::GetStyle().FramePadding.y));
ImGui::Checkbox("Xray", &enabled);
ImGui::PopStyleVar();
ImGui::PopStyleVar();
}

void Ripterms::Modules::Xray::disable()
{
Ripterms::cache->EMPTY_MAP.put(String("xray_enabled"), String("0"));
}

void Ripterms::Modules::WTap::onEvent(Ripterms::Event* event)
{
static int ticks = 10;

if (!enabled)
return;

if (event->type == Ripterms::Event::Type::PRE_ATTACK)
{
ticks = 0;
}
else if (event->type == Event::Type::PRE_MOTION)
{
++ticks;
EntityPlayerSP thePlayer = Minecraft::getTheMinecraft(event->env).getThePlayer();
if (thePlayer.isSprinting())
{
if (ticks == 2) thePlayer.setSprinting(false);
if (ticks == 3) thePlayer.setSprinting(true);
}
}
}

void Ripterms::Modules::WTap::renderGUI()
{
ImGui::PushStyleVar(ImGuiStyleVar_ItemInnerSpacing, ImVec2(20.0f, 0.0f));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(250.0f, ImGui::GetStyle().FramePadding.y));
ImGui::Checkbox("WTap", &enabled);
ImGui::PopStyleVar();
ImGui::PopStyleVar();
}

void Ripterms::Modules::Sprint::run()
{
if (!enabled)
return;
cache->gameSettings.getKeyBindSprint().setPressed(true);
}

void Ripterms::Modules::Sprint::renderGUI()
{
ImGui::PushStyleVar(ImGuiStyleVar_ItemInnerSpacing, ImVec2(20.0f, 0.0f));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(250.0f, ImGui::GetStyle().FramePadding.y));
ImGui::Checkbox("Sprint", &enabled);
ImGui::PopStyleVar();
ImGui::PopStyleVar();
}

void Ripterms::Modules::ESP::render()
{
Expand Down
12 changes: 11 additions & 1 deletion Ripterms/Modules/Modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ namespace Ripterms
void renderGUI() override;
};

class HitBoxes : public IModule
{
public:
void run();
void renderGUI();
private:
float x_expand = 0.5f;
float y_expand = 0.5f;
};


//Category Other
class ClientBrandChanger : public IModule
Expand Down Expand Up @@ -157,7 +167,7 @@ namespace Ripterms

inline std::map<std::string, std::vector<IModule*>> categories =
{
{"Combat", {new AimAssist(), new Reach(), new LeftClicker(), new WTap()}},
{"Combat", {new AimAssist(), new Reach(), new LeftClicker(), new WTap(), new HitBoxes()}},
{"Player", {new Velocity(), new FastPlace(), new Blink(), new LegitScaffold(), new Sprint()}},
{"Render", {new Xray(), new FullBright(), new ESP()}},
{"Whatever", {new ClientBrandChanger(), new Test()}}
Expand Down
19 changes: 19 additions & 0 deletions Ripterms/Modules/Sprint.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "Modules.h"
#include <ImGui/imgui.h>
#include "../Cache/Cache.h"

void Ripterms::Modules::Sprint::run()
{
if (!enabled)
return;
cache->gameSettings.getKeyBindSprint().setPressed(true);
}

void Ripterms::Modules::Sprint::renderGUI()
{
ImGui::PushStyleVar(ImGuiStyleVar_ItemInnerSpacing, ImVec2(20.0f, 0.0f));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(250.0f, ImGui::GetStyle().FramePadding.y));
ImGui::Checkbox("Sprint", &enabled);
ImGui::PopStyleVar();
ImGui::PopStyleVar();
}
35 changes: 35 additions & 0 deletions Ripterms/Modules/WTap.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "Modules.h"
#include "../../net/minecraft/client/Minecraft/Minecraft.h"
#include <imgui.h>

void Ripterms::Modules::WTap::onEvent(Ripterms::Event* event)
{
static int ticks = 10;

if (!enabled)
return;

if (event->type == Ripterms::Event::Type::PRE_ATTACK)
{
ticks = 0;
}
else if (event->type == Event::Type::PRE_MOTION)
{
++ticks;
EntityPlayerSP thePlayer = Minecraft::getTheMinecraft(event->env).getThePlayer();
if (thePlayer.isSprinting())
{
if (ticks == 2) thePlayer.setSprinting(false);
if (ticks == 3) thePlayer.setSprinting(true);
}
}
}

void Ripterms::Modules::WTap::renderGUI()
{
ImGui::PushStyleVar(ImGuiStyleVar_ItemInnerSpacing, ImVec2(20.0f, 0.0f));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(250.0f, ImGui::GetStyle().FramePadding.y));
ImGui::Checkbox("WTap", &enabled);
ImGui::PopStyleVar();
ImGui::PopStyleVar();
}
Loading

0 comments on commit 8590099

Please sign in to comment.