Skip to content

Commit

Permalink
add public chat of bf2042
Browse files Browse the repository at this point in the history
  • Loading branch information
zefanjajobse committed Jun 6, 2023
1 parent 936db99 commit b6aa5b2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ messages = [
'test2',
'test3',
]
# In which chat it has to send the messages (can be 'Public', 'Team' or 'Squad')
# The 'Public' chat can only be used by the server owner in Battlefield 2042!
# In which chat it has to send the messages (can be 'Announce', 'Public', 'Team' or 'Squad')
# The 'Announce' chat can only be used by the server owner in Battlefield 2042, on older titles it will use public chat when selected.
chat_type = 'Public'
# When it will start sending messages, based on the UTC timezone
message_start_time_utc = '12:00'
Expand Down
11 changes: 10 additions & 1 deletion src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,22 @@ pub fn send_message(
sleep(Duration::from_millis(1808));

match cfg.chat_type {
structs::ChatType::Public => {
structs::ChatType::Announce => {
if game_name == "Battlefield™ 2042" {
bf2042_message_action(current_message);
} else {
message_action(current_message, 0x24);
}
}
structs::ChatType::Public => {
if game_name == "Battlefield™ 2042" {
send_keys::key_enter(0x26, 50);
sleep(Duration::from_secs(1));
message_action(current_message, 0x0F);
} else {
message_action(current_message, 0x24);
}
}
structs::ChatType::Team => message_action(current_message, 0x25),
structs::ChatType::Squad => message_action(current_message, 0x26),
}
Expand Down
1 change: 1 addition & 0 deletions src/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use winapi::shared::windef::HWND__;

#[derive(Serialize, Deserialize, Clone)]
pub enum ChatType {
Announce,
Public,
Team,
Squad,
Expand Down

0 comments on commit b6aa5b2

Please sign in to comment.