roblox_bot_file/README.md
2024-12-31 18:42:02 -08:00

47 lines
1.4 KiB
Markdown

Roblox Bhop/Surf Bot File Format
================================
## Example
```rust
use strafesnet_roblox_bot_file::{File,TimedBlockId};
let file=std::fs::File::open("bot_file")?;
let input=std::io::BufReader::new(file);
let mut bot_file=File::new(input)?;
// read the whole file
let block=bot_file.read_all()?;
// or do data streaming block by block
for &TimedBlockId{time,block_id} in &bot_file.header.offline_blocks_timeline{
// header is immutably borrowed
// while data is mutably borrowed
let block_info=bot_file.header.block_info(block_id)?;
let block=bot_file.data.read_block_info(block_info)?;
// offline blocks include the following event types:
// World, Gravity, Run, Camera, Setting
}
for &TimedBlockId{time,block_id} in &bot_file.header.realtime_blocks_timeline{
let block_info=bot_file.header.block_info(block_id)?;
let block=bot_file.data.read_block_info(block_info)?;
// realtime blocks include the following event types:
// Input, Output, Sound
}
```
#### License
<sup>
Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
</sup>
<br>
<sub>
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
</sub>