procon_bypass_man 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +4 -4
  5. data/docs/getting_started.md +4 -4
  6. data/docs/run_pbm_on_my_branch.md +13 -0
  7. data/docs/setting/splatoon2_macro_dasei_cancel.md +77 -0
  8. data/docs/setting/splatoon2_macro_forward_ikarole.md +2 -33
  9. data/docs/setting/splatoon3_macro_dasei_cancel.md +77 -0
  10. data/docs/setting/splatoon3_macro_forward_ikarole.md +34 -0
  11. data/docs/setting/splatoon3_recommended_setting.md +133 -0
  12. data/docs/upgrade_pbm.md +1 -1
  13. data/lib/procon_bypass_man/background/jobs/base_job.rb +3 -2
  14. data/lib/procon_bypass_man/background/jobs/post_completed_remote_macro_job.rb +4 -0
  15. data/lib/procon_bypass_man/background.rb +0 -1
  16. data/lib/procon_bypass_man/buttons_setting_configuration/layer.rb +1 -1
  17. data/lib/procon_bypass_man/bypass/bypass_command.rb +1 -1
  18. data/lib/procon_bypass_man/plugin/splatoon2/macro/dasei_cancel.rb +21 -0
  19. data/lib/procon_bypass_man/plugin/splatoon3/macro/charge_tansan_bomb.rb +21 -0
  20. data/lib/procon_bypass_man/plugin/splatoon3/macro/dasei_cancel.rb +22 -0
  21. data/lib/procon_bypass_man/plugin/splatoon3/macro/fast_return.rb +21 -0
  22. data/lib/procon_bypass_man/plugin/splatoon3/macro/forward_ikarole.rb +21 -0
  23. data/lib/procon_bypass_man/plugin/splatoon3/macro/jump_to_left_key.rb +21 -0
  24. data/lib/procon_bypass_man/plugin/splatoon3/macro/jump_to_right_key.rb +21 -0
  25. data/lib/procon_bypass_man/plugin/splatoon3/macro/jump_to_up_key.rb +21 -0
  26. data/lib/procon_bypass_man/plugin/splatoon3/macro/sokuwari_for_splash_bomb.rb +27 -0
  27. data/lib/procon_bypass_man/plugin/splatoon3/mode/guruguru.rb +63 -0
  28. data/lib/procon_bypass_man/plugin/splatoon3/version.rb +9 -0
  29. data/lib/procon_bypass_man/plugins.rb +12 -0
  30. data/lib/procon_bypass_man/procon/value_objects/analog_stick.rb +1 -0
  31. data/lib/procon_bypass_man/procon.rb +28 -0
  32. data/lib/procon_bypass_man/support/analog_stick_hypotenuse_tilting_power_scaler.rb +31 -0
  33. data/lib/procon_bypass_man/support/http_client.rb +3 -2
  34. data/lib/procon_bypass_man/support/remote_macro_http_client.rb +4 -0
  35. data/lib/procon_bypass_man/version.rb +1 -1
  36. data/lib/procon_bypass_man/worker.rb +16 -8
  37. data/lib/procon_bypass_man.rb +2 -1
  38. data/project_template/app.rb +2 -2
  39. data/project_template/app.rb.erb +2 -2
  40. data/project_template/lib/app_generator.rb +5 -1
  41. metadata +19 -3
  42. data/lib/procon_bypass_man/background/job_performer.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d7e6a739dbaf4be4022b97c591828d5ccca8d947c0c3bc0a0a8ffa8097a2b95
4
- data.tar.gz: f7ad824a4e34d051c3f3514d18f6c6ab4b3e23b0cf6d9c574af1038afe9118b0
3
+ metadata.gz: b58b7076f8ae670534f5de02a4d4f08ce85b0e8f32942146c156cbd86e0f6c9f
4
+ data.tar.gz: 47a0d06e49d43c5d9add37212b63a14dcf28016738a34219b6b33534e71bb0af
5
5
  SHA512:
6
- metadata.gz: 5ab67436d5d4dbca83ec68d42b0621d6737370388e10d5d86738914506dd6261aa6f495b7074f36ec685d1392b433ec1d7070f9417c2dfe4e7927b6840829633
7
- data.tar.gz: 4c0034304beda74a99126b4dfd1cd35b2f0ac00b78c200dea9f6bfd64a19b0c39407a4e24afcd0914764e9899058a328e4a1c18130efc83421eb7202b2543e1c
6
+ metadata.gz: 7007fe181dffb3d6357d73e1b5f8880647d92e54216ca65d24573c9cadde2bd40bfed977ec5cff8344570d468298b196becd8d7ed36d1ecac9fa54d8250817a4
7
+ data.tar.gz: 490791b8522adc71b10354dc4628bc8e51988ef04e11e82dd9b5ed2a40112dc71e6bc93f9fb9116efd03a3ba1dbb16a67b05ce6e466ef8be26ae27021cd51eba
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [0.3.3] - 2022-11-13
2
+ * 以前に削除した「スプラ用マクロ、惰性キャンセル」を使えるようにしました
3
+ * docs/setting/splatoon2_macro_dasei_cancel.md, docs/setting/splatoon3_macro_dasei_cancel.md を参照してください
4
+
5
+ ## [0.3.2] - 2022-10-13
6
+ * スプラトゥーン3に対応したプラグインを追加しました
7
+ * 詳しい設定方法については docs/setting/splatoon3_recommended_setting.md を参照してください
8
+ * 自動ドット打ちが稀に途中で止まってしまうのを修正しました
9
+
1
10
  ## [0.3.1] - 2022-10-07
2
11
  * レイヤーを変更しているときにコントローラーを振動できるようになりました
3
12
  * setting.yml で `enable(:rumble_on_layer_change)` と記述してください
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- procon_bypass_man (0.3.1)
4
+ procon_bypass_man (0.3.3)
5
5
  action_cable_client
6
6
  blue_green_process
7
7
  pbmenv (>= 0.1.9)
data/README.md CHANGED
@@ -5,8 +5,7 @@
5
5
 
6
6
  * Nintendo Switch Proコントローラーを連射機などにするRaspberry Pi上で動かすコンバータです
7
7
  * ドキュメントは [getting_started.md](docs/getting_started.md) にまとめています
8
- * https://pbm-cloud.herokuapp.com を使うと、webだけで運用が可能です
9
-
8
+ * https://pbm-cloud.jiikko.com を使うと、webだけで運用が可能です
10
9
 
11
10
  <img width="880" alt="スクリーンショット 2022-04-02 9 10 38" src="https://user-images.githubusercontent.com/1664497/161356057-71e4bc2a-0217-4434-9bf1-0002b9fb261a.png">
12
11
 
@@ -24,6 +23,7 @@ https://user-images.githubusercontent.com/1664497/171327108-f12f56a5-fc36-48da-9
24
23
 
25
24
  ## プラグイン
26
25
  * https://github.com/splaplapla/procon_bypass_man-splatoon2
26
+ * [スプラトゥーン3](docs/setting/splatoon3_recommended_setting.md)
27
27
 
28
28
  ## FAQ
29
29
  * どうやって動かすの?
@@ -46,7 +46,7 @@ https://user-images.githubusercontent.com/1664497/171327108-f12f56a5-fc36-48da-9
46
46
  * 市販されているサードパーティ製連射機との違いは?
47
47
  * サードパーティ製のコントローラーは、設定方法や形状が特殊で買い換えるたびに学習・設定コストが発生します。本ツールを使えば、設定内容はテキストで管理することができ、使い慣れたプロコンで同等のことができます
48
48
  * sshなしで運用は可能ですか?
49
- * https://pbm-cloud.herokuapp.com を使えば、sshを使わずに運用が可能です
49
+ * https://pbm-cloud.jiikko.com を使えば、sshを使わずに運用が可能です
50
50
 
51
51
  ## 仕様・制約
52
52
  * 日を跨ぐ24時ちょうどになった瞬間はLinuxのcronが起動などがするようで、この時間は数秒間バイパスが激しく遅延します
