Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0457aed045 | ||
|
|
774606a7b0 | ||
|
|
9bc8ba0dc3 | ||
|
|
dd3a71884c | ||
|
|
4e95706226 | ||
|
|
4add77c4e0 |
Generated
+1
-1
@@ -1332,7 +1332,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gta-tools"
|
name = "gta-tools"
|
||||||
version = "0.1.0"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"catppuccin-egui",
|
"catppuccin-egui",
|
||||||
"eframe",
|
"eframe",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "gta-tools"
|
name = "gta-tools"
|
||||||
version = "0.1.0"
|
version = "0.1.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
more spaghetti than the nation of italy
|
||||||
|
|
||||||
|

|
||||||
@@ -1,8 +1,8 @@
|
|||||||
use crate::gui::App;
|
use crate::{features, gui::App, util::Countdown};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use sysinfo::System;
|
use sysinfo::System;
|
||||||
use windows::Win32::{
|
use windows::Win32::{
|
||||||
Foundation::{HANDLE, NTSTATUS},
|
Foundation::{CloseHandle, HANDLE, NTSTATUS},
|
||||||
System::Threading::{OpenProcess, PROCESS_SUSPEND_RESUME},
|
System::Threading::{OpenProcess, PROCESS_SUSPEND_RESUME},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -13,6 +13,7 @@ const LEGACY: &str = "GTA5.exe";
|
|||||||
pub struct EmptySession {
|
pub struct EmptySession {
|
||||||
pub enabled: bool,
|
pub enabled: bool,
|
||||||
pub interval: Instant,
|
pub interval: Instant,
|
||||||
|
pub countdown: Countdown,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for EmptySession {
|
impl Default for EmptySession {
|
||||||
@@ -20,6 +21,7 @@ impl Default for EmptySession {
|
|||||||
Self {
|
Self {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
interval: Instant::now(),
|
interval: Instant::now(),
|
||||||
|
countdown: Countdown::new(features::empty_session::INTERVAL.as_secs() as usize),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,5 +58,6 @@ pub fn activate(app: &mut App) {
|
|||||||
pub fn deactivate(app: &mut App) {
|
pub fn deactivate(app: &mut App) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let _ = NtResumeProcess(app.game_handle);
|
let _ = NtResumeProcess(app.game_handle);
|
||||||
|
let _ = CloseHandle(app.game_handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ pub fn launch(platform: &Platform) {
|
|||||||
Platform::Rockstar => {
|
Platform::Rockstar => {
|
||||||
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
|
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
|
||||||
let Ok(gta_v_enhanced) =
|
let Ok(gta_v_enhanced) =
|
||||||
hklm.open_subkey(r"SOFTWARE\WOW6432Node\Rockstar Games\GTA V Enhanced")
|
hklm.open_subkey(r"SOFTWARE\WOW6432Node\Rockstar Games\GTAV Enhanced")
|
||||||
else {
|
else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|||||||
+9
-16
@@ -1,12 +1,9 @@
|
|||||||
use crate::{
|
use crate::features::{
|
||||||
features::{
|
self,
|
||||||
self,
|
anti_afk::AntiAfk,
|
||||||
anti_afk::AntiAfk,
|
empty_session::EmptySession,
|
||||||
empty_session::EmptySession,
|
force_close::ForceClose,
|
||||||
force_close::ForceClose,
|
launch::{Launch, Platform},
|
||||||
launch::{Launch, Platform},
|
|
||||||
},
|
|
||||||
util::Countdown,
|
|
||||||
};
|
};
|
||||||
use eframe::egui;
|
use eframe::egui;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
@@ -20,7 +17,6 @@ pub struct App {
|
|||||||
pub launch: Launch,
|
pub launch: Launch,
|
||||||
pub force_close: ForceClose,
|
pub force_close: ForceClose,
|
||||||
pub empty_session: EmptySession,
|
pub empty_session: EmptySession,
|
||||||
pub empty_session_countdown: Countdown,
|
|
||||||
pub anti_afk: AntiAfk,
|
pub anti_afk: AntiAfk,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,9 +28,6 @@ impl Default for App {
|
|||||||
game_handle: HANDLE::default(),
|
game_handle: HANDLE::default(),
|
||||||
launch: Launch::default(),
|
launch: Launch::default(),
|
||||||
force_close: ForceClose::default(),
|
force_close: ForceClose::default(),
|
||||||
empty_session_countdown: Countdown::new(
|
|
||||||
features::empty_session::INTERVAL.as_secs() as usize
|
|
||||||
),
|
|
||||||
empty_session: EmptySession::default(),
|
empty_session: EmptySession::default(),
|
||||||
anti_afk: AntiAfk::default(),
|
anti_afk: AntiAfk::default(),
|
||||||
}
|
}
|
||||||
@@ -107,15 +100,15 @@ impl eframe::App for App {
|
|||||||
features::empty_session::activate(self);
|
features::empty_session::activate(self);
|
||||||
}
|
}
|
||||||
if !self.empty_session.enabled {
|
if !self.empty_session.enabled {
|
||||||
self.empty_session_countdown.count();
|
self.empty_session.countdown.count();
|
||||||
} else {
|
} else {
|
||||||
self.empty_session_countdown.reset();
|
self.empty_session.countdown.reset();
|
||||||
}
|
}
|
||||||
if self.empty_session.interval.elapsed() >= features::empty_session::INTERVAL {
|
if self.empty_session.interval.elapsed() >= features::empty_session::INTERVAL {
|
||||||
features::empty_session::deactivate(self);
|
features::empty_session::deactivate(self);
|
||||||
self.empty_session.enabled = true;
|
self.empty_session.enabled = true;
|
||||||
}
|
}
|
||||||
ui.label(&self.empty_session_countdown.i_string);
|
ui.label(&self.empty_session.countdown.i_string);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
ui.checkbox(&mut self.anti_afk.enabled, "Anti AFK")
|
ui.checkbox(&mut self.anti_afk.enabled, "Anti AFK")
|
||||||
|
|||||||
Reference in New Issue
Block a user