Начинающий
- Статус
- Оффлайн
- Регистрация
- 16 Сен 2024
- Сообщения
- 44
- Реакции
- 5
ку, у меня на асфиксии уже неплохой рейдж, осталось добавить дт, я пытался с помощью нейронки перенести код дт (слитый) в асфиксию
был:
она мне сделала:
но код не ворк, что делать?
был:
дт который слили:
static void double_tap()
{
static int shot_count{};
static int old_shot_count{ };
double offset_tick{ };
auto temp = active_weapon->GetNextPrimaryAttackTickRatio() + modf(active_weapon->watOffset(), &offset_tick);
auto next_attack = active_weapon->GetNextPrimaryAttackTick();
auto shoot_tick = (int)next_attack + offset_tick;
if (temp >= 0.0) {
if (temp >= 1.0) {
++shoot_tick;
}
}
else {
--shoot_tick;
}
bool f = shot_count % 2;
if (cmd->pb.nAttack1StartHistoryIndex > -1)
shot_count++;
for (int i = 0; i < cmd->pb.input_history.pRep->nAllocatedSize; i++) {
auto input_history = cmd->get_input_entry(i);
if (!input_history) {
continue;
}
input_history->nPlayerTickCount = f ? shoot_tick - 1 : 0;
input_history->flPlayerTickFraction = 0.f;
}
cmd->pb.nAttack1StartHistoryIndex = -1;
old_shot_count = shot_count;
}
она мне сделала:
она мне сделала:
void RageBot::DoubleTap(CUserCmd* cmd, C_CSWeaponBase* active_weapon) {
L_PRINT(LOG_INFO) << "DoubleTap called, Vars.bDoubleTap = " << C_GET(bool, Vars.bDoubleTap);
if (!C_GET(bool, Vars.bDoubleTap) || !active_weapon || active_weapon->IsNade() || active_weapon->IsKnife() || active_weapon->IsInReload()) {
return;
}
static float last_shot_time = 0.f;
static bool should_double_tap = false;
static int shot_tick = 0;
int current_tick = SDK::LocalController->GetTickBase();
float current_time = TICKS_TO_TIME(current_tick);
int next_attack_tick = [I]reinterpret_cast<int[/I]>(reinterpret_cast<uintptr_t>(active_weapon) + Offsets::m_nNextPrimaryAttackTick);
float next_attack_ratio = [I]reinterpret_cast<float[/I]>(reinterpret_cast<uintptr_t>(active_weapon) + Offsets::m_flNextPrimaryAttackTickRatio);
float next_attack_time = TICKS_TO_TIME(next_attack_tick) + next_attack_ratio;
bool can_shoot_result = can_shoot();
L_PRINT(LOG_INFO) << "can_shoot() = " << can_shoot_result << ", current_time = " << current_time << ", next_attack_time = " << next_attack_time;
if (current_time >= next_attack_time && can_shoot_result) {
if (should_double_tap && current_tick > shot_tick) {
L_PRINT(LOG_INFO) << "Attempting second shot at tick " << current_tick;
cmd->nButtons.nValue |= IN_ATTACK;
cmd->csgoUserCmd.setAttack1StartHistoryIndex(0);
should_double_tap = false;
last_shot_time = current_time;
for (int i = 0; i < cmd->csgoUserCmd.inputHistoryField.nCurrentSize; i++) {
CCSGOInputHistoryEntryPB* input_history = cmd->GetInputHistoryEntry(i);
if (!input_history) continue;
input_history->setPlayerTickCount(current_tick + 1);
input_history->setPlayerTickFraction(0.f);
}
}
else if (current_time - last_shot_time > 0.1f) {
// Первый выстрел
L_PRINT(LOG_INFO) << "Attempting first shot at tick " << current_tick;
cmd->nButtons.nValue |= IN_ATTACK;
cmd->csgoUserCmd.setAttack1StartHistoryIndex(0);
should_double_tap = true
shot_tick = current_tick;
last_shot_time = current_time;
float dt_offset = 0.15f;
int new_next_attack_tick = TIME_TO_TICKS(current_time + dt_offset);
float new_next_attack_ratio = (current_time + dt_offset) - TICKS_TO_TIME(new_next_attack_tick);
L_PRINT(LOG_INFO) << "Setting next attack: tick = " << new_next_attack_tick << ", ratio = " << new_next_attack_ratio;
[I]reinterpret_cast<int[/I]>(reinterpret_cast<uintptr_t>(active_weapon) + Offsets::m_nNextPrimaryAttackTick) = new_next_attack_tick;
[I]reinterpret_cast<float[/I]>(reinterpret_cast<uintptr_t>(active_weapon) + Offsets::m_flNextPrimaryAttackTickRatio) = new_next_attack_ratio;
for (int i = 0; i < cmd->csgoUserCmd.inputHistoryField.nCurrentSize; i++) {
CCSGOInputHistoryEntryPB* input_history = cmd->GetInputHistoryEntry(i);
if (!input_history) continue;
input_history->setPlayerTickCount(new_next_attack_tick);
input_history->setPlayerTickFraction(new_next_attack_ratio);
}
}
}
else {
L_PRINT(LOG_INFO) << "Cannot shoot yet: current_time = " << current_time << ", next_attack_time = " << next_attack_time;
}
}
но код не ворк, что делать?