Skip to content

Commit

Permalink
Probably do TouchInjector later, update README, and draft release.
Browse files Browse the repository at this point in the history
  • Loading branch information
callmeclover authored May 16, 2024
1 parent 43e93c4 commit 9f714d9
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 14 deletions.
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,30 @@ i built this to be that though, so...

presses keys and f*cks with your mouse. occasionally talks.

## versions
currently, there are 3 versions (not including crosses of any):

- default (basic movement and window)
- invisibility (no console window)
- advanced (advanced movement feature)

**the `advanced` feature requires administrator privileges. this is why it is seperate from `default`.**

**the `invisibility` feature has no console window, so it cannot be regularly. see [this notice](#other-little-notice) for info on killing a hidden instance.**

i will also not be publishing any invisible builds for jerry beyond [v0.3.4](https://github.com/callmeclover/jerry/releases/tag/v0.3.4). build it yourself with `cargo build --features invisible`.

## little notice
i hold 0 responsibility over what this thing does. you are on your own if he does anything bad.
i, @callmeclover, hold 0 responsibility over what this thing does, [**especially forks**](#on-the-topic-of-forks). you are on your own if he does anything bad.

## other little notice
the invisible version hides the console window, so just kill his process in task manager if he gets out of hand.
the invisible version hides the console window, so you need to kill his process in task manager if he gets out of hand.

he doesn't cloak himself, so his process name is `jerry.exe`.

## on the topic of forks
jerry is, technically, considered malware. as the [wiki page](https://wikipedia.com/wiki/Malware) states, *"[Malware] is any software intentionally designed to cause disruption to a computer, server, client, or computer network,"* which is exactly what jerry does.

i have no intent to cause any amount of harm with this program. this is purely a passion project to learn more rust, and test my coding abilities.

he doesn't cloak himself, so his process name is `jerry.exe`.
when you fork this project, or a fork of this project, you take all responsibility for that fork. i, @callmeclover, hold no responsibility over the actions of forks.
7 changes: 0 additions & 7 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ struct Basic {
#[allow(dead_code)]
use_pen: bool,
#[allow(dead_code)]
use_touch: bool,
#[allow(dead_code)]
do_screenshots: bool,
#[allow(dead_code)]
do_tts: bool,
Expand Down Expand Up @@ -57,8 +55,6 @@ impl Default for Basic {
#[allow(dead_code)]
use_pen: false,
#[allow(dead_code)]
use_touch: false,
#[allow(dead_code)]
do_screenshots: true,
#[allow(dead_code)]
do_tts: true,
Expand Down Expand Up @@ -170,9 +166,6 @@ pub async fn get_options(config: Config) -> Vec<(&'static str, usize)> {
if config.basic.use_pen {
options.push(("pen", 15));
}
if config.basic.use_touch {
options.push(("touch", 10));
}
}

options
Expand Down
46 changes: 45 additions & 1 deletion src/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,51 @@ pub async fn main_logic(options: &[(&str, usize)], tts: &mut Tts, enigo: &mut En
pen.inject();
}

#[cfg(feature = "advanced")]
fn gamepad(gamepad: &mut GamepadInjector, rng: &mut rand::rngs::ThreadRng) {
let lists: Vec<(Vec<(&str, usize)>, usize)> = vec![
(GAMEPAD_BUTTONS.to_vec(), 5),
(GAMEPAD_MOVE.to_vec(), 3),
(GAMEPAD_SPECIAL.to_vec(), 1),
];
let index: WeightedIndex<usize> =
WeightedIndex::new(lists.iter().map(|item: &(Vec<(&str, usize)>, usize)| item.1)).unwrap();
let list: &Vec<(&str, usize)> = &lists[index.sample(rng)].0;
let index2: WeightedIndex<usize> =
WeightedIndex::new(list.iter().map(|item: &(&str, usize)| item.1)).unwrap();
let action = list[index2.sample(rng)].0;
match action {
"LeftThumbstickMove" => {
gamepad.update_left_thumbstick((rng.gen_range(-1.0..=1.0), rng.gen_range(-1.0..=1.0)));
gamepad.inject();
thread::sleep(Duration::from_millis(rng.gen_range(0..=5000)));
gamepad.update_left_thumbstick((0.0,0.0));
}
"RightThumbstickMove" => {
gamepad.update_right_thumbstick((rng.gen_range(-1.0..=1.0), rng.gen_range(-1.0..=1.0)));
gamepad.inject();
thread::sleep(Duration::from_millis(rng.gen_range(0..=5000)));
gamepad.update_right_thumbstick((0.0,0.0));
}
"LeftTrigger" => {
gamepad.update_left_trigger(rng.gen_range(0.0..=1.0));
gamepad.inject();
thread::sleep(Duration::from_millis(rng.gen_range(0..=5000)));
gamepad.update_left_trigger(0.0);
}
"RightTrigger" => {
gamepad.update_right_trigger(rng.gen_range(0.0..=1.0));
gamepad.inject();
thread::sleep(Duration::from_millis(rng.gen_range(0..=5000)));
gamepad.update_right_trigger(0.0);
}
_=>{
gamepad.toggle_button(action);
}
}
gamepad.inject();
}

#[cfg(feature = "advanced")]
pub async fn main_logic_adv(options: &[(&str, usize)], tts: &mut Tts, enigo: &mut Enigo, gamepadobj: &mut GamepadInjector, penobj: &mut PenInjector) {
let mut rng: rand::prelude::ThreadRng = thread_rng();
Expand All @@ -338,7 +383,6 @@ pub async fn main_logic_adv(options: &[(&str, usize)], tts: &mut Tts, enigo: &mu
"keyboard" => keyboard(enigo, &mut rng),
"gamepad" => gamepad(gamepadobj, &mut rng),
"pen" => pen(penobj, &mut rng),
"touch" => todo!(),
"mouse" => mouse(enigo, &mut rng),
"quote" => quote(tts, &mut rng),
"screenshot" => screenshot(tts),
Expand Down
4 changes: 1 addition & 3 deletions src/lists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,4 @@ pub static PEN_SPECIAL: [(&str, usize); 3] = [
("Pressure", 1),
("Tilt", 1),
("Rotation", 1)
];

/* Touch action lists */
];

0 comments on commit 9f714d9

Please sign in to comment.