Skip to content
This repository was archived by the owner on Dec 26, 2021. It is now read-only.

Someone said add twerk #476

Merged
merged 2 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,4 @@ add_library(Horion SHARED
Utils/Utils.cpp
Utils/Utils.h
Utils/xorstr.h
resource.h SDK/TextHolder.cpp SDK/CChestBlockActor.cpp SDK/Tag.cpp Utils/keys.h SDK/CBlockLegacy.cpp SDK/CItem.cpp SDK/CInventory.cpp SDK/CInventoryTransaction.cpp SDK/CEntity.cpp SDK/CComplexInventoryTransaction.cpp SDK/CPacket.cpp SDK/CMinecraftUIRenderContext.cpp SDK/CClientInstance.cpp SDK/CMoveInputHandler.cpp SDK/CImageBuffer.h Horion/Module/Modules/Freelook.cpp Horion/Module/Modules/Freelook.h SDK/CCamera.h SDK/CCamera.cpp Horion/Module/Modules/NoHurtcam.cpp Horion/Module/Modules/NoHurtcam.h Horion/Module/Modules/AntiImmobile.cpp Horion/Module/Modules/AntiImmobile.h Horion/path/JoePathFinder.cpp Horion/path/JoePathFinder.h Horion/path/JoePath.cpp Horion/path/JoePath.h Horion/path/JoeSegment.cpp Horion/path/JoeSegment.h Horion/path/JoeMovementController.cpp Horion/path/JoeMovementController.h Horion/path/goals/JoeGoal.cpp Horion/path/goals/JoeGoal.h Horion/path/goals/JoeGoalXYZ.cpp Horion/path/goals/JoeGoalXYZ.h Horion/path/goals/JoeGoalXZ.cpp Horion/path/goals/JoeGoalXZ.h Horion/path/JoeConstants.h Horion/path/goals/JoeGoalY.cpp Horion/path/goals/JoeGoalY.h Horion/Module/Modules/FollowPathModule.cpp Horion/Module/Modules/FollowPathModule.h Horion/Command/Commands/PathCommand.cpp Horion/Command/Commands/PathCommand.h Horion/path/JoeConstants.cpp Horion/Scripting/Functions/LevelFunctions.cpp Horion/Scripting/Functions/LevelFunctions.h Horion/Scripting/Functions/DrawFunctions.cpp Horion/Scripting/Functions/DrawFunctions.h)
resource.h SDK/TextHolder.cpp SDK/CChestBlockActor.cpp SDK/Tag.cpp Utils/keys.h SDK/CBlockLegacy.cpp SDK/CItem.cpp SDK/CInventory.cpp SDK/CInventoryTransaction.cpp SDK/CEntity.cpp SDK/CComplexInventoryTransaction.cpp SDK/CPacket.cpp SDK/CMinecraftUIRenderContext.cpp SDK/CClientInstance.cpp SDK/CMoveInputHandler.cpp SDK/CImageBuffer.h Horion/Module/Modules/Freelook.cpp Horion/Module/Modules/Freelook.h SDK/CCamera.h SDK/CCamera.cpp Horion/Module/Modules/NoHurtcam.cpp Horion/Module/Modules/NoHurtcam.h Horion/Module/Modules/AntiImmobile.cpp Horion/Module/Modules/AntiImmobile.h Horion/path/JoePathFinder.cpp Horion/path/JoePathFinder.h Horion/path/JoePath.cpp Horion/path/JoePath.h Horion/path/JoeSegment.cpp Horion/path/JoeSegment.h Horion/path/JoeMovementController.cpp Horion/path/JoeMovementController.h Horion/path/goals/JoeGoal.cpp Horion/path/goals/JoeGoal.h Horion/path/goals/JoeGoalXYZ.cpp Horion/path/goals/JoeGoalXYZ.h Horion/path/goals/JoeGoalXZ.cpp Horion/path/goals/JoeGoalXZ.h Horion/path/JoeConstants.h Horion/path/goals/JoeGoalY.cpp Horion/path/goals/JoeGoalY.h Horion/Module/Modules/FollowPathModule.cpp Horion/Module/Modules/FollowPathModule.h Horion/Command/Commands/PathCommand.cpp Horion/Command/Commands/PathCommand.h Horion/path/JoeConstants.cpp Horion/Scripting/Functions/LevelFunctions.cpp Horion/Scripting/Functions/LevelFunctions.h Horion/Scripting/Functions/DrawFunctions.cpp Horion/Scripting/Functions/DrawFunctions.h "Horion/Module/Modules/Twerk.cpp" "Horion/Module/Modules/Twerk.h")
2 changes: 2 additions & 0 deletions Horion.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@
<ClCompile Include="Horion\Module\Modules\Tower.cpp" />
<ClCompile Include="Horion\Module\Modules\Tracer.cpp" />
<ClCompile Include="Horion\Module\Modules\TriggerBot.cpp" />
<ClCompile Include="Horion\Module\Modules\Twerk.cpp" />
<ClCompile Include="Horion\Module\Modules\VanillaPlus.cpp" />
<ClCompile Include="Horion\Module\Modules\Velocity.cpp" />
<ClCompile Include="Horion\Module\Modules\Waypoints.cpp" />
Expand Down Expand Up @@ -544,6 +545,7 @@
<ClInclude Include="Horion\Module\Modules\Tower.h" />
<ClInclude Include="Horion\Module\Modules\Tracer.h" />
<ClInclude Include="Horion\Module\Modules\TriggerBot.h" />
<ClInclude Include="Horion\Module\Modules\Twerk.h" />
<ClInclude Include="Horion\Module\Modules\VanillaPlus.h" />
<ClInclude Include="Horion\Module\Modules\Velocity.h" />
<ClInclude Include="Horion\Module\Modules\Waypoints.h" />
Expand Down
2 changes: 1 addition & 1 deletion Horion/Module/ModuleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void ModuleManager::initModules() {
this->moduleList.push_back(std::shared_ptr<IModule>(new Compass()));
this->moduleList.push_back(std::shared_ptr<IModule>(new Radar()));
this->moduleList.push_back(std::shared_ptr<IModule>(new VanillaPlus()));

this->moduleList.push_back(std::shared_ptr<IModule>(new Twerk()));
this->moduleList.push_back(std::shared_ptr<IModule>(new FollowPathModule()));

#ifdef _DEBUG
Expand Down
1 change: 1 addition & 0 deletions Horion/Module/ModuleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
#include "Modules/Compass.h"
#include "Modules/Radar.h"
#include "Modules/VanillaPlus.h"
#include "Modules/Twerk.h"

#ifdef _DEBUG
#include "Modules/PacketLogger.h"
Expand Down
29 changes: 29 additions & 0 deletions Horion/Module/Modules/Twerk.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "Twerk.h"

Twerk::Twerk() : IModule(0x0, Category::MOVEMENT, "Crouch Spam") {
registerFloatSetting("delay", &this->delay, this->delay, 0.05, 10);
}

Twerk::~Twerk() {
}

const char* Twerk::getModuleName() {
return ("Twerk");
}

void Twerk::onTick(C_GameMode* gm) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire function can be simplified into

if((Odelay++ % (delay * 20)) == 0){
    g_Data.getClientInstance()->getMoveTurnInput()->isSneakDown = !gm->player->isSneaking();
}

if ur gonna add twerk, you gotta do it right smh

/s

Odelay++;
if (Odelay > delay * 20) {
C_GameSettingsInput* input = g_Data.getClientInstance()->getGameSettingsInput();
if (gm->player->isSneaking()) {
isSneaking = false;
}
else {
if (!gm->player->isSneaking()) {
isSneaking = true;
}
}
g_Data.getClientInstance()->getMoveTurnInput()->isSneakDown = isSneaking;
Odelay = 0;
}
}
15 changes: 15 additions & 0 deletions Horion/Module/Modules/Twerk.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once
#include "Module.h"
class Twerk : public IModule {
public:
Twerk();
~Twerk();

private:
bool isSneaking = false;
int Odelay = 0;
float delay = 1;
inline float& getDelay() { return delay; };
virtual const char* getModuleName() override;
void onTick(C_GameMode* gm);
};