made bot in four hours

can run roll and random
This commit is contained in:
2025-04-19 20:22:08 -04:00
commit a98f2498a3
20 changed files with 3394 additions and 0 deletions

17
src/util/junk.rs Normal file
View File

@@ -0,0 +1,17 @@
use rand::seq::SliceRandom;
pub fn get_random_insult() -> String {
let insults = get_insults();
let result = insults.choose(&mut rand::thread_rng()).unwrap();
result.to_owned().to_string()
}
fn get_insults<'a>() -> Vec<&'a str> {
Vec::from([
"You're the type to use Limit Break on trash mobs.",
"Your DPS is lower than a healer who only casts Medica II.",
"Your glamour looks like you raided a NPC vendor in Limsa Lominsa.",
"I've seen Lalafells with better threat generation than you.",
"Your gear is more broken than the Dragonsong War timeline.",
])
}

3
src/util/mod.rs Normal file
View File

@@ -0,0 +1,3 @@
pub mod junk;
pub mod random;
pub mod validate;

13
src/util/random.rs Normal file
View File

@@ -0,0 +1,13 @@
use rand::rngs::ThreadRng;
pub struct RandomGen {
pub rng: ThreadRng,
}
impl RandomGen {
pub fn new() -> Self {
RandomGen {
rng: rand::thread_rng(),
}
}
}

8
src/util/validate.rs Normal file
View File

@@ -0,0 +1,8 @@
use std::str::FromStr;
pub fn parse_str_into_num<T: FromStr>(input: &str) -> Option<T> {
match input.parse::<T>() {
Ok(n) => Some(n),
Err(_) => None,
}
}