From 80223f6bf5ee7265cb8b67b74dfee95292c49bc1 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Tue, 17 Sep 2024 13:20:18 +0500 Subject: [PATCH] now dont need to scroll --- remote | 56 +++++++++++++++++++++++--------------------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/remote b/remote index 48bbc01..9bb300d 100755 --- a/remote +++ b/remote @@ -15,36 +15,26 @@ launch_app() { sleep 1.5 } -scroll() { - case $1 in - up) $ADB input swipe 800 400 800 500 100 ;; - down) $ADB input swipe 800 500 800 400 100 ;; - *) echo "Invalid direction. Use 'up' or 'down'." ; exit 1 ;; - esac - sleep 0.5 -} - tap() { $ADB input tap $1 $2 -# sleep 1.5 } open_menu() { - tap 10 50 # Adjust these coordinates for the menu button + tap 50 50 # Adjust these coordinates for the menu button } select_device() { case "$1" in - 1) tap 20 150 ;; # Fan - 2) tap 20 250 ;; # AC - esac -} - -control_device() { - case "$1" in - 1) tap 30 200 ;; # Power - 2) tap 30 300 ;; # Speed - 3) tap 30 400 ;; # Mode + fan) + open_menu + sleep 1.5 + tap 60 200 + ;; # Fan from the list + ac) + open_menu + sleep 1.5 + tap 60 300 + ;; # AC from the list esac } @@ -59,17 +49,13 @@ show_main_menu() { case $choice in 1) - open_menu - sleep 1.5 - tap 20 150 # Select Fan - sleep 0.5 # Wait for menu to settle + select_device fan # Select Fan + sleep 0.5 fan_menu "Fan" ;; 2) - open_menu - sleep 1.5 - tap 20 200 # Select AC (adjust coordinates as needed) - sleep 0.5 # Wait for menu to settle + select_device ac # Select AC (adjust coordinates as needed) + sleep 0.5 ac_menu "AC" ;; 3) @@ -94,10 +80,14 @@ fan_menu() { read -n 1 -p "Enter your choice: " choice case $choice in - 1) scroll up ; tap 30 200 ; fan_menu ;; - 2) scroll up ; tap 640 200 ; fan_menu ;; - 3) scroll down; tap 320 500; fan_menu ;; - 4) scroll down; tap 320 650 ; fan_menu ;; + 1) tap 100 250 + fan_menu ;; + 2) tap 950 260 + fan_menu ;; + 3) tap 540 1200 + fan_menu ;; + 4) tap 540 1400 + fan_menu ;; 5) show_main_menu ;; *) echo "Invalid choice. Try Again..."; sleep 0.5; fan_menu ;; esac