gamebridge: Twitch Control #2

Merged
cadey merged 29 commits from gamebridge into master 2020-05-11 22:40:05 +00:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 902c98451b - Show all commits

View File

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

View File

@ -82,7 +82,8 @@ async fn run_loop(
let mut data = st.write().unwrap(); let mut data = st.write().unwrap();
const BUTTON_ADD_AMT: i64 = 64; 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), "a" => data.a_button.add(BUTTON_ADD_AMT),
"b" => data.b_button.add(BUTTON_ADD_AMT), "b" => data.b_button.add(BUTTON_ADD_AMT),
"z" => data.z_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);}, "stop" => {data.stickx.update(0); data.sticky.update(0);},
_ => {}, _ => {},
} }
}
eprintln!("[{}] {}: {}", msg.channel, msg.name, msg.data); eprintln!("[{}] {}: {}", msg.channel, msg.name, msg.data);
} }