@@ -82,7 +82,7 @@ sudo kill -USR2 `cat ./pbm_pid`
82
82
 
83
83
  ## Raspberry Pi4のセットアップを代行します
84
84
  * Raspberry Pi4を開発者である私の家に配送してくれれば、セットアップを代行します。セットアップが終わり次第送り返します
85
- * 使い方に関しては、https://pbm-cloud.herokuapp.com ですべて完結するので、Linuxの知識は不要です
85
+ * 使い方に関しては、https://pbm-cloud.jiikko.com ですべて完結するので、Linuxの知識は不要です
86
86
  * 何か問題が起きた時はリモートログインでサポート可能です
87
87
  * 希望者はDiscordの `kawagu#7684` にDMを送ってください
88
88
  * お金はかかりません
@@ -48,7 +48,7 @@
48
48
 
49
49
  ## セットアップを代行できます
50
50
  * Raspberry Pi4を開発者である私の家に配送してくれれば、セットアップを代行します。セットアップが終わり次第送り返します
51
- * 使い方に関しては、https://pbm-cloud.herokuapp.com ですべて完結するので、Linuxの知識は不要です
51
+ * 使い方に関しては、https://pbm-cloud.jiikko.com ですべて完結するので、Linuxの知識は不要です
52
52
  * 何か問題が起きた時はリモートログインでサポート可能です
53
53
  * 希望者はDiscordの `kawagu#7684` にDMを送ってください
54
54
  * お金はかかりません
@@ -60,7 +60,7 @@
60
60
 
61
61
  ### procon_bypass_manのインストール
62
62
 
63
- pbmenvを使うと https://pbm-cloud.herokuapp.com と連携ができるのでおすすめですが、pbmenvを使わなくてもprocon_bypass_manをインストールすることは可能です。
63
+ pbmenvを使うと https://pbm-cloud.jiikko.com と連携ができるのでおすすめですが、pbmenvを使わなくてもprocon_bypass_manをインストールすることは可能です。
64
64
  次の4つからインストール方法を1つ選んでください。
65
65
 
66
66
  * pbmenvを使う方法
@@ -239,13 +239,13 @@ discordで質問してみてください。
239
239
  [procon_bypass_manのアップグレード方法](/docs/upgrade_pbm.md)
240
240
 
241
241
  ## procon_bypass_man_cloudについて
242
- https://pbm-cloud.herokuapp.com/
242
+ https://pbm-cloud.jiikko.com/
243
243
  procon_bypass_man_cloudの運用をWEBで完結できるようになる無料のWEBサービスです。
244
244
 
245
245
  procon_bypass_man_cloudとの接続が完了後、Raspberry Piを起動時にprocon_bypass_manが自動で立ち上がるように設定すれば、Raspberry Piへのログインが不要で設定ファイルの変更やprocon_bypass_man自体のアップグレードができます。
246
246
  セットアップ方法などでわからないことがあればdiscordで質問してみてください。
247
247
 
248
- セットアップ方法は https://pbm-cloud.herokuapp.com/faq に書いています。
248
+ セットアップ方法は https://pbm-cloud.jiikko.com/faq に書いています。
249
249
 
250
250
  ## 最適化について
251
251
  本稿では、Rubyの最適化について書きます。上級者向けです。適用しなくても普通に動きますが、逆に適用したことで何らかのケースで遅くなる場合があるかもしれません。
@@ -0,0 +1,13 @@
1
+ # forkしたリポジトリのPBMを動かす方法
2
+
3
+ forkしたリポジトリのPBMを動かす場合には、`app.rb` にある `gem 'procon_bypass_man'` を次のように変更する必要があります。
4
+
5
+ ```diff
6
+ - gem 'procon_bypass_man', '0.3.2'
7
+ + gem 'procon_bypass_man', github: 'splaplapla/procon_bypass_man', branch: "dev"
8
+ ```
9
+
10
+ `github: xxx/procon_bypass_man', branch: "xxx"` の部分にあなたのリポジトリとブランチ名を入力してください。
11
+ 変更する行はここだけです。
12
+
13
+ あとは通常通りに起動してください。
@@ -0,0 +1,77 @@
1
+ # スプラトゥーン2: 惰性キャンセル マクロの設定方法
2
+
3
+ * 本マクロは実験段階で、オプション名などの仕様が変更される可能性が高いです
4
+ * procon_bypass_man: 0.3.3以上が必要です
5
+
6
+ ## 1. install_macro_pluginでマクロを有効化します
7
+ * `setting.yml` に`install_macro_plugin ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel` と書きます
8
+ * これを記述することで、layer内でmacroを呼び出せるようになります
9
+
10
+ ```ruby
11
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel
12
+ ```
13
+
14
+ ## 2. どのlayerで発動するかを宣言します
15
+ * `setting.yml` のlayer内に`macro ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel, if_pressed: [:zl]` と書きます
16
+ * `if_pressed` がどのボタンを押したときにこのマクロが発動するかの設定です
17
+ * 惰性キャンセルなのでイカ状態になるためにzlを押します
18
+ * `if_tilted_left_stick` がスティックを倒した時に発動するオプションで、trueを渡すと有効になります
19
+ * また、傾けた時の閾値を変更することができて、trueの代わりに `{ threshold: 500 }` と書くことができます
20
+ * デフォルトが500で、ここの数値を上げると、スティックを倒した判定がより厳しくなります。最大1400くらいです。
21
+ * 連打中に、マクロの発動を無効にしたい場合は `disable_macro` で無効にできます
22
+
23
+ ```ruby
24
+ layer :up do
25
+ macro ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel, if_tilted_left_stick: true, if_pressed: [:zl]
26
+ end
27
+ ```
28
+ ```ruby
29
+ layer :up do
30
+ macro ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel, if_tilted_left_stick: { threshold: 500 }, if_pressed: [:zl]
31
+ end
32
+ ```
33
+ ```ruby
34
+ layer :up do
35
+ disable_macro :all, if_pressed: :a
36
+ disable_macro :all, if_pressed: :zr
37
+ macro ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel, if_tilted_left_stick: true, if_pressed: [:zl]
38
+ end
39
+ ```
40
+
41
+ ## 3. 設定を反映させる
42
+ * 上記の記述を加えたsetting.ymlを起動中のprocon_bypass_manプロセスで読み込むには、プロセスにその旨を伝える必要があります
43
+ * ラズベリーパイを再起動して、プロセスを立ち上げ直す、でも目的は達成できますが、もっと簡単にsetting.ymlを再読み込みする必要があります
44
+ * 書き換えたsetting.ymlを、起動中のprocon_bypass_manプロセスへ即時反映するには、procon_bypass_manプロセスを動かしたまま、別のshellから 以下をを実行してください
45
+ * setting.ymlのシンタックスが正しければ、switchとの接続が継続したままsetting.ymlの内容を読み込んでいるはずです
46
+
47
+ ```shell
48
+ sudo kill -USR2 `cat ./pbm_pid`
49
+ ```
50
+
51
+ ## 設定例1
52
+ ```yaml
53
+ version: 1.0
54
+ setting: |-
55
+ prefix_keys_for_changing_layer [:zr, :zl, :l]
56
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel
57
+
58
+ layer :up do
59
+ disable_macro :all, if_pressed: :a
60
+ disable_macro :all, if_pressed: :zr
61
+ macro ProconBypassMan::Plugin::Splatoon2::Macro::DaseiCancel, if_tilted_left_stick: true, if_pressed: [:zl]
62
+ end
63
+ ```
64
+
65
+ ## 設定例2
66
+ * `open_macro` キーワードを使っても同じことが実行可能です。
67
+ * この場合は、 `install_macro_plugin` が不要です。
68
+
69
+ ```yaml
70
+ version: 1.0
71
+ setting: |-
72
+ prefix_keys_for_changing_layer [:zr, :zl, :l]
73
+
74
+ layer :up do
75
+ open_macro :dacan, steps: [:pressing_r_for_0_03sec, :pressing_r_and_pressing_zl_for_0_2sec], if_tilted_left_stick: true, if_pressed: [:zl]
76
+ end
77
+ ```
@@ -1,34 +1,3 @@
1
- # スプラトゥーン2: イカロール マクロの設定方法
1
+ # スプラトゥーン3: イカロール マクロの設定方法
2
2
 
