Cleaning up further.
[pingpong.git] / automation / clickers.sh
1 #!/bin/bash
2
3 # This script does clicking action automatically
4 # We just need to set up the timer duration
5
6 # Parameters:
7 # $1 : device identification (run "adb devices" to figure out)
8
9 # Loop variables
10 BEGIN=1
11 #END=100
12 END=4
13 INC=1
14 DEVICE=$1
15
16 # Range of random number (in seconds)
17 RAN_STA=100
18 RAN_END=200
19
20 for ((i=$BEGIN; i<=$END; i+=$INC));
21 do
22         
23         date +"%m/%d/%Y %r"
24         #./adb -s "$DEVICE" shell getevent -l - use this command to get the position
25         # Click on screen
26         #./adb -s "$DEVICE" shell input tap 500 1500
27         # TP-Link switch
28         #./adb -s "$DEVICE" shell input tap 1002 913
29         # TP-Link bulb on/off
30         #./adb -s "$DEVICE" shell input tap 994 560
31         # D-Link switch
32         #./adb -s "$DEVICE" shell input tap 987 346
33         # D-Link motion sensor
34         #./adb -s "$DEVICE" shell input tap 975 840
35         # SmartThings plug
36         #./adb -s "$DEVICE" shell input tap 921 1188
37         #./adb -s "$DEVICE" shell input tap 533 653
38         # WeMo, WeMo Insight, LiFX bulbs, Hue bulbs with ST-app
39         ./adb -s "$DEVICE" shell input tap 533 653
40         # WeMo
41         #./adb -s "$DEVICE" shell input tap 981 532
42         # WeMo Insight
43         #./adb -s "$DEVICE" shell input tap 981 326
44         # Kwikset doorlock
45         #if (( $i % 2 ))
46         #then
47                 # locking
48         #       ./adb -s "$DEVICE" shell input tap 153 1211
49         #else
50                 # unlocking
51         #       ./adb -s "$DEVICE" shell input tap 520 1211
52         #fi
53         # Hue bulb
54         #./adb -s "$DEVICE" shell input tap 923 383
55         # Lifx bulb
56         #./adb -s "$DEVICE" shell input tap 506 580
57         # Amcrest camera
58         #if (( $i % 2 ))
59         #then
60                 # live view
61         #       ./adb -s "$DEVICE" shell input tap 92 139
62         #       ./adb -s "$DEVICE" shell input tap 92 139
63         #else
64                 # stop live view (go to playback)
65         #       ./adb -s "$DEVICE" shell input tap 92 139
66         #       ./adb -s "$DEVICE" shell input tap 92 250
67         #fi
68         # Arlo camera
69         #if (( $i % 2 ))
70         #then
71                 # live view
72                 #./adb -s "$DEVICE" shell input tap 532 740
73         #       ./adb -s "$DEVICE" shell input tap 533 653
74         #else
75                 # stop live view
76                 #./adb -s "$DEVICE" shell input tap 101 1012
77         #       ./adb -s "$DEVICE" shell input tap 533 653
78         #       ./adb -s "$DEVICE" shell input tap 533 653
79         #       ./adb -s "$DEVICE" shell input tap 533 653
80         #fi
81         # Blossom
82         #if (( $i % 2 ))
83         #then
84                 # start watering
85         #       ./adb -s "$DEVICE" shell input tap 538 1597
86         #else
87                 # stop watering
88         #       ./adb -s "$DEVICE" shell input tap 496 1533
89         #fi
90         # Dlink siren
91         #./adb -s "$DEVICE" shell input tap 994 802
92         # Nest thermostat
93         #if (( $i % 2))
94         #then
95                 # start fan
96         #       ./adb -s "$DEVICE" shell input tap 524 1668
97         #       ./adb -s "$DEVICE" shell input tap 936 1709
98         #else
99                 # stop fan
100         #       ./adb -s "$DEVICE" shell input tap 524 1668
101         #       ./adb -s "$DEVICE" shell input tap 679 1702
102         #fi
103         # Alexa
104         #if (( $i % 2))
105         #then
106                 # Using Google Translate and 
107                 #       having her speak to Alexa
108                 # Question 1
109         #        ./adb -s "$DEVICE" shell input tap 907 145
110         #        ./adb -s "$DEVICE" shell input tap 543 692
111         #       ./adb -s "$DEVICE" shell input tap 148 775
112         #else
113                 # Question 2
114         #        ./adb -s "$DEVICE" shell input tap 907 145
115         #        ./adb -s "$DEVICE" shell input tap 463 1668
116         #       ./adb -s "$DEVICE" shell input tap 148 775
117         #fi
118         #date +%r
119         #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
120         #RAND=$[`jot -r 1 $RAN_STA $RAN_END`]
121         #echo "Delay: $RAND seconds"
122         #sleep $[$RAND]s
123
124         # TP-Link bulb - change colors
125         #if (( $i % 2 ))
126         #then
127                 # color 1 - horizontal
128                 #./adb -s "$DEVICE" shell input tap 250 1000
129                 # color 3 - vertical
130         #        ./adb -s "$DEVICE" shell input tap 500 1250
131         #else
132                 # color 2 - horizontal
133                 #./adb -s "$DEVICE" shell input tap 750 1000
134                 # color 4 - vertical
135         #        ./adb -s "$DEVICE" shell input tap 500 750
136         #fi
137         
138         # pick a prime number > 120 seconds
139         sleep 131s
140         #sleep 53s
141 done