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 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
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
16 changes: 16 additions & 0 deletions Horion/Module/Modules/AutoJump.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#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->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;
};
35 changes: 35 additions & 0 deletions Horion/Module/Modules/AutoWalk.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "AutoWalk.h"

AutoWalk::AutoWalk() : IModule(0, Category::MOVEMENT, "Automatically walk for you") {
mode = (*new SettingEnum(this)).addEntry(EnumEntry("Forwards", 1)).addEntry(EnumEntry("Left", 2)).addEntry(EnumEntry("Right", 3)).addEntry(EnumEntry("Backwards", 4));
this->registerEnumSetting("Direction", &mode, 0);
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 (mode.selected == 0) g_Data.getClientInstance()->getMoveTurnInput()->forward = true;
if (mode.selected == 1) g_Data.getClientInstance()->getMoveTurnInput()->left = true;
if (mode.selected == 2) g_Data.getClientInstance()->getMoveTurnInput()->right = true;
if (mode.selected == 3) g_Data.getClientInstance()->getMoveTurnInput()->backward = true;

if (sprint) gm->player->setSprinting(true);
else gm->player->setSprinting(false);

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

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

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

public:
SettingEnum mode;
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