Browse Source

gamebridge: multiple commands per line

gamebridge
Cadey Ratio 11 months ago
parent
commit
902c98451b
  1. 2
      gamebridge/src/main.rs
  2. 4
      gamebridge/src/twitch.rs

2
gamebridge/src/main.rs

@ -150,7 +150,7 @@ fn main() -> Result<()> {
lo = lo | LoButtons::C_RIGHT;
}
println!(
debug!(
"[ rust] {:02x}{:02x} {:02x}{:02x}",
hi.bits(),
lo.bits(),

4
gamebridge/src/twitch.rs

@ -82,7 +82,8 @@ async fn run_loop(
let mut data = st.write().unwrap();
const BUTTON_ADD_AMT: i64 = 64;
match chatline.as_str() {
for cmd in chatline.to_string().split(" ").collect::<Vec<&str>>().iter() {
match *cmd {
"a" => data.a_button.add(BUTTON_ADD_AMT),
"b" => data.b_button.add(BUTTON_ADD_AMT),
"z" => data.z_button.add(BUTTON_ADD_AMT),
@ -99,6 +100,7 @@ async fn run_loop(
"stop" => {data.stickx.update(0); data.sticky.update(0);},
_ => {},
}
}
eprintln!("[{}] {}: {}", msg.channel, msg.name, msg.data);
}

Loading…
Cancel
Save