3
- * procon_bypass_man: 0.3.1以上が必要です
4
- * このマクロは、右から上へ高速にスティックを入れることでイカロールを行います
5
- * 後述する設定例では、左スティックを押し込むことでイカロールを発動してます
6
-
7
- https://user-images.githubusercontent.com/1664497/193837089-1c56af8d-2c1b-436a-b2a7-89c083a408d7.mov
8
-
9
-
10
- ## 設定例1
11
- ```yaml
12
- version: 1.0
13
- setting: |-
14
- prefix_keys_for_changing_layer [:zr, :zl, :l]
15
-
16
- layer :up do
17
- open_macro :forward_ikarole, steps: [:forward_ikarole1], if_pressed: [:thumbl], force_neutral: []
18
- end
19
- ```
20
-
21
- ## 設定例2
22
- pluginとして登録してあるので、 `macro` を使っても同じことができます。
23
-
24
- ```yaml
25
- version: 1.0
26
- setting: |-
27
- prefix_keys_for_changing_layer [:zr, :zl, :l]
28
-
29
- install_macro_plugin(ProconBypassMan::Plugin::Splatoon2::Macro::ForwardIkarole)
30
-
31
- layer :up do
32
- macro ProconBypassMan::Plugin::Splatoon2::Macro::ForwardIkarole, if_pressed: [:thumbl], force_neutral: []
33
- end
34
- ```
3
+ [スプラトゥーン3: イカロール マクロの設定方法](splatoon3_macro_forward_ikarole.md)
@@ -0,0 +1,77 @@
1
+ # スプラトゥーン3: 惰性キャンセル マクロの設定方法
2
+
3
+ * 本マクロは実験段階で、オプション名などの仕様が変更される可能性が高いです
4
+ * procon_bypass_man: 0.3.3以上が必要です
5
+
6
+ ## 1. install_macro_pluginでマクロを有効化します
7
+ * `setting.yml` に`install_macro_plugin ProconBypassMan::Plugin::Splatoon3::Macro::DaseiCancel` と書きます
8
+ * これを記述することで、layer内でmacroを呼び出せるようになります
9
+
10
+ ```ruby
11
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon3::Macro::DaseiCancel
12
+ ```
13
+
14
+ ## 2. どのlayerで発動するかを宣言します
15
+ * `setting.yml` のlayer内に`macro ProconBypassMan::Plugin::Splatoon3::Macro::DaseiCancel, if_pressed: [:zl]` と書きます
16
+ * `if_pressed` がどのボタンを押したときにこのマクロが発動するかの設定です
17
+ * 惰性キャンセルなのでイカ状態になるためにzlを押します
18
+ * `if_tilted_left_stick` がスティックを倒した時に発動するオプションで、trueを渡すと有効になります
19
+ * また、傾けた時の閾値を変更することができて、trueの代わりに `{ threshold: 500 }` と書くことができます
20
+ * デフォルトが500で、ここの数値を上げると、スティックを倒した判定がより厳しくなります。最大1400くらいです。
21
+ * 連打中に、マクロの発動を無効にしたい場合は `disable_macro` で無効にできます
22
+
23
+ ```ruby
24
+ layer :up do
25
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::DaseiCancel, if_tilted_left_stick: true, if_pressed: [:zl]
26
+ end
27
+ ```
28
+ ```ruby
29
+ layer :up do
30
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::DaseiCancel, if_tilted_left_stick: { threshold: 500 }, if_pressed: [:zl]
31
+ end
32
+ ```
33
+ ```ruby
34
+ layer :up do
35
+ disable_macro :all, if_pressed: :a
36
+ disable_macro :all, if_pressed: :zr
37
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::DaseiCancel, if_tilted_left_stick: true, if_pressed: [:zl]
38
+ end
39
+ ```
40
+
41
+ ## 3. 設定を反映させる
42
+ * 上記の記述を加えたsetting.ymlを起動中のprocon_bypass_manプロセスで読み込むには、プロセスにその旨を伝える必要があります
43
+ * ラズベリーパイを再起動して、プロセスを立ち上げ直す、でも目的は達成できますが、もっと簡単にsetting.ymlを再読み込みする必要があります
44
+ * 書き換えたsetting.ymlを、起動中のprocon_bypass_manプロセスへ即時反映するには、procon_bypass_manプロセスを動かしたまま、別のshellから 以下をを実行してください
45
+ * setting.ymlのシンタックスが正しければ、switchとの接続が継続したままsetting.ymlの内容を読み込んでいるはずです
46
+
47
+ ```shell
48
+ sudo kill -USR2 `cat ./pbm_pid`
49
+ ```
50
+
51
+ ## 設定例1
52
+ ```yaml
53
+ version: 1.0
54
+ setting: |-
55
+ prefix_keys_for_changing_layer [:zr, :zl, :l]
56
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon3::Macro::DaseiCancel
57
+
58
+ layer :up do
59
+ disable_macro :all, if_pressed: :a
60
+ disable_macro :all, if_pressed: :zr
61
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::DaseiCancel, if_tilted_left_stick: true, if_pressed: [:zl]
62
+ end
63
+ ```
64
+
65
+ ## 設定例2
66
+ * `open_macro` キーワードを使っても同じことが実行可能です。
67
+ * この場合は、 `install_macro_plugin` が不要です。
68
+
69
+ ```yaml
70
+ version: 1.0
71
+ setting: |-
72
+ prefix_keys_for_changing_layer [:zr, :zl, :l]
73
+
74
+ layer :up do
75
+ open_macro :dacan, steps: [:pressing_r_for_0_03sec, :pressing_r_and_pressing_zl_for_0_2sec], if_tilted_left_stick: true, if_pressed: [:zl]
76
+ end
77
+ ```
@@ -0,0 +1,34 @@
1
+ # スプラトゥーン3: イカロール マクロの設定方法
2
+
3
+ * procon_bypass_man: 0.3.1以上が必要です
4
+ * このマクロは、右から上へ高速にスティックを入れることでイカロールを行います
5
+ * 後述する設定例では、左スティックを押し込むことでイカロールを発動してます
6
+
7
+ https://user-images.githubusercontent.com/1664497/193837089-1c56af8d-2c1b-436a-b2a7-89c083a408d7.mov
8
+
9
+
10
+ ## 設定例1
11
+ ```yaml
12
+ version: 1.0
13
+ setting: |-
14
+ prefix_keys_for_changing_layer [:zr, :zl, :l]
15
+
16
+ layer :up do
17
+ open_macro :forward_ikarole, steps: [:forward_ikarole1], if_pressed: [:thumbl], force_neutral: []
18
+ end
19
+ ```
20
+
21
+ ## 設定例2
22
+ pluginとして登録してあるので、 `macro` を使っても同じことができます。
23
+
24
+ ```yaml
25
+ version: 1.0
26
+ setting: |-
27
+ prefix_keys_for_changing_layer [:zr, :zl, :l]
28
+
29
+ install_macro_plugin(ProconBypassMan::Plugin::Splatoon2::Macro::ForwardIkarole)
30
+
31
+ layer :up do
32
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::ForwardIkarole, if_pressed: [:thumbl], force_neutral: []
33
+ end
34
+ ```
@@ -0,0 +1,133 @@
1
+ # スプラトゥーン3: おすすめの設定
2
+ ## 1 全般
3
+ ### 1.1 デスしてから最速スパジャンのためのAボタン連打
4
+
5
+ `flip :a, if_pressed: [:a]`
6
+ Aボタンを連打にします。復帰してから最速で前線復帰ができます
7
+
8
+ ### 1.2 簡単スニーキング
9
+
10
+ ボタンを押している間は、水飛沫のたたないスニーキングの感度まで調整することができます。
11
+ [設定方法](/docs/setting/left-analogstick-cap.md)
12
+
13
+ ### 1.3 ナイス玉連打
14
+
15
+ `flip :down, if_pressed: :down`
16
+ 十字キーの下ボタンは常に連打にしておくとナイス玉が来たときに楽です。
17
+
18
+ ### 1.4 最速スーパージャンプ
19
+ マップを開かずにジャンプができます。トリガーは自由に設定できます。
20
+
21
+ ```ruby
22
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon3::Macro::FastReturn
23
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon3::Macro::JumpToUpKey
24
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon3::Macro::JumpToRightKey
25
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon3::Macro::JumpToLeftKey
26
+
27
+ layer :up do
28
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::FastReturn, if_pressed: [:y, :b, :down]
29
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::JumpToUpKey, if_pressed: [:y, :b, :up]
30
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::JumpToRightKey, if_pressed: [:y, :b, :right]
31
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::JumpToLeftKey, if_pressed: [:y, :b, :left]
32
+ end
33
+ ```
34
+
35
+ ### 1.5 イカロール
36
+ * このマクロは、右から上へ高速にスティックを入れることでイカロールを行います
37
+ * 後述の設定例では、左スティックを押し込むことでイカロールを発動してます
38
+
39
+ ```ruby
40
+ layer :up do
41
+ open_macro :forward_ikarole, steps: [:forward_ikarole1], if_pressed: [:thumbl], force_neutral: []
42
+ end
43
+ ```
44
+
45
+ ## 2 武器に特化した設定
46
+ ### 2.1 パブロ、ボトルガイザー向け
47
+
48
+ `flip :zr, if_pressed: :zr, force_neutral: :zl`
49
+ zrを連打にします。`force_neutral: :zl` というオプションをつけることで、ZRを押している間はZLを押しても無視されるようになります。パブロでは意味がありませんが、シューターだと煽りのような動作を抑制することができます。
50
+
51
+ ## 3 設定例
52
+ ### 3.1 シンプルなパブロ向け
53
+
54
+ * ZRボタン, ZLボタン, Lボタンを同時押しながら十字キーを押すとレイヤーを切り替える
55
+ * ナイス玉が来たときにゲージを貯めるために十字キーの下を連打
56
+ * 復帰から最速ジャンプのためにAボタンを連打
57
+ * 筆を振るためにZRボタンを連打
58
+ * 筆ダッシュをするためにLボタンをZRボタンに変更
59
+ * イカロール
60
+
61
+ ```yaml
62
+ version: 1.0
63
+ setting: |-
64
+ prefix_keys_for_changing_layer [:zr, :zl, :l]
65
+
66
+ layer :up do
67
+ flip :zr, if_pressed: :zr, force_neutral: :zl
68
+ flip :a, if_pressed: [:a]
69
+ flip :down, if_pressed: :down
70
+ remap :l, to: :zr
71
+ open_macro :forward_ikarole, steps: [:forward_ikarole1], if_pressed: [:thumbl], force_neutral: []
72
+ end
73
+
74
+ layer :right do
75
+ end
76
+
77
+ layer :left do
78
+ end
79
+
80
+ layer :down do
81
+ end
82
+ ```
83
+
84
+ ### 3.2 全部盛り
85
+
86
+ * ZRボタン, ZLボタン, Lボタンを同時押しながら十字キーを押すとレイヤーを切り替える
87
+ * ナイス玉が来たときにゲージを貯めるために十字キーの下を連打
88
+ * 筆を振るためにZRボタンを連打
89
+ * 復帰から最速ジャンプのためにAボタンを連打
90
+ * YボタンとBボタンと十字キーの上を同時に押したときに、マップ開いた時の↑に設定されている味方にスーパージャンプ
91
+ * YボタンとBボタンと十字キーの左を同時に押したときに、マップ開いた時の←に設定されている味方にスーパージャンプ
92
+ * YボタンとBボタンと十字キーの右を同時に押したときに、マップ開いた時の→に設定されている味方にスーパージャンプ
93
+ * YボタンとBボタンと十字キーの下を同時に押したときに、リスポーンにスーパージャンプ
94
+ * 筆ダッシュをするためにLボタンをZRボタンに変更
95
+ * ZLボタンとAボタンを同時に押したときに移動するとスニーキング
96
+ * イカロール
97
+
98
+ ```yaml
99
+ version: 1.0
100
+ setting: |-
101
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon3::Macro::FastReturn
102
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon3::Macro::JumpToUpKey
103
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon3::Macro::JumpToRightKey
104
+ install_macro_plugin ProconBypassMan::Plugin::Splatoon3::Macro::JumpToLeftKey
105
+
106
+ prefix_keys_for_changing_layer [:zr, :zl, :l]
107
+ set_neutral_position 2100, 2000
108
+
109
+ layer :up do
110
+ flip :zr, if_pressed: :zr, force_neutral: :zl
111
+ flip :a, if_pressed: [:a]
112
+ flip :down, if_pressed: :down
113
+
114
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::FastReturn, if_pressed: [:y, :b, :down]
115
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::JumpToUpKey, if_pressed: [:y, :b, :up]
116
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::JumpToRightKey, if_pressed: [:y, :b, :right]
117
+ macro ProconBypassMan::Plugin::Splatoon3::Macro::JumpToLeftKey, if_pressed: [:y, :b, :left]
118
+
119
+ remap :l, to: :zr
120
+ left_analog_stick_cap cap: 1100, if_pressed: [:zl, :a], force_neutral: :a
121
+
122
+ open_macro :forward_ikarole, steps: [:forward_ikarole1], if_pressed: [:thumbl], force_neutral: []
123
+ end
124
+
125
+ layer :right do
126
+ end
127
+
128
+ layer :left do
129
+ end
130
+
131
+ layer :down do
132
+ end
133
+ ```
data/docs/upgrade_pbm.md CHANGED
@@ -2,7 +2,7 @@
2
2
  * pbm-cloudを使う方法、pbmenvを使う方法、pbmenvを使わない方法があります
