From 41346e92b8727ac7889d3e1346d3c2c9b976e617 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 21 Sep 2022 23:30:06 -0400 Subject: [PATCH 01/22] fixed a bug in the Judgementday installer. --- audiogame-manager.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 2bd6f87..1e03159 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -1995,6 +1995,7 @@ case "${game}" in add_launcher "c:\Program Files\VGA\interceptor\launch_interceptor.exe" ;; "Judgement Day") + export bottle="l-works" install_wine_bottle vb6run dx8vb quartz download "http://files.l-works.net/judgmentdayfullsetup.exe" wine "${cache}/judgmentdayfullsetup.exe" /silent From 3e7d4627511f5eb10fa4aa72153df0af54e6464c Mon Sep 17 00:00:00 2001 From: Michael Taboada Date: Fri, 23 Sep 2022 21:34:29 -0700 Subject: [PATCH 02/22] Bk3 now workingm Marina break sort of working but needs more instruction, so commented out. --- audiogame-manager.sh | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 1e03159..d9f88a8 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -944,6 +944,7 @@ gameList=( "BG Yahtzee" "Blind Drive" "Bloodshed" + "Bokurano Daibouken 3" "Bombercats" #"Breed Memorial" "Castaways" @@ -995,7 +996,7 @@ gameList=( "Lunimals" "Manamon" "Manamon 2" - "Marina Break" + #"Marina Break" "Monkey Business" "MudSplat French" "MudSplat English" @@ -1590,6 +1591,20 @@ case "${game}" in cp "${cache}/bloodshed.exe" "$WINEPREFIX/drive_c/Program Files/" add_launcher "c:\Program Files\bloodshed.exe" ;; + "Bokurano Daibouken 3") + export bottle="nyanchan" + export winVer="win7" + install_wine_bottle + download "https://www.nyanchangames.com/softs/nn3_setup.exe" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd32.dll" + wine "$cache/nn3_setup.exe" & + xdotool sleep 10 key --clearmodifiers --delay=75 ctrl+a + xdotool sleep 1 key --clearmodifiers --delay=75 BackSpace + xdotool sleep 1 type --delay=75 'c:\nyanchangame\bk3' + xdotool sleep 1 key --clearmodifiers --delay=75 Return + wineserver -w + find "${WINEPREFIX}" -type f -name 'nvdaControllerClient.dll' -exec cp -v "${cache}/nvda2speechd32.dll" "{}" \; + add_launcher "c:\nyanchangame\bk3\play.exe" + ;; "Bombercats") export bottle="oriol-gomez" export winVer="win7" @@ -2023,13 +2038,12 @@ EOF add_launcher "c:\Program Files\Kringle Crash\kringlecrash.exe" ;; "Laser Breakout") + # Currently only speaks in japanese, looking to see if we can find an english version. export bottle="nyanchan" export winVer="win7" install_wine_bottle - download "http://www.nyanchangames.com/softs/lsSetup.exe" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd32.dll" - wine "${cache}/lsSetup.exe" & - xdotool sleep 10 key Return - wineserver -w + download "https://www.agarchive.net/games/nyanchan/laser%20breakout.7z" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd32.dll" + 7z e -o"$WINEPREFIX/drive_c/nyanchangame/laser breakout" "$cache/laser breakout.7z" find "${WINEPREFIX}" -type f -name 'nvdaControllerClient.dll' -exec cp -v "${cache}/nvda2speechd32.dll" "{}" \; add_launcher "c:\nyanchangame\laser breakout\play.exe" ;; @@ -2104,11 +2118,11 @@ EOF export bottle="nyanchan" export winVer="win7" install_wine_bottle speechsdk - download "https://www.nyanchangames.com/softs/MbSetupE.exe" + download "https://www.nyanchangames.com/softs/MbSetupE.exe" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd64.dll" wine "${cache}/MbSetupE.exe" & xdotool sleep 10 key Return wineserver -w - find "${WINEPREFIX}" -type f -name "nvdaControllerClient.dll" -exec rm -fv "{}" \; + find "${WINEPREFIX}" -type f -name "nvdaControllerClient.dll" -exec cp -v "$cache/nvda2speechd32.dll" "{}" \; add_launcher "c:\nyanchangame\MarinaBreak\marinabreak.exe" ;; "Monkey Business") From dc37c865ca990ac5eb02518d4a482b15d6f45346 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 24 Sep 2022 15:05:08 -0400 Subject: [PATCH 03/22] Road to Rage added but commented out because it is not speaking yet. --- audiogame-manager.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index d9f88a8..7a562b0 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -775,6 +775,9 @@ game_launcher() { if [[ "$game" =~ laser-breakout ]]; then pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & fi + if [[ "$game" =~ bokurano-daibouken-3 ]]; then + pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & + fi if [[ "$game" =~ sequence-storm ]]; then [[ -x ~/.SequenceStormReader ]] && ~/.SequenceStormReader & fi @@ -1018,6 +1021,7 @@ gameList=( "Revelation" "Rhythm Rage" #"River Raiders" + #"Road to Rage" "RS Games" "Run For Your Life" #"Sammy Center" @@ -2292,6 +2296,15 @@ EOF wineserver -w add_launcher "c:\Program Files\River Raiders\raid.exe" ;; + "Road to Rage") + export WINEARCH=win64 + export winVer="win7" + install_wine_bottle + download "https://iamtalon.me/games/rtr_ultimate.zip" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd64.dll" + unzip -d "$WINEPREFIX/drive_c/Program Files" "${cache}/rtr_ultimate.zip" + find "${WINEPREFIX}" -type f -name 'nvdaControllerClient.dll' -exec cp -v "${cache}/nvda2speechd64.dll" "{}" \; + add_launcher "c:\Program Files\rtr_Ultimate\trtr.exe" + ;; "RS Games") export winVer="win7" install_wine_bottle speechsdk From 74b750c53bc1e2c778e8938363234cbcb33d79db Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 24 Sep 2022 16:31:32 -0400 Subject: [PATCH 04/22] Small change to detect the utility tee if it is in a nonstandard location. --- audiogame-manager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 7a562b0..e30aae1 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -886,7 +886,7 @@ unset manualInstall # Set up logging echo -e "\n\n-----> Logging started at $(date '+%A, %B %d, %Y at %I:%M%p')\n" >> "${cache}/audiogame-manager.log" -exec &> >(/usr/bin/tee -a "${cache}/audiogame-manager.log") +exec &> >(command /usr/bin/tee -a "${cache}/audiogame-manager.log") # The list of games available for installation. # Use menu friendly names. From 5a7ca7c8cbd685bff997eee2b8cdfb6f3c4c1793 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 24 Sep 2022 19:20:42 -0400 Subject: [PATCH 05/22] Fixed tee for real this time lol. --- audiogame-manager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index e30aae1..2c2a570 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -886,7 +886,7 @@ unset manualInstall # Set up logging echo -e "\n\n-----> Logging started at $(date '+%A, %B %d, %Y at %I:%M%p')\n" >> "${cache}/audiogame-manager.log" -exec &> >(command /usr/bin/tee -a "${cache}/audiogame-manager.log") +exec &> >(command tee -a "${cache}/audiogame-manager.log") # The list of games available for installation. # Use menu friendly names. From 98d3d0617ca826054b7ad0edc662d728950dccfb Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 25 Sep 2022 03:21:33 -0400 Subject: [PATCH 06/22] Road to Rage and Road to Rage Offline added. Road to rage requires a script that is in the speech directory to speak. --- audiogame-manager.sh | 15 ++++++++++++--- speech/speak_window_title.sh | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100755 speech/speak_window_title.sh diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 2c2a570..59341b4 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -1021,7 +1021,8 @@ gameList=( "Revelation" "Rhythm Rage" #"River Raiders" - #"Road to Rage" + "Road to Rage" + "Road to Rage Offline" "RS Games" "Run For Your Life" #"Sammy Center" @@ -2300,10 +2301,18 @@ EOF export WINEARCH=win64 export winVer="win7" install_wine_bottle - download "https://iamtalon.me/games/rtr_ultimate.zip" "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd64.dll" + download "https://iamtalon.me/games/rtr_ultimate.zip" unzip -d "$WINEPREFIX/drive_c/Program Files" "${cache}/rtr_ultimate.zip" - find "${WINEPREFIX}" -type f -name 'nvdaControllerClient.dll' -exec cp -v "${cache}/nvda2speechd64.dll" "{}" \; add_launcher "c:\Program Files\rtr_Ultimate\trtr.exe" + echo "To get speech in this game please run speak_window_title.sh in the speech directory." + ;; + "Road to Rage Offline") + export winVer="win7" + install_wine_bottle speechsdk + download "https://agarchive.net/games/talon/the%20road%20to%20rage%20offline.7z" + 7z x -o"$WINEPREFIX/drive_c/Program Files" "${cache}/the road to rage offline.7z" + find "${WINEPREFIX}" -type f -name "nvdaControllerClient.dll" -exec rm -fv "{}" \; + add_launcher "c:\Program Files\RTR Offline\rtr.exe" ;; "RS Games") export winVer="win7" diff --git a/speech/speak_window_title.sh b/speech/speak_window_title.sh new file mode 100755 index 0000000..87d1101 --- /dev/null +++ b/speech/speak_window_title.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Adapted from the bash snippet found at: +# https://bbs.archlinux.org/viewtopic.php?id=117031 + +while : ; do + wnd_focus=$(xdotool getwindowfocus) + wnd_title=$(xprop -id $wnd_focus WM_NAME) + lookfor='"(.*)"' + + if [[ "$wnd_title" =~ $lookfor ]]; then + wnd_title=${BASH_REMATCH[1]} + if [[ "$old_title" != "$wnd_title" ]]; then + spd-say "$wnd_title" + old_title="$wnd_title" + fi + fi + sleep 0.01 +done From b7c68c3a046ded9608aaed0d333a1c196b187b17 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 26 Sep 2022 04:01:33 -0400 Subject: [PATCH 07/22] Code to import translation file if found for BK3. This may be buggy, please report any problems. Dict.dat should be located either in Downloads or Desktop for this to work. --- audiogame-manager.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 59341b4..7f998e0 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -777,6 +777,10 @@ game_launcher() { fi if [[ "$game" =~ bokurano-daibouken-3 ]]; then pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & + dictPath="$(winepath "${winePath}")" + if [[ -r "${cache}/bk3-dict.dat" ]] && [[ ! -r "${dictPath}/dict.dat" ]]; then + cp "${cache}/bk3-dict.dat" "${dictPath}/dict.dat" + fi fi if [[ "$game" =~ sequence-storm ]]; then [[ -x ~/.SequenceStormReader ]] && ~/.SequenceStormReader & @@ -1597,6 +1601,15 @@ case "${game}" in add_launcher "c:\Program Files\bloodshed.exe" ;; "Bokurano Daibouken 3") + dictFile="" + for i in "${HOME}/Downloads/dict.dat" "${HOME}/Desktop/dict.dat" ; do + if [[ -r "$i" ]]; then + dictFile="$i" + fi + done + if [[ "$i" != "" ]] && [[ ! -r "${cache}/bk3-dict.dat" ]]; then + dialog --backtitle "Audiogame manager" --yesno "Possible English translation file found at $dictFile. Would you like to use it for BK3?" -1 -1 --stdout && cp -v "$dictFile" "${cache}/bk3-dict.dat" + fi export bottle="nyanchan" export winVer="win7" install_wine_bottle From de39454cb44a2e2b8d67ed351c494b3b306d52b9 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 2 Oct 2022 13:06:15 -0400 Subject: [PATCH 08/22] Hopefully improved the installer for Bokurano Daibouken 3. It should now prompt for the translation file and provide the url where it can be obtained. --- audiogame-manager.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 7f998e0..2edeb9c 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -1601,13 +1601,17 @@ case "${game}" in add_launcher "c:\Program Files\bloodshed.exe" ;; "Bokurano Daibouken 3") + if [[ ! -r "${cache}/bk3-dict.dat" ]]; then + echo "http://www.nyanchangames.com/order/bk3translate.html" | xclip -selection clipboard 2> /dev/null + dialog --backtitle "Audiogame manager" --msgbox "If you would like English translations, the file is available at http://www.nyanchangames.com/order/bk3translate.html. Save the dict.dat file to your Downloads or Desktop directory. For convenience the url has been copied to your clipboard. Press enter when you are ready to continue." -1 -1 --stdout + fi dictFile="" for i in "${HOME}/Downloads/dict.dat" "${HOME}/Desktop/dict.dat" ; do if [[ -r "$i" ]]; then dictFile="$i" fi done - if [[ "$i" != "" ]] && [[ ! -r "${cache}/bk3-dict.dat" ]]; then + if [[ "${#i}" -ge 3 ]] && [[ ! -r "${cache}/bk3-dict.dat" ]]; then dialog --backtitle "Audiogame manager" --yesno "Possible English translation file found at $dictFile. Would you like to use it for BK3?" -1 -1 --stdout && cp -v "$dictFile" "${cache}/bk3-dict.dat" fi export bottle="nyanchan" From b10934869373428b0c265f2c2638a4fe86c50e15 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 2 Oct 2022 15:04:16 -0400 Subject: [PATCH 09/22] Game World of War is now working, so uncommented. --- audiogame-manager.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 2edeb9c..65dae40 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -1068,7 +1068,7 @@ gameList=( "VIP Mud" "Warsim" #"Wolf Games Launcher" - #"World of War" + "World of War" ) # Make sure the minimum of curl, sox, wget, wine, and winetricks are installed @@ -2723,11 +2723,12 @@ EOF add_launcher "c:\Program Files\wg-release\WolfGames.exe" ;; "World of War") + export bottle="nyanchan" export winVer="win7" - install_wine_bottle speechsdk + install_wine_bottle download "https://www.agarchive.net/games/nyanchan/world%20of%20war%20English.7z" - 7z e -o"$WINEPREFIX/drive_c/Program Files/World of War" "${cache}/world of war English.7z" - #add_launcher "c:\Program Files\" + 7z x -o"$WINEPREFIX/drive_c/nyanchangame" "${cache}/world of war English.7z" + add_launcher "c:\nyanchangame\world of war English\world of war.exe" ;; "Donate") open_url "https://ko-fi.com/stormux" From 46fda472791e4e303677351b2118870c7dded010 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 4 Oct 2022 02:57:19 -0400 Subject: [PATCH 10/22] First pass at a script to translate the text in the clipboard. Not ready for prime time, unless you are working on the script, do not use yet. --- speech/clipboard_translator.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 speech/clipboard_translator.sh diff --git a/speech/clipboard_translator.sh b/speech/clipboard_translator.sh new file mode 100755 index 0000000..4c04c85 --- /dev/null +++ b/speech/clipboard_translator.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# Clear the clipboard so you don't accidently send personal info to the translator. +echo "" | xclip -d "${DISPLAY:-:0}" -selection clipboard +export dictionaryFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/translations.txt" +if [[ ! -r "$dictionaryFile" ]]; then + touch "$dictionaryFile" +fi +newText="" +oldText="" +oldTranslatedText="" +while : ; do + newText="$(xclip -d "${DISPLAY:-:0}" -selection clipboard -o)" + sleep 0.01 + if [[ "$oldText" == "$newText" ]] || [[ "$newText" == "" ]]; then + continue + fi + export newText + translatedText="$(awk -v originalText="${newText}" 'BEGIN { exitCode = 1; FS = "\\)==:\\[" } + $1~originalText { print $2; exitCode = 0; exit} + END { exit exitCode }' "$dictionaryFile")" + if [[ "${#translatedText}" -ge 1 ]]; then + if [[ "${translatedText}" != "${oldTranslatedText}" ]]; then + spd-say "$translatedText" + fi + oldTranslatedText="$translatedText" + continue + fi + translatedText="$(trans -b -- "$newText")" + echo "${newText})==:[${translatedText}" >> "$dictionaryFile" + sort -uo "$dictionaryFile" "$dictionaryFile" + spd-say "$translatedText" + oldText="$newText" +done From 4c440646f0a3c123228d79c59fcd2b4f30afafb1 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 4 Oct 2022 16:42:32 -0400 Subject: [PATCH 11/22] The clipboard translator is much closer to working now. Tests with BK2 went reasonably well. --- speech/clipboard_translator.sh | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/speech/clipboard_translator.sh b/speech/clipboard_translator.sh index 4c04c85..eab5879 100755 --- a/speech/clipboard_translator.sh +++ b/speech/clipboard_translator.sh @@ -1,18 +1,23 @@ #!/usr/bin/env bash +cleanup() { + sort -uo "$dictionaryFile" "$dictionaryFile" +} + +trap cleanup EXIT + # Clear the clipboard so you don't accidently send personal info to the translator. -echo "" | xclip -d "${DISPLAY:-:0}" -selection clipboard +echo "" | xclip -d "${DISPLAY:-:0}" -selection clipboard 2> /dev/null export dictionaryFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/translations.txt" if [[ ! -r "$dictionaryFile" ]]; then touch "$dictionaryFile" fi -newText="" -oldText="" -oldTranslatedText="" while : ; do - newText="$(xclip -d "${DISPLAY:-:0}" -selection clipboard -o)" + newText="" + translatedText="" + newText="$(xclip -d "${DISPLAY:-:0}" -selection clipboard -o 2> /dev/null)" sleep 0.01 - if [[ "$oldText" == "$newText" ]] || [[ "$newText" == "" ]]; then + if [[ "${#newText}" -lt 1 ]]; then continue fi export newText @@ -20,15 +25,14 @@ while : ; do $1~originalText { print $2; exitCode = 0; exit} END { exit exitCode }' "$dictionaryFile")" if [[ "${#translatedText}" -ge 1 ]]; then - if [[ "${translatedText}" != "${oldTranslatedText}" ]]; then - spd-say "$translatedText" - fi - oldTranslatedText="$translatedText" + spd-say "$translatedText" + echo "" | xclip -d "${DISPLAY:-:0}" -selection clipboard 2> /dev/null continue fi translatedText="$(trans -b -- "$newText")" - echo "${newText})==:[${translatedText}" >> "$dictionaryFile" - sort -uo "$dictionaryFile" "$dictionaryFile" + if [[ "${newText}" != "${translatedText}" ]]; then + echo "${newText})==:[${translatedText}" >> "$dictionaryFile" + fi spd-say "$translatedText" - oldText="$newText" + echo "" | xclip -d "${DISPLAY:-:0}" -selection clipboard 2> /dev/null done From 59fc787007ed16c81175347c8d1a4809aceeee8c Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 4 Oct 2022 17:39:36 -0400 Subject: [PATCH 12/22] Added bk and bk2 --- audiogame-manager.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 65dae40..7cb0323 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -363,7 +363,7 @@ get_bottle() { "super-liam"*) ;& "the-great-toy-robbery"*) export WINEPREFIX="${HOME}/.local/wine/l-works";; # Nyanchan games group - "bokurano-daibouken-3"*) ;& + "bokurano-daibouken"*) ;& "laser-breakout"*) ;& "marina-break"*) ;& "mp5"*) ;& @@ -951,6 +951,8 @@ gameList=( "BG Yahtzee" "Blind Drive" "Bloodshed" + "Bokurano Daibouken" + "Bokurano Daibouken 2" "Bokurano Daibouken 3" "Bombercats" #"Breed Memorial" @@ -1600,6 +1602,24 @@ case "${game}" in cp "${cache}/bloodshed.exe" "$WINEPREFIX/drive_c/Program Files/" add_launcher "c:\Program Files\bloodshed.exe" ;; + "Bokurano Daibouken") + export bottle="nyanchan" + export winVer="win7" + install_wine_bottle + download "https://www.nyanchangames.com/softs/nn_setup.exe" + 7z x -o"$WINEPREFIX/drive_c/nyanchangame/bk" "${cache}/nn_setup.exe" + find "${WINEPREFIX}" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; + add_launcher "c:\nyanchangame\bk\play.exe" + ;; + "Bokurano Daibouken 2") + export bottle="nyanchan" + export winVer="win7" + install_wine_bottle + download "https://www.nyanchangames.com/softs/nn2_setup.exe" + 7z x -o"$WINEPREFIX/drive_c/nyanchangame/bk2" "${cache}/nn2_setup.exe" + find "${WINEPREFIX}" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; + add_launcher "c:\nyanchangame\bk2\play.exe" + ;; "Bokurano Daibouken 3") if [[ ! -r "${cache}/bk3-dict.dat" ]]; then echo "http://www.nyanchangames.com/order/bk3translate.html" | xclip -selection clipboard 2> /dev/null From 52fa738f863dca5ddbcedd26bbb12e6578bc43c1 Mon Sep 17 00:00:00 2001 From: Michael Taboada Date: Tue, 4 Oct 2022 15:04:59 -0700 Subject: [PATCH 13/22] Don't remove nvda dlls from the entire wineprefix, since it is a shared prefix --- audiogame-manager.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 7cb0323..d27df2d 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -1608,7 +1608,7 @@ case "${game}" in install_wine_bottle download "https://www.nyanchangames.com/softs/nn_setup.exe" 7z x -o"$WINEPREFIX/drive_c/nyanchangame/bk" "${cache}/nn_setup.exe" - find "${WINEPREFIX}" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; + find "${WINEPREFIX}/drive_c/nyanchangame/bk/" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; add_launcher "c:\nyanchangame\bk\play.exe" ;; "Bokurano Daibouken 2") @@ -1617,7 +1617,7 @@ case "${game}" in install_wine_bottle download "https://www.nyanchangames.com/softs/nn2_setup.exe" 7z x -o"$WINEPREFIX/drive_c/nyanchangame/bk2" "${cache}/nn2_setup.exe" - find "${WINEPREFIX}" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; + find "${WINEPREFIX}/drive_c/nyanchangame/bk2/" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; add_launcher "c:\nyanchangame\bk2\play.exe" ;; "Bokurano Daibouken 3") From 3332cb8d397baf0cd79435ea72af418959732adf Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 4 Oct 2022 20:48:30 -0400 Subject: [PATCH 14/22] Improvements to the clipboard translator. --- speech/clipboard_translator.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/speech/clipboard_translator.sh b/speech/clipboard_translator.sh index eab5879..c5c9b20 100755 --- a/speech/clipboard_translator.sh +++ b/speech/clipboard_translator.sh @@ -20,9 +20,14 @@ while : ; do if [[ "${#newText}" -lt 1 ]]; then continue fi + if [[ "${newText}" =~ ^[0-9A-Za-z[:space:][:punct:]]+$ ]]; then + spd-say "$newText" + echo "" | xclip -d "${DISPLAY:-:0}" -selection clipboard 2> /dev/null + continue + fi export newText - translatedText="$(awk -v originalText="${newText}" 'BEGIN { exitCode = 1; FS = "\\)==:\\[" } - $1~originalText { print $2; exitCode = 0; exit} + translatedText="$(awk -v originalText="${newText})==:" 'BEGIN { exitCode = 1; FS = "\\)==:\\[" } + $0~originalText { print $2; exitCode = 0; exit} END { exit exitCode }' "$dictionaryFile")" if [[ "${#translatedText}" -ge 1 ]]; then spd-say "$translatedText" @@ -30,7 +35,7 @@ while : ; do continue fi translatedText="$(trans -b -- "$newText")" - if [[ "${newText}" != "${translatedText}" ]]; then + if ! [[ "${newText}" =~ ^[0-9[:punct:]]+$ ]]; then echo "${newText})==:[${translatedText}" >> "$dictionaryFile" fi spd-say "$translatedText" From f25d5d4b90ab4758cded4b0470508a5737479033 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 4 Oct 2022 23:47:23 -0400 Subject: [PATCH 15/22] Clipboard-translator will now start on launch of Bokurano Daibouken 1 and 2. --- audiogame-manager.sh | 3 +++ speech/clipboard_translator.sh | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index d27df2d..1bf176c 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -775,6 +775,9 @@ game_launcher() { if [[ "$game" =~ laser-breakout ]]; then pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & fi + if [[ "$game" =~ ^bokurano-daibouken\||bokurano-daibouken-2\| ]]; then + "${0%/*}/speech/clipboard_translator.sh" play.exe & + fi if [[ "$game" =~ bokurano-daibouken-3 ]]; then pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & dictPath="$(winepath "${winePath}")" diff --git a/speech/clipboard_translator.sh b/speech/clipboard_translator.sh index c5c9b20..0aaadb2 100755 --- a/speech/clipboard_translator.sh +++ b/speech/clipboard_translator.sh @@ -12,7 +12,18 @@ export dictionaryFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-m if [[ ! -r "$dictionaryFile" ]]; then touch "$dictionaryFile" fi -while : ; do + +if [[ $# -ne 1 ]]; then + echo "Usage: $0 application name." +fi + +# Wait for the application to start +while ! pgrep -u "$USER" ^$1 &> /dev/null ; do + sleep 0.05 +done + +# Read so long as the application is running +while pgrep -u "$USER" ^$1 &> /dev/null ; do newText="" translatedText="" newText="$(xclip -d "${DISPLAY:-:0}" -selection clipboard -o 2> /dev/null)" From cc05b931fbef395c33d4d387af1eef156a2c79cd Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 5 Oct 2022 03:48:16 -0400 Subject: [PATCH 16/22] Added Shadow Line. It is commented out though because I still have to deal with the installer. If you want to play it, uncomment and when the installer pops up press enter 3 times and wait about 5 minutes, then press enter again and the game will launch. Close it and relaunch from the agm launcher. --- audiogame-manager.sh | 13 +++++++++++++ speech/clipboard_translator.sh | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 1bf176c..4729590 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -778,6 +778,9 @@ game_launcher() { if [[ "$game" =~ ^bokurano-daibouken\||bokurano-daibouken-2\| ]]; then "${0%/*}/speech/clipboard_translator.sh" play.exe & fi + if [[ "$game" =~ hadow-line ]]; then + "${0%/*}/speech/clipboard_translator.sh" play_sr.exe & + fi if [[ "$game" =~ bokurano-daibouken-3 ]]; then pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & dictPath="$(winepath "${winePath}")" @@ -1041,6 +1044,7 @@ gameList=( "Sequence Storm" #"Shades of Doom 1.2" "Shades of Doom" + #"Shadow Line" "Shooter" "Silver Dollar" "Slender Lost Vision" @@ -2429,6 +2433,15 @@ EOF wine "${cache}/sod20022.exe" /silent add_launcher "c:\Program Files\Shades of Doom 2.0\sod.exe" ;; + "Shadow Line") + export winVer="win7" + install_wine_bottle + download "https://www.mm-galabo.com/sr/Download_files_srfv/shadowrine_fullvoice3.171.exe" + wine "${cache}/shadowrine_fullvoice3.171.exe" /sp- & + wineserver -w + find "${WINEPREFIX}/drive_c/Program Files" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; + add_launcher "c:\Program Files\GalaxyLaboratory\ShadowRine_FullVoice\play_sr.exe" + ;; "Silver Dollar") export winVer="win7" install_wine_bottle speechsdk diff --git a/speech/clipboard_translator.sh b/speech/clipboard_translator.sh index 0aaadb2..d34a3a7 100755 --- a/speech/clipboard_translator.sh +++ b/speech/clipboard_translator.sh @@ -45,7 +45,7 @@ while pgrep -u "$USER" ^$1 &> /dev/null ; do echo "" | xclip -d "${DISPLAY:-:0}" -selection clipboard 2> /dev/null continue fi - translatedText="$(trans -b -- "$newText")" + translatedText="$(trans -no-autocorrect -b -- "$newText")" if ! [[ "${newText}" =~ ^[0-9[:punct:]]+$ ]]; then echo "${newText})==:[${translatedText}" >> "$dictionaryFile" fi From b88277a26c251972f49c9a93e17fb109fc5710d5 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 5 Oct 2022 04:29:40 -0400 Subject: [PATCH 17/22] A little more work on Shadow Line, still need to do the installer though. --- audiogame-manager.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 4729590..52c6e64 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -778,7 +778,7 @@ game_launcher() { if [[ "$game" =~ ^bokurano-daibouken\||bokurano-daibouken-2\| ]]; then "${0%/*}/speech/clipboard_translator.sh" play.exe & fi - if [[ "$game" =~ hadow-line ]]; then + if [[ "$game" =~ shadow-line ]]; then "${0%/*}/speech/clipboard_translator.sh" play_sr.exe & fi if [[ "$game" =~ bokurano-daibouken-3 ]]; then @@ -2439,7 +2439,7 @@ EOF download "https://www.mm-galabo.com/sr/Download_files_srfv/shadowrine_fullvoice3.171.exe" wine "${cache}/shadowrine_fullvoice3.171.exe" /sp- & wineserver -w - find "${WINEPREFIX}/drive_c/Program Files" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; + find "${WINEPREFIX}/drive_c/" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; add_launcher "c:\Program Files\GalaxyLaboratory\ShadowRine_FullVoice\play_sr.exe" ;; "Silver Dollar") From bb0194c023dcc1d08fd277bc88437ff0df097ced Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 5 Oct 2022 04:41:40 -0400 Subject: [PATCH 18/22] Installer for Shadow Line should work now, requires xdotool. --- audiogame-manager.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 52c6e64..4d29ca6 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -1044,7 +1044,7 @@ gameList=( "Sequence Storm" #"Shades of Doom 1.2" "Shades of Doom" - #"Shadow Line" + "Shadow Line" "Shooter" "Silver Dollar" "Slender Lost Vision" @@ -2438,6 +2438,13 @@ EOF install_wine_bottle download "https://www.mm-galabo.com/sr/Download_files_srfv/shadowrine_fullvoice3.171.exe" wine "${cache}/shadowrine_fullvoice3.171.exe" /sp- & + xdotool sleep 30 key --clearmodifiers --delay=75 Return + xdotool key --clearmodifiers --delay=500 Return + xdotool key --clearmodifiers --delay=500 Return + xdotool key --clearmodifiers --delay=500 Return + xdotool sleep 300 key --clearmodifiers --delay=500 Down + xdotool key --clearmodifiers --delay=500 space + xdotool key --clearmodifiers --delay=500 alt+f wineserver -w find "${WINEPREFIX}/drive_c/" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; add_launcher "c:\Program Files\GalaxyLaboratory\ShadowRine_FullVoice\play_sr.exe" From 59d37427334fe44b96149f6758fe435f40b10d14 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 5 Oct 2022 17:26:35 -0400 Subject: [PATCH 19/22] Moved the removal of nvdaControllerClient to the launcher of the game because sometimes it gets readded. --- audiogame-manager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 4d29ca6..f94f3e5 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -779,6 +779,7 @@ game_launcher() { "${0%/*}/speech/clipboard_translator.sh" play.exe & fi if [[ "$game" =~ shadow-line ]]; then + find "${WINEPREFIX}/drive_c/" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; "${0%/*}/speech/clipboard_translator.sh" play_sr.exe & fi if [[ "$game" =~ bokurano-daibouken-3 ]]; then @@ -2446,7 +2447,6 @@ EOF xdotool key --clearmodifiers --delay=500 space xdotool key --clearmodifiers --delay=500 alt+f wineserver -w - find "${WINEPREFIX}/drive_c/" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; add_launcher "c:\Program Files\GalaxyLaboratory\ShadowRine_FullVoice\play_sr.exe" ;; "Silver Dollar") From 43d733343d93ed93e5ea69f8f9ba3cab64699fc1 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 5 Oct 2022 18:51:21 -0400 Subject: [PATCH 20/22] Some fixes to installers, and now use the translator for bk3 if you don't have the dictionary file. --- audiogame-manager.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index f94f3e5..654c7ea 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -783,11 +783,17 @@ game_launcher() { "${0%/*}/speech/clipboard_translator.sh" play_sr.exe & fi if [[ "$game" =~ bokurano-daibouken-3 ]]; then - pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & dictPath="$(winepath "${winePath}")" if [[ -r "${cache}/bk3-dict.dat" ]] && [[ ! -r "${dictPath}/dict.dat" ]]; then cp "${cache}/bk3-dict.dat" "${dictPath}/dict.dat" fi + if [[ -r "${dictPath}/dict.dat" ]]; then + pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & + fi + if [[ ! -r "${dictPath}/dict.dat" ]]; then + find "${WINEPREFIX}/drive_c/nyanchangame/bk3" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; + "${0%/*}/speech/clipboard_translator.sh" play.exe & + fi fi if [[ "$game" =~ sequence-storm ]]; then [[ -x ~/.SequenceStormReader ]] && ~/.SequenceStormReader & @@ -1639,7 +1645,7 @@ case "${game}" in dictFile="$i" fi done - if [[ "${#i}" -ge 3 ]] && [[ ! -r "${cache}/bk3-dict.dat" ]]; then + if [[ "${#dictFile}" -ge 3 ]] && [[ ! -r "${cache}/bk3-dict.dat" ]]; then dialog --backtitle "Audiogame manager" --yesno "Possible English translation file found at $dictFile. Would you like to use it for BK3?" -1 -1 --stdout && cp -v "$dictFile" "${cache}/bk3-dict.dat" fi export bottle="nyanchan" From 2ca3cae57c710bdfce677ce65b24af82de3e270e Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Thu, 6 Oct 2022 03:52:02 -0400 Subject: [PATCH 21/22] Try a new method of detecting translation dictionary because just copying the file into place means it gets imported every time. --- audiogame-manager.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 654c7ea..bd45148 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -784,13 +784,13 @@ game_launcher() { fi if [[ "$game" =~ bokurano-daibouken-3 ]]; then dictPath="$(winepath "${winePath}")" - if [[ -r "${cache}/bk3-dict.dat" ]] && [[ ! -r "${dictPath}/dict.dat" ]]; then + if [[ -r "${cache}/bk3-dict.dat" ]] && [[ ! -d "${dictPath}/dict" ]]; then cp "${cache}/bk3-dict.dat" "${dictPath}/dict.dat" fi - if [[ -r "${dictPath}/dict.dat" ]]; then + if [[ -d "${dictPath}/dict" ]]; then pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & fi - if [[ ! -r "${dictPath}/dict.dat" ]]; then + if [[ ! -d "${dictPath}/dict" ]]; then find "${WINEPREFIX}/drive_c/nyanchangame/bk3" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; "${0%/*}/speech/clipboard_translator.sh" play.exe & fi From a2cce62b1fd922a426ffe1e7bd38f986ef889cad Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Thu, 6 Oct 2022 11:54:24 -0400 Subject: [PATCH 22/22] Updated the window title speaking script to function more like clipboard translator. This means you don't need to launch it before opening games that require it any more. --- audiogame-manager.sh | 4 +++- speech/speak_window_title.sh | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index bd45148..da8eb4f 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -795,6 +795,9 @@ game_launcher() { "${0%/*}/speech/clipboard_translator.sh" play.exe & fi fi + if [[ "$game" =~ road-to-rage\| ]]; then + "${0%/*}/speech/speak_window_title.sh" trtr.exe & + fi if [[ "$game" =~ sequence-storm ]]; then [[ -x ~/.SequenceStormReader ]] && ~/.SequenceStormReader & fi @@ -2355,7 +2358,6 @@ EOF download "https://iamtalon.me/games/rtr_ultimate.zip" unzip -d "$WINEPREFIX/drive_c/Program Files" "${cache}/rtr_ultimate.zip" add_launcher "c:\Program Files\rtr_Ultimate\trtr.exe" - echo "To get speech in this game please run speak_window_title.sh in the speech directory." ;; "Road to Rage Offline") export winVer="win7" diff --git a/speech/speak_window_title.sh b/speech/speak_window_title.sh index 87d1101..4e8f9f1 100755 --- a/speech/speak_window_title.sh +++ b/speech/speak_window_title.sh @@ -2,7 +2,13 @@ # Adapted from the bash snippet found at: # https://bbs.archlinux.org/viewtopic.php?id=117031 -while : ; do +# Wait for the application to start +while ! pgrep -u "$USER" ^$1 &> /dev/null ; do + sleep 0.05 +done + +# Read so long as the application is running +while pgrep -u "$USER" ^$1 &> /dev/null ; do wnd_focus=$(xdotool getwindowfocus) wnd_title=$(xprop -id $wnd_focus WM_NAME) lookfor='"(.*)"'