From 634a120a98bc0fe4d7b76fca7e903855372bc440 Mon Sep 17 00:00:00 2001 From: Arul Date: Sat, 9 Aug 2025 00:16:27 +0530 Subject: [PATCH] computer voice is added for save prompt --- src/main/java/com/firefox/wrapper/App.java | 32 ++++++++++++++++--- storage.json | 2 +- target/classes/com/firefox/wrapper/App.class | Bin 5040 -> 6179 bytes 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/firefox/wrapper/App.java b/src/main/java/com/firefox/wrapper/App.java index 7638398..dc4fc0f 100644 --- a/src/main/java/com/firefox/wrapper/App.java +++ b/src/main/java/com/firefox/wrapper/App.java @@ -7,6 +7,7 @@ import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.firefox.FirefoxProfile; import java.io.File; +import java.io.IOException; import java.util.Scanner; public class App { @@ -48,12 +49,14 @@ public class App { Scanner scanner = new Scanner(System.in); String input = ""; - System.out.println("Type 'save' and press Enter to save data and close browser..."); - while (!input.equalsIgnoreCase("save")) { + speakPrompt("Please type save and press Enter to save your work before closing the browser."); System.out.print("> "); - input = scanner.nextLine(); - System.out.println("You typed: " + input); + input = scanner.nextLine().trim(); + + if (!input.equalsIgnoreCase("save")) { + System.out.println("❌ You must save before quitting. Try again."); + } } Thread.sleep(500); // Give browser a moment to finish updates @@ -72,6 +75,27 @@ public class App { } } + private static void speakPrompt(String message) { + System.out.println(message); // Print the prompt message to console + try { + ProcessBuilder pb = new ProcessBuilder("./festival-tts", message); + pb.redirectErrorStream(true); + Process process = pb.start(); + + try (var reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream()))) { + while (reader.readLine() != null) { + // Consume output silently + } + } + + process.waitFor(); + + } catch (IOException | InterruptedException e) { + System.err.println("❌ Failed to run festival-tts:"); + e.printStackTrace(); + } + } + private static void saveAll() { if (driver != null) { CookieManager.saveCookies(driver); diff --git a/storage.json b/storage.json index 3e81547..7961ca7 100644 --- a/storage.json +++ b/storage.json @@ -1 +1 @@ -{"localStorage":{"soloLevelUpUserStats":"{\"name\":\"Arul\",\"level\":1,\"exp\":60,\"expToNextLevel\":100,\"job\":null,\"title\":null,\"hp\":100,\"maxHp\":100,\"mp\":10,\"maxMp\":10,\"fatigue\":0,\"gold\":0,\"stats\":{\"str\":10,\"agi\":10,\"per\":10,\"int\":10,\"vit\":10},\"statPoints\":2,\"equipment\":[],\"quests\":[{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"4564702d-396c-4f03-bc74-0496015c40aa\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754666927823},{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"24625727-2d42-4177-a0de-910020c30f48\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754673484851},{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"78bfd278-7ae8-4b8d-971b-1bfe5aa54e8d\",\"active\":false,\"completed\":true,\"progress\":100,\"isCustom\":true,\"createdAt\":1754673532100,\"completedAt\":1754677975079},{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"c28b9c88-ddfd-4989-ba44-b60c3368123f\",\"active\":false,\"completed\":true,\"progress\":100,\"isCustom\":true,\"createdAt\":1754673709922,\"completedAt\":1754677973400}],\"completedQuests\":[\"c28b9c88-ddfd-4989-ba44-b60c3368123f\",\"78bfd278-7ae8-4b8d-971b-1bfe5aa54e8d\"],\"inventory\":[{\"id\":\"item-health-potion\",\"name\":\"Health Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 100 HP when consumed.\",\"quantity\":3},{\"id\":\"item-mana-potion\",\"name\":\"Mana Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 50 MP when consumed.\",\"quantity\":2}]}"},"sessionStorage":{}} \ No newline at end of file +{"localStorage":{"soloLevelUpUserStats":"{\"name\":\"Arul\",\"level\":1,\"exp\":90,\"expToNextLevel\":100,\"job\":null,\"title\":null,\"hp\":100,\"maxHp\":100,\"mp\":10,\"maxMp\":10,\"fatigue\":0,\"gold\":0,\"stats\":{\"str\":10,\"agi\":10,\"per\":10,\"int\":10,\"vit\":10},\"statPoints\":3,\"equipment\":[],\"quests\":[{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"4564702d-396c-4f03-bc74-0496015c40aa\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754666927823},{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"24625727-2d42-4177-a0de-910020c30f48\",\"active\":false,\"completed\":true,\"progress\":100,\"isCustom\":true,\"createdAt\":1754673484851,\"completedAt\":1754678557235},{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"78bfd278-7ae8-4b8d-971b-1bfe5aa54e8d\",\"active\":false,\"completed\":true,\"progress\":100,\"isCustom\":true,\"createdAt\":1754673532100,\"completedAt\":1754677975079},{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"c28b9c88-ddfd-4989-ba44-b60c3368123f\",\"active\":false,\"completed\":true,\"progress\":100,\"isCustom\":true,\"createdAt\":1754673709922,\"completedAt\":1754677973400}],\"completedQuests\":[\"c28b9c88-ddfd-4989-ba44-b60c3368123f\",\"78bfd278-7ae8-4b8d-971b-1bfe5aa54e8d\",\"24625727-2d42-4177-a0de-910020c30f48\"],\"inventory\":[{\"id\":\"item-health-potion\",\"name\":\"Health Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 100 HP when consumed.\",\"quantity\":3},{\"id\":\"item-mana-potion\",\"name\":\"Mana Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 50 MP when consumed.\",\"quantity\":2}]}"},"sessionStorage":{}} \ No newline at end of file diff --git a/target/classes/com/firefox/wrapper/App.class b/target/classes/com/firefox/wrapper/App.class index ffe1a4f6f11ab0a847465c8c1d66008e70af9000..ea02971fe47eee64403a8b42cb1cf8edd9200679 100644 GIT binary patch delta 2538 zcmZ`)dvIK375|-Ncke##X7eJ+rb)Aw&~6@^w6)KKrfEvr20}nmflw80vN!44&F*sd zZfj>8cj{0bW*q+T4$hz!P=s_GjHGq8fzpSs7Eu)6TB}%4(MSaql!A8s-QBdL({X3# z-tRl-eCPX}bAIRCrv^^mzYrH9hm zZ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