[−][src]Function rlbot::init_with_options
pub fn init_with_options(options: InitOptions) -> Result<RLBot, Box<dyn Error>>
Initializes RLBot and returns a ready-to-use RLBot
object.
This function will inject the RLBot core DLL into Rocket League, and then load the interface DLL. It might sleep for some time while it waits for RLBot to fully initialize.
Panics
Only one RLBot instance may be created over the life of the application. If you call this function more than once, it will panic. If you lose the RLBot instance, well, you should keep better track of your things.
Example
let rlbot = rlbot::init()?; rlbot.start_match(&rlbot::MatchSettings::rlbot_vs_allstar("Hero", "Villain"))?; rlbot.wait_for_match_start()?; let mut packets = rlbot.packeteer(); loop { let packet = packets.next()?; let player_index = 0; let input: rlbot::ControllerState = Default::default(); rlbot.update_player_input(player_index, &input)?; }
See examples/simple
for a complete example.