3
3
 
4
4
  ## pbm-cloudを使う方法
5
- * https://pbm-cloud.herokuapp.com からデバイス詳細画面を開いてください
5
+ * https://pbm-cloud.jiikko.com からデバイス詳細画面を開いてください
6
6
  * `デバイスの設定` => `PBMのバージョンアップ`を選択して、表示されるモーダルからインストールしたいバージョンを選択し、 `このバージョンでバージョンアップする` をクリックしてください
7
7
  * クリックするとRaspberry Piが再起動するのでしばらく待ってください
8
8
  * 設定ファイルが初期状態に戻っているので適宜復元してください
@@ -1,7 +1,8 @@
1
1
  class ProconBypassMan::BaseJob
2
2
  extend ProconBypassMan::Background::JobPerformable
3
3
 
4
- def self.servers
5
- raise NotImplementedError
4
+ # @return [Boolean]
5
+ def self.re_enqueue_if_failed
6
+ false
6
7
  end
7
8
  end
@@ -13,5 +13,9 @@ class ProconBypassMan::PostCompletedRemoteMacroJob < ProconBypassMan::BaseJob
13
13
  device_id = ProconBypassMan.device_id
14
14
  "/api/devices/#{ProconBypassMan.device_id}/completed_pbm_remote_macro_jobs"
15
15
  end
16
+
17
+ def self.re_enqueue_if_failed
18
+ true
19
+ end
16
20
  end
17
21
 
@@ -1,7 +1,6 @@
1
1
  require "procon_bypass_man/background/jobs/concerns/has_external_api_setting"
2
2
  require "procon_bypass_man/background/jobs/concerns/job_performable"
3
3
  require "procon_bypass_man/background/job_queue"
4
- require "procon_bypass_man/background/job_performer"
5
4
  require "procon_bypass_man/background/jobs/base_job"
6
5
  require "procon_bypass_man/background/jobs/report_event_base_job"
