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

autowalk and autojump #4523

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
6 changes: 5 additions & 1 deletion Horion.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@
<ClCompile Include="Horion\Module\Modules\AutoArmor.cpp" />
<ClCompile Include="Horion\Module\Modules\AutoClicker.cpp" />
<ClCompile Include="Horion\Module\Modules\AutoGapple.cpp" />
<ClCompile Include="Horion\Module\Modules\AutoJump.cpp" />
<ClCompile Include="Horion\Module\Modules\AutoSneak.cpp" />
<ClCompile Include="Horion\Module\Modules\AutoSprint.cpp" />
<ClCompile Include="Horion\Module\Modules\AutoTotem.cpp" />
<ClCompile Include="Horion\Module\Modules\AutoWalk.cpp" />
<ClCompile Include="Horion\Module\Modules\Bhop.cpp" />
<ClCompile Include="Horion\Module\Modules\Blink.cpp" />
<ClCompile Include="Horion\Module\Modules\BowAimbot.cpp" />
Expand Down Expand Up @@ -476,9 +478,11 @@
<ClInclude Include="Horion\Module\Modules\AutoArmor.h" />
<ClInclude Include="Horion\Module\Modules\AutoClicker.h" />
<ClInclude Include="Horion\Module\Modules\AutoGapple.h" />
<ClInclude Include="Horion\Module\Modules\AutoJump.h" />
<ClInclude Include="Horion\Module\Modules\AutoSneak.h" />
<ClInclude Include="Horion\Module\Modules\AutoSprint.h" />
<ClInclude Include="Horion\Module\Modules\AutoTotem.h" />
<ClInclude Include="Horion\Module\Modules\AutoWalk.h" />
<ClInclude Include="Horion\Module\Modules\Bhop.h" />
<ClInclude Include="Horion\Module\Modules\Blink.h" />
<ClInclude Include="Horion\Module\Modules\BowAimbot.h" />
Expand Down Expand Up @@ -653,4 +657,4 @@
<Error Condition="!Exists('packages\Microsoft.XAudio2.Redist.1.2.0\build\native\Microsoft.XAudio2.Redist.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.XAudio2.Redist.1.2.0\build\native\Microsoft.XAudio2.Redist.targets'))" />
<Error Condition="!Exists('packages\directxtk_desktop_2017.2020.2.24.4\build\native\directxtk_desktop_2017.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\directxtk_desktop_2017.2020.2.24.4\build\native\directxtk_desktop_2017.targets'))" />
</Target>
</Project>
</Project>
2 changes: 2 additions & 0 deletions Horion/Module/ModuleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ void ModuleManager::initModules() {
this->moduleList.push_back(std::shared_ptr<IModule>(new ViewModel()));
this->moduleList.push_back(std::shared_ptr<IModule>(new Twerk()));
this->moduleList.push_back(std::shared_ptr<IModule>(new FollowPathModule()));
this->moduleList.push_back(std::shared_ptr<IModule>(new AutoWalk()));
this->moduleList.push_back(std::shared_ptr<IModule>(new AutoJump()));

#ifdef _DEBUG
this->moduleList.push_back(std::shared_ptr<IModule>(new PacketLogger()));
Expand Down
2 changes: 2 additions & 0 deletions Horion/Module/ModuleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
#include "Modules/VanillaPlus.h"
#include "Modules/ViewModel.h"
#include "Modules/Twerk.h"
#include "Modules/AutoWalk.h"
#include "Modules/AutoJump.h"

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

AutoJump::AutoJump() : IModule(0, Category::MOVEMENT, "Automatically jump") {
}

AutoJump::~AutoJump() {}

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

void AutoJump::onTick(C_GameMode* gm) {
auto player = g_Data.getLocalPlayer();
if (player == nullptr) return;
MrDiamond64 marked this conversation as resolved.
Show resolved Hide resolved

if (player->onGround) gm->player->jumpFromGround();
}
12 changes: 12 additions & 0 deletions Horion/Module/Modules/AutoJump.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once
#include "Module.h"

class AutoJump : public IModule {
public:
AutoJump();
~AutoJump();

// Inherited via IModule
virtual const char* getModuleName() override;
virtual void onTick(C_GameMode* gm) override;
};
28 changes: 28 additions & 0 deletions Horion/Module/Modules/AutoWalk.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "AutoWalk.h"

AutoWalk::AutoWalk() : IModule(0, Category::MOVEMENT, "Automatically walk for you") {
this->registerBoolSetting("Sprint", &this->sprint, this->sprint);
this->registerBoolSetting("Jump", &this->jump, this->jump);
}

AutoWalk::~AutoWalk() {}

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

void AutoWalk::onTick(C_GameMode* gm) {
auto player = g_Data.getLocalPlayer();
if (player == nullptr) return;

g_Data.getClientInstance()->getMoveTurnInput()->forward = true;

if (sprint) gm->player->setSprinting(true);
if (!sprint) gm->player->setSprinting(false);
MrDiamond64 marked this conversation as resolved.
Show resolved Hide resolved

if (player->onGround && jump) gm->player->jumpFromGround();
}

void AutoWalk::onDisable() {
g_Data.getClientInstance()->getMoveTurnInput()->forward = false;
}
17 changes: 17 additions & 0 deletions Horion/Module/Modules/AutoWalk.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once
#include "Module.h"

class AutoWalk : public IModule {
private:
bool sprint = false;
bool jump = false;

public:
AutoWalk();
~AutoWalk();

// Inherited via IModule
virtual const char* getModuleName() override;
virtual void onTick(C_GameMode* gm) override;
virtual void onDisable() override;
};
2 changes: 1 addition & 1 deletion Memory/GameData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void GameData::retrieveClientInstance() {
if (sigOffset != 0x0) {
int offset = *reinterpret_cast<int*>((sigOffset + 3)); // Get Offset from code
clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative
logF("clinet: %llX", clientInstanceOffset);
logF("client: %llX", clientInstanceOffset);
}
}
// clientInstanceOffset = 0x03CD5058; // pointer scanned, can't find good signatures so it'll stay
Expand Down