-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathFastCharger.cpp
More file actions
104 lines (91 loc) · 2.99 KB
/
FastCharger.cpp
File metadata and controls
104 lines (91 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "FastCharger.h"
#include "Interfaces.h"
#include "TF2Player.h"
#include "TF2Entity.h"
#include "TF2Weapon.h"
FastCharger *FastCharger::g_pInstance;
FastCharger::FastCharger()
{
FastCharger::g_pInstance = this;
isSpeeding = false;
m_bRun = false;
ShouldRun = new ConVar(PREFIX "charger_auto", "0", 0,
"Attempts to speed up the charging of the ubercharge, spy cloack, and sniper rifle automatically by speedhacking when you are standing still.");
TargetTimescale = new ConVar(PREFIX "charger_target_timescale", "10",0,
"What the charger will ");
CurrentClass = new ConVar(PREFIX "currentclass","0");
new ConCommand("+skim_chargebot",FastCharger::TurnOn,0,0,0);
new ConCommand("-skim_chargebot",FastCharger::TurnOn,0,0,0);
}
FastCharger::~FastCharger()
{
FreeConCMD(ShouldRun);
FreeConCMD(TargetTimescale);
FreeConCMD(CurrentClass);
FreeConCMD(c1);
FreeConCMD(c2);
}
void FastCharger::TurnOff()
{
FastCharger::g_pInstance->m_bRun = false;
}
void FastCharger::TurnOn()
{
FastCharger::g_pInstance->m_bRun = true;
}
void FastCharger::SetSpeedhack( bool on )
{
//rebuild this, valve diabled host_timescale and host_framerate
if(on)
{
isSpeeding = true;
}
else
{
isSpeeding = false;
}
}
void FastCharger::Run(CUserCmd* pCmd)
{
//if(!(Skim::ValveInterfaces::pEngine->IsInGame() &&
// (m_bRun || ShouldRun->GetBool()) &&
// (
// CurrentClass->GetInt() == TF2Class::Medic ||
// CurrentClass->GetInt() == TF2Class::Sniper ||
// CurrentClass->GetInt() == TF2Class::Spy
// )
// ))//Should improve getting classes and need to get weapon, especially since I could be a cloaked spy without the CnD
// return;
//using namespace Skim;
//using namespace Skim::Weapons;
//TF2Player* pBaseEntMe = Skim::TF2Entity::Me();
//if(!pBaseEntMe) return;
////TF2Weapon* pWeapon = pBaseEntMe->pActiveWeapon();
//if(pCmd->forwardmove == 0 && pCmd->sidemove == 0)
//{
// if (CurrentClass->GetInt() == TF2Class::Medic){
// //check if I am a medic and might be healing(in attack)
// if(
// (pCmd->weaponselect == TF2WeaponID_t::Medigun ||
// pCmd->weaponselect == TF2WeaponID_t::MedigunB ||
// pCmd->weaponselect == TF2WeaponID_t::Kritzkrieg) &&
// pCmd->buttons & IN_ATTACK){
// SetSpeedhack( true );
// }
// //if(pCmd->buttons & IN_ATTACK){
// // SetSpeedhack( true );
// //}
// else
// {//We are not attacking, speeds is off
// SetSpeedhack( false );
// }
// }
// else{
// // I am not a medic, I am a sniper or spy
// SetSpeedhack( true );
// }
//}
//else if (isSpeeding){
// SetSpeedhack( false );
//}
}