7
6
  require "procon_bypass_man/background/jobs/report_boot_job"
@@ -53,7 +53,7 @@ module ProconBypassMan
53
53
  end
54
54
 
55
55
  # @param [String, Class] プラグインのclass
56
- # @param [Hash, NilClass] if_tilted_left_stick 非推奨
56
+ # @param [Hash, NilClass] if_tilted_left_stick
57
57
  def macro(name, if_pressed: nil, if_tilted_left_stick: nil, force_neutral: nil)
58
58
  case if_tilted_left_stick
59
59
  when Integer, String, Symbol, Array
@@ -53,7 +53,7 @@ class ProconBypassMan::BypassCommand
53
53
  # シビア
54
54
  t2 = Thread.new do
55
55
  bypass = ProconBypassMan::Bypass::ProconToSwitch.new(gadget: @gadget, procon: @procon)
56
- process = BlueGreenProcess.new(worker_instance: bypass, max_work: 200)
56
+ process = BlueGreenProcess.new(worker_instance: bypass, max_work: 550)
57
57
  loop do
58
58
  if $will_terminate_token
59
59
  if $will_terminate_token == WILL_TERMINATE_TOKEN::TERMINATE
@@ -0,0 +1,21 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon2
4
+ module Macro
5
+ module DaseiCancel
6
+ def self.display_name
7
+ :dasei_cancel
8
+ end
9
+
10
+ def self.steps
11
+ [:pressing_r_for_0_03sec, :pressing_r_and_pressing_zl_for_0_2sec].freeze
12
+ end
13
+
14
+ def self.description
15
+ '惰性キャンセル'
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon3
4
+ module Macro
5
+ module ChargeTansanBomb
6
+ def self.display_name
7
+ :charge_tansan_bomb
8
+ end
9
+
10
+ def self.steps
11
+ [:shake_left_stick_and_toggle_b_for_0_1sec].freeze
12
+ end
13
+
14
+ def self.description
15
+ 'タンサンボムのチャージ'
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,22 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon3
4
+ module Macro
5
+ module DaseiCancel
6
+ def self.display_name
7
+ :dasei_cancel
8
+ end
9
+
10
+ def self.steps
11
+ [:pressing_r_for_0_03sec, :pressing_r_and_pressing_zl_for_0_2sec].freeze
12
+ end
13
+
14
+ def self.descrition
15
+ '惰性キャンセル'
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+
@@ -0,0 +1,21 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon3
4
+ module Macro
5
+ module FastReturn
6
+ def self.display_name
7
+ :fast_return
8
+ end
9
+
10
+ def self.steps
11
+ [:x, :x, :x, :down, :down, :down, :down, :down, :toggle_a_for_0_1sec, :wait_for_0_5sec]
12
+ end
13
+
14
+ def self.description
15
+ '試合中にリスポーンにスーパージャンプ'
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon3
4
+ module Macro
5
+ module ForwardIkarole
6
+ def self.display_name
7
+ :forward_ikarole
8
+ end
9
+
10
+ def self.steps
11
+ [:forward_ikarole1].freeze
12
+ end
13
+
14
+ def self.description
15
+ '前方にイカロールをします'
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon3
4
+ module Macro
5
+ module JumpToLeftKey
6
+ def self.display_name
7
+ :jump_to_left_key
8
+ end
9
+
10
+ def self.steps
11
+ [:x, :x, :x, :left, :left, :left, :left, :left, :toggle_a_for_0_1sec, :wait_for_0_5sec]
12
+ end
13
+
14
+ def self.description
15
+ '試合中に左キーに割り当てられている味方へのスーパージャンプ'
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon3
4
+ module Macro
5
+ module JumpToRightKey
6
+ def self.display_name
7
+ :jump_to_right_key
8
+ end
9
+
10
+ def self.steps
11
+ [:x, :x, :x, :right, :right, :right, :right, :right, :toggle_a_for_0_1sec, :wait_for_0_5sec]
12
+ end
13
+
14
+ def self.description
15
+ '試合中に右キーに割り当てられている味方へのスーパージャンプ'
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon3
4
+ module Macro
5
+ module JumpToUpKey
6
+ def self.display_name
7
+ :jump_to_up_key
8
+ end
9
+
10
+ def self.steps
11
+ [:x, :x, :x, :up, :up, :up, :up, :up, :toggle_a_for_0_1sec, :wait_for_0_5sec]
12
+ end
13
+
14
+ def self.description
15
+ '試合中に上キーに割り当てられている味方へのスーパージャンプ'
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,27 @@
1
+ # 3にはないので削除予定
2
+ module ProconBypassMan
3
+ module Plugin
4
+ module Splatoon3
5
+ module Macro
6
+ module SokuwariForSplashBomb
7
+ def self.display_name
8
+ :sokuwari_for_splash_bomb
9
+ end
10
+
11
+ # procon_bypass_man: 0.1.18以上が必要
12
+ def self.steps
13
+ [ :toggle_r_for_0_2sec,
14
+ :toggle_thumbr_for_0_14sec,
15
+ :toggle_thumbr_and_toggle_zr_for_0_34sec,
16
+ :toggle_r_for_1sec,
17
+ ].freeze
18
+ end
19
+
20
+ def self.description
21
+ 'バブル即割'
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,63 @@
1
+ module ProconBypassMan
2
+ module Plugin
3
+ module Splatoon3
4
+ module Mode
5
+ module Guruguru
6
+ def self.description
7
+ '適当に動きます'
8
+ end
9
+
10
+ def self.binaries
11
+ [ "309481408000362d684658750968f71cfe2c0e51000001480053f71ffedf0d4b000a013d00caf6ecfd4c0d480003011c00000000000000000000000000000000",
12
+ "30978140800037dd6748687509fdf6adfded0d6d0081005d00eef68dfdef0d6d00830059001bf791fd140e720090005400000000000000000000000000000000",
13
+ "309a8140800038cd67495875099af821fe120e40006400880042f8fcfdfd0d470067008900d4f7e0fdf20d4e006a008c00000000000000000000000000000000",
14
+ "309c8140800036ed67466875099bf878fe4a0e35005b004c00c1f875fe400e35005d004c00c4f856fe2d0e390063006c00000000000000000000000000000000",
15
+ "30a081408000371d6847587509b9f71bfee70d22002c002300e3f73afe150e2b003500280014f854fe300e2d0038002900000000000000000000000000000000",
16
+ "30a38140800039fd6743587509def70ffea10d1a0031001f00d1f70ffeb10d19002c002200c5f711feb80d18002c002500000000000000000000000000000000",
17
+ "30a58140800037dd6746687509d8f70bfe980d270035001200ddf70dfe980d240038001900dff70ffe9b0d1f0035001a00000000000000000000000000000000",
18
+ "30a98140800037ed67484875099cf7edfdb00d310020000d009ef7eefda30d310022000c00adf7f2fd980d300028000a00000000000000000000000000000000",
19
+ "30ac8140800036ed67484875099cf709fed40d3a002400160097f7fafdd30d39002200150096f7f0fdc80d380022001400000000000000000000000000000000",
20
+ "30ae8140800038fd674558750987f72efed40d360021001c0089f729fed50d39002400180092f715fed10d390022001800000000000000000000000000000000",
21
+ "30b18140800037dd6747487509b8f705fea90d19001d002000c5f70dfeb00d210019002200bff71efec20d280018002400000000000000000000000000000000",
22
+ "30b48140800038fd684868750980f7e9fdd40d0200080024007df7f1fdba0d060011001e0084f7f8fdaa0d12001a001a00000000000000000000000000000000",
23
+ "30b7814080003fdd694958750918f6a9fd510f0d00d1ff370024f7b0fda90e0100ecff30006cf7d1fd210efffff5ff2c00000000000000000000000000000000",
24
+ "30ba81408080482d744768750963f71ffe190f5e00d9fea100ccf62dfe650f510009ff980015f702fe580f4b002eff8400000000000000000000000000000000",
25
+ "30bd814080802f7d864758750974f70efe4c0f5e00c0fea000d1f726fe1c0f5d00c5fea30028f859fe0e0f5c00cafea800000000000000000000000000000000",
26
+ "30bf8140808057cc984758750961f73afe630f99009dfeae0050f738fe710f7500adfea40050f721fe720f6e00b2fea300000000000000000000000000000000",
27
+ "30c281408080f479bd483875092ef8b6feab0f0a0180feba00f1f798fe900f000181febd00c2f77dfe7c0fdb008efebd00000000000000000000000000000000",
28
+ "30c581408080ad87d846487509e1f80000a6107e0178fea2004ef88dff54106c0185fea70063f826ffe60f520182feae00000000000000000000000000000000",
29
+ "30c8810080800797d84868750995f8e1fe4b0f7a0161fe88000df96dffd00f700149fe990035f9cdff361088016afea000000000000000000000000000000000",
30
+ "30cb810080804586d848487509cef672fe8a0f6d0217ff42002df63cfe280f1d0219ff410059f61cfe070fed01f5fe4a00000000000000000000000000000000",
31
+ "30d08100808002c5d745687509d8f5aaff830f5e03e6fe3e01fbf55bffc30f3f03e4fe100158f600ff3e102903e5fee700000000000000000000000000000000",
32
+ "30d3810080807b94d14838750991f6cd00690f9903f0fff10147f6e200560f7e038fffc60101f6c900560f71033bffa901000000000000000000000000000000",
33
+ "30d681008080b743ca475875095af7f2009c0fca03a400320242f7ca00950fb503820028020af7b000820fa4034e001a02000000000000000000000000000000",
34
+ "30d9810080805be3c047587509e7f77a03c70f0e04bb00410258f79801940f0004b800410251f74401910fd803b3003602000000000000000000000000000000",
35
+ "30dc810080808a02b245587509c0fbd5086a10710475020a03b0fb8d085d106c042102e8027efb660876106a04bc01af02000000000000000000000000000000",
36
+ "30de8100808036d2a14568750970fbbf09ad103704af038003a9fb600989105c0459036103c2fb2a097210690412034603000000000000000000000000000000",
37
+ "30e281008000cbb18d4738750989f8b40b2812380341044c0429f99e0bef11510340043704f2f93c0b7911b0033704f003000000000000000000000000000000",
38
+ "30e581008000c9c18945587509a5f7ca0a2e13e400c6024c0547f7fd0a941264011703270578f74a0b6012e40168030205000000000000000000000000000000",
39
+ "30e781008000c6618948687509acf86909e813d0fe2801a1057cf8cf09ed130fff6301990516f8710aaa13ccff13028205000000000000000000000000000000",
40
+ "30ea81008000c77189475875093af93b0762136efbaeff19060cf90107b113a9fb99ff0906e1f85b07b113bafc9fffcd05000000000000000000000000000000",
41
+ "30ed81008000c791894568750950f9ce047c1432f900026007a5f9a6051f146ef9bb013707bff99206a813fef9ce00c606000000000000000000000000000000",
42
+ "30ef81008000c6d1894558750944f8ad0358143ef81c02f10780f8b403841484f84102d107ccf801049314bcf84202ad07000000000000000000000000000000",
43
+ "30f381008000c761884868750914f72105e4134cf6d001c00743f71a05f11391f6bf01e407a0f7c904fa13faf6b3011008000000000000000000000000000000",
44
+ "30f681008000c7718344587509eaf54a04c812a6f40002500627f66d041313f2f40d02940682f6a60468133ef51a02d806000000000000000000000000000000",
45
+ "30f881008000c4e1814668750b5cf5f803b51125f3b5000d0560f50f04e8118cf33c015d057df525042c1210f4b101cc05000000000000000000000000000000",
46
+ "30fb81008000c5e1814458750b19f65a02a410acf29effb804e2f5db02df10b7f2c0ffbf04a9f55c032011dcf22400d804000000000000000000000000000000",
47
+ "30fe8100800035e2814858750b81f65c00f80f8df231fe940471f6e6001f1088f2a6fe92044ef6b1015a1092f21fffa004000000000000000000000000000000",
48
+ "3001810080004b03814868750b69f6e6fdad0ffef20efdd40479f678feb40fd9f249fdc40484f6f4fec00fb0f29ffdad04000000000000000000000000000000",
49
+ "30048100800079e47d4858750b17f64cfb5f0f46f46afb430529f6c4fb710ff1f3d4fb300538f64bfc830fbbf315fc1d05000000000000000000000000000000",
50
+ "300781008000a7057e4668750bb1f5d3f9fb0e8ef5ccf96405cdf5fcf90c0f44f52dfa6505e1f52dfa210f29f550fa6305000000000000000000000000000000",
51
+ "30098100800041f67d4668750bcdf4b0f9ab0e21f602f955057ef5adf9d00ee1f559f95f05b1f5d3f9fb0e8ef5ccf96405000000000000000000000000000000",
52
+ "300d810080003d877c4838750b84f458f7dd0c89f6d0f8fc0436f4e2f7620d83f614f8430526f4c0f8a00e71f666f85c05000000000000000000000000000000",
53
+ "30108100800058e77a4668750bf7f2c3f57c0c9cf6abfa0a0470f30ef6790c89f65dfa420414f476f67e0c80f6d0f98a04000000000000000000000000000000",
54
+ "30128100800059f77a4658750b7ef249f5580cd9f69bfaa40389f269f56c0cd1f6a9fab503a3f286f5760cacf6c9faeb03000000000000000000000000000000",
55
+ "3016810080005b177b4868750ba9f298f4450b2cf774fa3102b8f2a5f47a0b24f765fa6e02b8f2b8f4b10b1df755faac02000000000000000000000000000000",
56
+ "30198100800057777a4558750b39f258f4480a80f73efaf40016f26af4940a5ef76bfa37014ef275f4d40a46f780fa8401000000000000000000000000000000",
57
+ ].map(&:freeze).freeze
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ProconBypassMan
4
+ module Plugin
5
+ module Splatoon3
6
+ VERSION = "0.1.0"
7
+ end
8
+ end
9
+ end
@@ -6,8 +6,20 @@ require_relative "plugin/splatoon2/macro/jump_to_left_key"
6
6
  require_relative "plugin/splatoon2/macro/sokuwari_for_splash_bomb"
