roblox_bot_file/README.md

47 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2024-12-30 04:46:59 -08:00
Roblox Bhop/Surf Bot File Format
================================
## Example
```rust
2024-12-31 03:59:54 -08:00
use strafesnet_roblox_bot_file::{File,TimedBlockId};
2024-12-30 04:46:59 -08:00
let file=std::fs::File::open("bot_file")?;
let input=std::io::BufReader::new(file);
2024-12-31 03:59:54 -08:00
let mut bot_file=File::new(input)?;
2024-12-31 18:42:02 -08:00
// read the whole file
let block=bot_file.read_all()?;
// or do data streaming block by block
2024-12-31 03:59:54 -08:00
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)?;
2024-12-30 04:46:59 -08:00
// offline blocks include the following event types:
// World, Gravity, Run, Camera, Setting
}
2024-12-31 03:59:54 -08:00
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)?;
2024-12-30 04:46:59 -08:00
// 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>