Skip to content

Commit

Permalink
add some readme notes and os check
Browse files Browse the repository at this point in the history
  • Loading branch information
Eein committed Apr 3, 2023
1 parent af5a43a commit eb6f8e9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
asr = { git = "https://github.com/CryZe/asr", features = ["integer-vars", "signature"] }
asr = { git = "https://github.com/CryZe/asr", features = ["integer-vars", "strings"] }
bitflags = "1.3.2"
bytemuck = "1.12.1"
spinning_top = "0.2.3"
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Octopath Traveler 2 WASM Autosplitter

A Windows and Linux autosplitter for Octopath Traveler 2

(May work on mac if someone asks for it)

# TODO:

## Install
Since this autosplitter is in prerelease, you'll need to download the following file and add an autosplitter component to your splits and add this file. WASM files should not be supported in mainline livesplit.

https://github.com/Eein/octopath-traveler-2-autosplitter-wasm/releases/latest/download/octopath_traveler_2_autosplitter_wasm.wasm

Expand Down
12 changes: 10 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
use spinning_top::{const_spinlock, Spinlock};
use std::collections::HashSet;
use std::fmt::{Display, Formatter, Result};
use std::env;

use bytemuck::Pod;

use asr::{
timer::{self, TimerState},
watcher::Pair,
Address, Process
Address, Process,
get_os
};

// mod data;
Expand Down Expand Up @@ -128,7 +130,13 @@ pub struct Splits(HashSet<String>);
pub extern "C" fn update() {
let mut state = STATE.lock();
if state.game.is_none() {
match Process::attach("Octopath_Traveler2") {
let os = get_os().unwrap();
let process_for_os = match os.as_str() {
"windows" => "Octopath_Traveler2",
"linux" => "Octopath_Travel",
_ => "Octopath_Traveler2"
};
match Process::attach(process_for_os) {
Some(process) => {
match process.get_module_address("Octopath_Traveler2-Win64-Shipping.exe") {
Ok(Address(module)) => {
Expand Down

0 comments on commit eb6f8e9

Please sign in to comment.