7
7
  require_relative "plugin/splatoon2/macro/forward_ikarole"
8
8
  require_relative "plugin/splatoon2/macro/charge_tansan_bomb"
9
+ require_relative "plugin/splatoon2/macro/dasei_cancel"
9
10
  require_relative "plugin/splatoon2/mode/guruguru"
10
11
 
12
+ require_relative "plugin/splatoon3/version"
13
+ require_relative "plugin/splatoon3/macro/fast_return"
14
+ require_relative "plugin/splatoon3/macro/jump_to_right_key"
15
+ require_relative "plugin/splatoon3/macro/jump_to_up_key"
16
+ require_relative "plugin/splatoon3/macro/jump_to_left_key"
17
+ require_relative "plugin/splatoon3/macro/sokuwari_for_splash_bomb"
18
+ require_relative "plugin/splatoon3/macro/forward_ikarole"
19
+ require_relative "plugin/splatoon3/macro/charge_tansan_bomb"
20
+ require_relative "plugin/splatoon3/macro/dasei_cancel"
21
+ require_relative "plugin/splatoon3/mode/guruguru"
22
+
11
23
  module ProconBypassMan
12
24
  module Plugin
13
25
  end
@@ -30,6 +30,7 @@ class ProconBypassMan::Procon::AnalogStick
30
30
  @bin_y.to_i(2) - neutral_position.y
31
31
  end
32
32
 
33
+ # @return [Float]
33
34
  def relative_hypotenuse
34
35
  Math.sqrt((relative_x**2) + (relative_y**2)).floor(6)
35
36
  end
@@ -33,6 +33,7 @@ class ProconBypassMan::Procon
33
33
  }
