diff --git a/Cargo copy.lock b/Cargo copy.lock new file mode 100644 index 0000000..1f5421e --- /dev/null +++ b/Cargo copy.lock @@ -0,0 +1,412 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bytemuck" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaa3a8d9a1ca92e282c96a32d6511b695d7d994d1d102ba85d279f9b2756947f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "core-foundation" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" +dependencies = [ + "core-foundation-sys 0.6.2", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "core-graphics" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f15b3cb55687886a6b66953123621e5a1529a91a01666d646fb64baa13f900f0" +dependencies = [ + "bitflags", + "core-foundation", + "foreign-types", + "libc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "enigo" +version = "0.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ce8d7672e87b3155fd5e8a9226276da5c833e15bc879c7b98a78f743b67814" +dependencies = [ + "core-graphics", + "libc", + "objc", + "pkg-config", + "unicode-segmentation", + "winapi", +] + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "indoc" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adab1eaa3408fb7f0c777a73e7465fd5656136fc93b670eb6df3c88c2c1344e3" + +[[package]] +name = "libc" +version = "0.2.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "ntapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc51db7b362b205941f71232e56c625156eb9a929f8cf74a428fd5bc094a4afc" +dependencies = [ + "winapi", +] + +[[package]] +name = "num_cpus" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "once_cell" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e060280438193c554f654141c9ea9417886713b7acd75974c85b18a69a88e0b" +dependencies = [ + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "speng-hunter" +version = "1.0.0" +dependencies = [ + "bytemuck", + "enigo", + "indoc", + "rand", + "sysinfo", + "windows", +] + +[[package]] +name = "sysinfo" +version = "0.26.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ddf41e393a9133c81d5f0974195366bd57082deac6e0eb02ed39b8341c2bb6" +dependencies = [ + "cfg-if", + "core-foundation-sys 0.8.3", + "libc", + "ntapi", + "once_cell", + "rayon", + "winapi", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0286ba339aa753e70765d521bb0242cc48e1194562bfa2a2ad7ac8a6de28f5d5" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" diff --git a/goto.se b/goto.se index a4e5e64..953bfd5 100644 --- a/goto.se +++ b/goto.se @@ -1 +1 @@ -Goto { Lat 90 Lon -132.99336 Time 0 } \ No newline at end of file +Goto { Lat 90 Lon -123.57713 Time 0 } \ No newline at end of file diff --git a/goto_closer.se b/goto_closer.se index eadb2d2..142c20f 100644 --- a/goto_closer.se +++ b/goto_closer.se @@ -1 +1 @@ -Goto { DistRad 0.081766434 Time 0 } \ No newline at end of file +Goto { DistRad 0.11712353 Time 0 } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 85da904..bbdf0cf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,8 @@ use { // Earth constants const EARTH_MASS: f32 = 5.9724e+24f32; -const EARTH_EQUAT_RADIUS: f32 = 6378.14f32; +// Good on you, Vladimir! +// const EARTH_EQUAT_RADIUS: f32 = 6378.14f32; const EARTH_MEAN_RADIUS: f32 = 6371.0f32; const EARTH_DENSITY: f32 = 5.51363f32; const EARTH_GRAVITY: f32 = 9.80665f32; @@ -25,15 +26,15 @@ const EARTH_AVG_TEMP: f32 = 288.0f32; // Address to the code of the selected object. // Example: RS 0-3-397-1581-20880-7-556321-30 A3. Go visit it yourself! (: -const SELECTED_OBJECT_CODE: usize = 0x19a9ea0usize; +const SELECTED_OBJECT_CODE: usize = 0x19a9e40usize; // Pointer to the parameters of the selected object. -const SELECTED_OBJECT_POINTER: usize = 0x19a9f20usize; +const SELECTED_OBJECT_POINTER: usize = 0x19a9ec0usize; // Address to the number of Systems found. -const STAR_BROWSER_SYSTEMS_FOUND: usize = 0x1024178usize; +const STAR_BROWSER_SYSTEMS_FOUND: usize = 0x1024118usize; // Address to whether the Star browser is currently searching. -const STAR_BROWSER_SEARCHING: usize = 0x104a1e1usize; +const STAR_BROWSER_SEARCHING: usize = 0x104a181usize; // Address to SE's current GUI scale. -const GUI_SCALE: usize = 0xe69494; +const GUI_SCALE: usize = 0xe69434; // Offsets from SELECTED_OBJECT_POINTER const OBJECT_CLASS: usize = 0x34usize; @@ -48,10 +49,10 @@ const GALAXY_SIZE: usize = 0x20usize; // Coordinates to some GUI elements. // These are always the same whenever ran, despite being initialized at runtime. -const STAR_BROWSER_SEARCH_BUTTON: usize = 0x1025ad8; -const STAR_BROWSER_CLEAR_BUTTON: usize = 0x1025dc0; -const STAR_BROWSER_FILTER_TOGGLE: usize = 0x1029e48; -const STAR_BROWSER_FILTER_SORT: usize = 0x1027ad0; +const STAR_BROWSER_SEARCH_BUTTON: usize = 0x1025a78; +const STAR_BROWSER_CLEAR_BUTTON: usize = 0x1025d60; +const STAR_BROWSER_FILTER_TOGGLE: usize = 0x1029de8; +const STAR_BROWSER_FILTER_SORT: usize = 0x1027a70; // Coordinates offsets const GENERIC_OFFSET: i32 = 0xai32; @@ -75,7 +76,7 @@ fn main() { // Not entirely sure how long we need to sleep for, but we need to give SE time // to update the currently selected object (Or anything else). thread::sleep(Duration::from_millis(160u64)); - + 'inner: loop { // Generate a random galaxy let level = rng.gen_range(1u32..9u32); @@ -188,7 +189,7 @@ fn main() { } // Double-click filter toggle - + enigo.mouse_move_to(filter_toggle.0, filter_toggle.1); for _ in 0u32..=1u32 { @@ -241,7 +242,7 @@ fn main() { * EARTH_GRAVITY; let density = mass * 1.0e-12f32 / (4.0f32 / 3.0f32 * PI * mean_radius.powi(3i32)); - let esc_vel = f32::sqrt(2.0f32 * gravity * equat_radius * 1000.0f32) * 0.001f32; + let esc_vel = f32::sqrt(2.0f32 * gravity * mean_radius * 1000.0f32) * 0.001f32; let n = 1.0f32 / 4.0f32; @@ -249,8 +250,7 @@ fn main() { // enough. let esi = f32::powf( 1.0f32 - - ((equat_radius - EARTH_EQUAT_RADIUS) - / (equat_radius + EARTH_EQUAT_RADIUS)) + - ((mean_radius - EARTH_MEAN_RADIUS) / (mean_radius + EARTH_MEAN_RADIUS)) .abs(), 0.57f32 * n, ) * f32::powf( @@ -286,6 +286,9 @@ fn main() { } enigo.key_click(Key::Layout('h')); + + // Sometimes, SE fails to take a screenshot saying "Please wait...", So we're gonna wait! + thread::sleep(Duration::from_millis(160u64)); } break 'inner;