34
34
  BlueGreenProcess::SharedVariable.instance.data["buttons"] = {}
35
35
  BlueGreenProcess::SharedVariable.instance.data["current_layer_key"] = :up
36
+ BlueGreenProcess::SharedVariable.instance.data["recent_left_stick_hypotenuses"] = []
36
37
  end
37
38
  reset!
38
39
 
@@ -41,6 +42,7 @@ class ProconBypassMan::Procon
41
42
  self.user_operation = ProconBypassMan::Procon::UserOperation.new(
42
43
  binary.dup
43
44
  )
45
+ @left_stick_tilting_power_scaler = ProconBypassMan::AnalogStickTiltingPowerScaler.new
44
46
  end
45
47
 
46
48
  def status
@@ -55,6 +57,20 @@ class ProconBypassMan::Procon
55
57
  BlueGreenProcess::SharedVariable.instance.data["current_layer_key"] = layer
56
58
  end
57
59
 
60
+ RECENT_LEFT_STICK_POSITIONS_LIMIT = 5
61
+ # @param [Float] left_stick_hypotenuses
62
+ # @return [void]
63
+ def add_recent_left_stick_hypotenuses(left_stick_hypotenuses)
64
+ if (overflowed_size = recent_left_stick_hypotenuses.size - RECENT_LEFT_STICK_POSITIONS_LIMIT)
65
+ overflowed_size.times { recent_left_stick_hypotenuses.shift }
66
+ end
67
+ recent_left_stick_hypotenuses << left_stick_hypotenuses
68
+ end
69
+
70
+ def recent_left_stick_hypotenuses
71
+ BlueGreenProcess::SharedVariable.instance.data["recent_left_stick_hypotenuses"]
72
+ end
73
+
58
74
  def ongoing_macro; @@status[:ongoing_macro]; end
59
75
  def ongoing_mode; @@status[:ongoing_mode]; end
60
76
 
@@ -75,6 +91,8 @@ class ProconBypassMan::Procon
75
91
  end
76
92
 
77
93
  analog_stick = ProconBypassMan::Procon::AnalogStick.new(binary: user_operation.binary.raw)
94
+ add_recent_left_stick_hypotenuses(analog_stick.relative_hypotenuse)
95
+ dumped_tilting_power = @left_stick_tilting_power_scaler.calculate(recent_left_stick_hypotenuses)
78
96
 
79
97
  enable_all_macro = true
80
98
  enable_macro_map = Hash.new {|h,k| h[k] = true }
@@ -92,6 +110,16 @@ class ProconBypassMan::Procon
92
110
  current_layer.macros.each do |macro_name, options|
93
111
  next unless enable_macro_map[macro_name]
94
112
 
113
+ if(if_tilted_left_stick_value = options[:if_tilted_left_stick])
114
+ threshold = (if_tilted_left_stick_value.is_a?(Hash) && if_tilted_left_stick_value[:threshold]) || ProconBypassMan::AnalogStickTiltingPowerScaler::DEFAULT_THRESHOLD
115
+ if dumped_tilting_power.tilting?(threshold: threshold, current_position_x: analog_stick.relative_x, current_position_y: analog_stick.relative_y) && user_operation.pressing_all_buttons?(options[:if_pressed])
116
+ @@status[:ongoing_macro] = MacroRegistry.load(macro_name)
117
+ break
118
+ end
119
+
120
+ next
121
+ end
122
+
95
123
  if user_operation.pressing_all_buttons?(options[:if_pressed])
96
124
  @@status[:ongoing_macro] = MacroRegistry.load(macro_name, force_neutral_buttons: options[:force_neutral])
97
125
  break
@@ -0,0 +1,31 @@
1
+ class ProconBypassMan::AnalogStickTiltingPowerScaler
2
+ DEFAULT_THRESHOLD = 500
3
+
4
+ class PowerChunk
5
+ def initialize(hypotenuses)
6
+ @hypotenuses = hypotenuses
7
+ end
8
+
9
+ def moving_power
10
+ max = @hypotenuses.max
11
+ min = @hypotenuses.min
12
+ moving_power = (max - min).abs
13
+ end
14
+
15
+ # @return [Boolean]
16
+ def tilting?(threshold: DEFAULT_THRESHOLD, current_position_x: , current_position_y: )
17
+ # スティックがニュートラルな時
18
+ if (-200..200).include?(current_position_x) && (-200..200).include?(current_position_y)
19
+ return false
20
+ end
21
+
22
+ moving_power >= threshold
23
+ end
24
+ end
25
+
26
+ # @param [Array<Float>] hypotenuses
27
+ # @return [PowerChunk]
28
+ def calculate(hypotenuses)
29
+ PowerChunk.new(hypotenuses)
30
+ end
31
+ end
@@ -96,13 +96,14 @@ module ProconBypassMan
96
96
  sleep(10)
97
97
  retry
98
98
  end
99
+ raise if respond_to?(:raise_if_failed) && raise_if_failed
99
100
  rescue Timeout::Error
100
101
  ProconBypassMan.logger.error(e)
101
102
  sleep(10)
102
- retry
103
+ raise if respond_to?(:raise_if_failed) && raise_if_failed
103
104
  rescue => e
104
- puts e
105
105
  ProconBypassMan.logger.error(e)
106
+ raise if respond_to?(:raise_if_failed) && raise_if_failed
106
107
  end
107
108
  end
108
109
  end
@@ -5,5 +5,9 @@ module ProconBypassMan
5
5
  job_id: job_id,
6
6
  })
7
7
  end
8
+
9
+ def raise_if_failed
10
+ true
11
+ end
8
12
  end
9
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProconBypassMan
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.3"
5
5
  end
@@ -6,24 +6,32 @@ module ProconBypassMan
6
6
  new.run
7
7
  end
8
8
 
9
- # @param [Boolean]
9
+ # @return [Worker]
10
10
  def run
11
11
  return self if @thread
12
12
  @thread = Thread.new do
13
13
  while(item = ProconBypassMan::Background::JobQueue.pop)
14
- begin
15
- # プロセスを越えるので、文字列でenqueueしてくれる前提. evalしてクラスにする
16
- ProconBypassMan::Background::JobPerformer.new(klass: eval(item[:job_class]), args: item[:args]).perform
17
- rescue => e
18
- ProconBypassMan.logger.error(e)
19
- sleep(0.2) # busy loopしないように
20
- end
14
+ # プロセスを越えるので文字列になっている. evalしてクラスにする
15
+ work(job_class: eval(item[:job_class]), args: item[:args])
16
+ sleep(0.2) # busy loopしないように
21
17
  end
22
18
  end
23
19
 
24
20
  return self
25
21
  end
26
22
 
23
+ def work(job_class: , args: )
24
+ begin
25
+ job_class.perform(*args)
26
+ rescue => e
27
+ ProconBypassMan.logger.error(e)
28
+ if job_class.respond_to?(:re_enqueue_if_failed) && job_class.re_enqueue_if_failed
29
+ job_class.perform_async(args)
30
+ ProconBypassMan.logger.error("エラーが起きたので#{job_class}を積み直しました。")
31
+ end
32
+ end
33
+ end
34
+
27
35
  # 重要な非同期ジョブは存在しないのでqueueが捌けるのを待たずにkill
28
36
  def shutdown
29
37
  @thread&.kill
@@ -35,6 +35,7 @@ require_relative "procon_bypass_man/support/remote_macro_http_client"
35
35
  require_relative "procon_bypass_man/support/update_remote_pbm_action_status_http_client"
36
36
  require_relative "procon_bypass_man/support/send_device_stats_http_client"
37
37
  require_relative "procon_bypass_man/support/procon_performance_http_client"
38
+ require_relative "procon_bypass_man/support/analog_stick_hypotenuse_tilting_power_scaler"
38
39
  require_relative "procon_bypass_man/support/never_exit_accidentally"
39
40
  require_relative "procon_bypass_man/support/cycle_sleep"
40
41
  require_relative "procon_bypass_man/support/can_over_process"
@@ -195,7 +196,7 @@ module ProconBypassMan
195
196
  ProconBypassMan::RemoteMacroReceiver.start!
196
197
  BlueGreenProcess.config.logger = ProconBypassMan.logger
197
198
  }
198
- config.shared_variables = [:buttons, :current_layer_key]
199
+ config.shared_variables = [:buttons, :current_layer_key, :recent_left_stick_hypotenuses]
199
200
  end
200
201
  end
201
202
 
@@ -12,7 +12,7 @@ begin
12
12
  gemfile do
13
13
  source 'https://rubygems.org'
14
14
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
15
- gem 'procon_bypass_man', '0.3.1'
15
+ gem 'procon_bypass_man', '0.3.3'
16
16
  end
17
17
  rescue Bundler::Source::Git::GitCommandError => e
18
18
  retry_count_on_git_command_error = retry_count_on_git_command_error + 1
@@ -39,7 +39,7 @@ ProconBypassMan.configure do |config|
39
39
 
40
40
  # webからProconBypassManを操作できるwebサービスと連携します
41
41
  # 連携中はエラーログ、パフォーマンスに関するメトリクスを送信します
42
- # config.api_servers = 'https://pbm-cloud.herokuapp.com'
42
+ # config.api_servers = 'https://pbm-cloud.jiikko.com'
43
43
 
44
44
  # エラーが起きたらerror.logに書き込みます
45
45
  config.enable_critical_error_logging = true
@@ -12,7 +12,7 @@ begin
12
12
  gemfile do
13
13
  source 'https://rubygems.org'
14
14
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
15
- gem 'procon_bypass_man', '0.3.1'
15
+ gem 'procon_bypass_man', '0.3.3'
16
16
  end
17
17
  rescue Bundler::Source::Git::GitCommandError => e
18
18
  retry_count_on_git_command_error = retry_count_on_git_command_error + 1
@@ -39,7 +39,7 @@ ProconBypassMan.configure do |config|
39
39
 
40
40
  # webからProconBypassManを操作できるwebサービスと連携します
41
41
  # 連携中はエラーログ、パフォーマンスに関するメトリクスを送信します
42
- <%- api_server_config = "config.api_servers = 'https://pbm-cloud.herokuapp.com'" -%>
42
+ <%- api_server_config = "config.api_servers = 'https://pbm-cloud.jiikko.com'" -%>
43
43
  <%- if enable_integration_with_pbm_cloud -%>
44
44
  <%= api_server_config %>
45
45
  <%- else -%>
@@ -15,7 +15,11 @@ class AppGenerator
15
15
  def generate
16
16
  erb = File.read(template_path)
17
17
  enable_integration_with_pbm_cloud = @enable_integration_with_pbm_cloud
18
- app_rb = ERB.new(erb, nil, '-').result(binding)
18
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.6.0")
19
+ app_rb = ERB.new(erb, trim_mode: '-').result(binding)
20
+ else
21
+ app_rb = ERB.new(erb, nil, '-').result(binding)
22
+ end
19
23
  File.write(output_path, app_rb)
20
24
  end
21
25
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: procon_bypass_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiikko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-07 00:00:00.000000000 Z
11
+ date: 2022-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pbmenv
@@ -94,11 +94,16 @@ files:
94
94
  - bin/setup
95
95
  - docs/getting_started.md
96
96
  - docs/how_to_connect_procon.md
97
+ - docs/run_pbm_on_my_branch.md
97
98
  - docs/setting/left-analogstick-cap.md
99
+ - docs/setting/splatoon2_macro_dasei_cancel.md
98
100
  - docs/setting/splatoon2_macro_forward_ikarole.md
99
101
  - docs/setting/splatoon2_macro_sokuwari_bubble.md
100
102
  - docs/setting/splatoon2_recommended_setting.md
101
103
  - docs/setting/splatoon2_shake_tansan.md
104
+ - docs/setting/splatoon3_macro_dasei_cancel.md
105
+ - docs/setting/splatoon3_macro_forward_ikarole.md
106
+ - docs/setting/splatoon3_recommended_setting.md
102
107
  - docs/setup_raspi.md
103
108
  - docs/setup_raspi.mitamae.rb
104
109
  - docs/setup_raspi_by_mitamae.md
@@ -107,7 +112,6 @@ files:
107
112
  - lib/ext/module.rb
108
113
  - lib/procon_bypass_man.rb
109
114
  - lib/procon_bypass_man/background.rb
110
- - lib/procon_bypass_man/background/job_performer.rb
111
115
  - lib/procon_bypass_man/background/job_queue.rb
112
116
  - lib/procon_bypass_man/background/jobs/base_job.rb
113
117
  - lib/procon_bypass_man/background/jobs/concerns/has_external_api_setting.rb
@@ -163,6 +167,7 @@ files:
163
167
  - lib/procon_bypass_man/device_status.rb
164
168
  - lib/procon_bypass_man/ephemeral_configuration.rb
165
169
  - lib/procon_bypass_man/plugin/splatoon2/macro/charge_tansan_bomb.rb
170
+ - lib/procon_bypass_man/plugin/splatoon2/macro/dasei_cancel.rb
166
171
  - lib/procon_bypass_man/plugin/splatoon2/macro/fast_return.rb
167
172
  - lib/procon_bypass_man/plugin/splatoon2/macro/forward_ikarole.rb
168
173
  - lib/procon_bypass_man/plugin/splatoon2/macro/jump_to_left_key.rb
@@ -171,6 +176,16 @@ files:
171
176
  - lib/procon_bypass_man/plugin/splatoon2/macro/sokuwari_for_splash_bomb.rb
172
177
  - lib/procon_bypass_man/plugin/splatoon2/mode/guruguru.rb
173
178
  - lib/procon_bypass_man/plugin/splatoon2/version.rb
179
+ - lib/procon_bypass_man/plugin/splatoon3/macro/charge_tansan_bomb.rb
180
+ - lib/procon_bypass_man/plugin/splatoon3/macro/dasei_cancel.rb
181
+ - lib/procon_bypass_man/plugin/splatoon3/macro/fast_return.rb
182
+ - lib/procon_bypass_man/plugin/splatoon3/macro/forward_ikarole.rb
183
+ - lib/procon_bypass_man/plugin/splatoon3/macro/jump_to_left_key.rb
184
+ - lib/procon_bypass_man/plugin/splatoon3/macro/jump_to_right_key.rb
185
+ - lib/procon_bypass_man/plugin/splatoon3/macro/jump_to_up_key.rb
186
+ - lib/procon_bypass_man/plugin/splatoon3/macro/sokuwari_for_splash_bomb.rb
187
+ - lib/procon_bypass_man/plugin/splatoon3/mode/guruguru.rb
188
+ - lib/procon_bypass_man/plugin/splatoon3/version.rb
174
189
  - lib/procon_bypass_man/plugins.rb
175
190
  - lib/procon_bypass_man/processor.rb
176
191
  - lib/procon_bypass_man/procon.rb
@@ -234,6 +249,7 @@ files:
234
249
  - lib/procon_bypass_man/remote_pbm_action/value_objects/remote_pbm_action_object.rb
235
250
  - lib/procon_bypass_man/runner.rb
236
251
  - lib/procon_bypass_man/scheduler.rb
252
+ - lib/procon_bypass_man/support/analog_stick_hypotenuse_tilting_power_scaler.rb
237
253
  - lib/procon_bypass_man/support/callbacks.rb
238
254
  - lib/procon_bypass_man/support/can_over_process.rb
239
255
  - lib/procon_bypass_man/support/compress_array.rb
@@ -1,15 +0,0 @@
1
- module ProconBypassMan
2
- module Background
3
- class JobPerformer
4
- def initialize(klass: , args: )
5
- @klass = klass
6
- @args = args
7
- end
8
-
9
- # @raise [any]
10
- def perform
11
- @klass.perform(*@args)
12
- end
13
- end
14
- end
15
- end