Deleting unwanted scripts and checking in relevant ones.
[pingpong.git] / automation / clickers2.sh
1 #!/bin/bash
2
3 # This script does clicking action automatically
4 # We just need to set up the timer duration
5
6 # Loop variables
7 BEGIN=1
8 END=100
9 #END=2
10 INC=1
11 DEVICE=$1
12
13 # Range of random number (in seconds)
14 RAN_STA=100
15 RAN_END=200
16
17 for ((i=$BEGIN; i<=$END; i+=$INC));
18 do
19         
20         date +"%m/%d/%Y %r"
21         #./adb shell getevent -l - use this command to get the position
22         # Click on screen
23         #./adb -s "$DEVICE" shell input tap 500 1500
24         # TP-Link switch
25         #./adb -s "$DEVICE" shell input tap 1002 913
26         # TP-Link bulb on/off
27         #./adb -s "$DEVICE" shell input tap 994 560
28         # D-Link switch
29         #./adb -s "$DEVICE" shell input tap 987 346
30         # D-Link motion sensor
31         #./adb -s "$DEVICE" shell input tap 975 840
32         # SmartThings plug
33         #./adb -s "$DEVICE" shell input tap 921 1188
34         #./adb -s "$DEVICE" shell input tap 533 653
35         # WeMo, WeMo Insight, LiFX bulbs, Hue bulbs with ST-app
36         #./adb -s "$DEVICE" shell input tap 533 653
37         # WeMo
38         #./adb -s "$DEVICE" shell input tap 981 532
39         # WeMo Insight
40         #./adb -s "$DEVICE" shell input tap 981 326
41         # Kwikset doorlock
42         #if (( $i % 2 ))
43         #then
44                 # locking
45         #       ./adb -s "$DEVICE" shell input tap 153 1211
46         #else
47                 # unlocking
48         #       ./adb -s "$DEVICE" shell input tap 520 1211
49         #fi
50         # Hue bulb
51         #./adb -s "$DEVICE" shell input tap 923 383
52         # Lifx bulb
53         #./adb -s "$DEVICE" shell input tap 506 580
54         # Amcrest camera
55         #if (( $i % 2 ))
56         #then
57                 # live view
58         #       ./adb -s "$DEVICE" shell input tap 92 139
59         #       ./adb -s "$DEVICE" shell input tap 92 139
60         #else
61                 # stop live view (go to playback)
62         #       ./adb -s "$DEVICE" shell input tap 92 139
63         #       ./adb -s "$DEVICE" shell input tap 92 250
64         #fi
65         # Arlo camera
66         #if (( $i % 2 ))
67         #then
68                 # live view
69                 #./adb -s "$DEVICE" shell input tap 532 740
70         #       ./adb -s "$DEVICE" shell input tap 533 653
71         #else
72                 # stop live view
73                 #./adb -s "$DEVICE" shell input tap 101 1012
74         #       ./adb -s "$DEVICE" shell input tap 533 653
75         #       ./adb -s "$DEVICE" shell input tap 533 653
76         #       ./adb -s "$DEVICE" shell input tap 533 653
77         #fi
78         # Blossom - turning on/off 1 zone
79         #if (( $i % 2 ))
80         #then
81                 # start watering
82         #       ./adb -s "$DEVICE" shell input tap 538 1597
83         #else
84                 # stop watering
85         #       ./adb -s "$DEVICE" shell input tap 496 1533
86         #fi
87         # Blossom - change mode active/hibernate
88         #./adb -s "$DEVICE" shell input tap 1002 1176
89         # Dlink siren
90         #./adb -s "$DEVICE" shell input tap 994 802
91         # Nest thermostat
92         #if (( $i % 2))
93         #then
94                 # start fan
95         #       ./adb -s "$DEVICE" shell input tap 524 1668
96         #       ./adb -s "$DEVICE" shell input tap 936 1709
97         #else
98                 # stop fan
99         #       ./adb -s "$DEVICE" shell input tap 524 1668
100         #       ./adb -s "$DEVICE" shell input tap 679 1702
101         #fi
102         # Alexa
103         #if (( $i % 2))
104         #then
105                 # Using Google Translate and 
106                 #       having her speak to Alexa
107                 # Question 1
108         #        ./adb -s "$DEVICE" shell input tap 907 145
109         #        ./adb -s "$DEVICE" shell input tap 543 692
110         #       ./adb -s "$DEVICE" shell input tap 148 775
111         #else
112                 # Question 2
113         #        ./adb -s "$DEVICE" shell input tap 907 145
114         #        ./adb -s "$DEVICE" shell input tap 463 1668
115         #       ./adb -s "$DEVICE" shell input tap 148 775
116         #fi
117         #date +%r
118         #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
119         #RAND=$[`jot -r 1 $RAN_STA $RAN_END`]
120         #echo "Delay: $RAND seconds"
121         #sleep $[$RAND]s
122
123         # TP-Link bulb - change colors & intensity
124         if (( $i % 2 ))
125         then
126                 # color 1 - horizontal
127                 #./adb -s "$DEVICE" shell input tap 250 1000
128                 # color 3 - vertical
129                 #./adb -s "$DEVICE" shell input tap 500 1250
130                 # intensity change
131                 ./adb -s "$DEVICE" shell input tap 150 1405
132         else
133                 # color 2 - horizontal
134                 #./adb -s "$DEVICE" shell input tap 750 1000
135                 # color 4 - vertical
136                 #./adb -s "$DEVICE" shell input tap 500 750
137                 # intensity change
138                 ./adb -s "$DEVICE" shell input tap 950 1405
139         fi
140         # Hue bulb - change intensity
141         #if (( $i % 2 ))
142         #then
143                 # intensity change (bright)
144         #        ./adb -s "$DEVICE" shell input tap 300 550
145         #else
146                 # intensity change (dimmed)
147         #        ./adb -s "$DEVICE" shell input tap 800 550
148         #fi
149         # Arlo camera - arm/disarm
150         #if (( $i % 2 ))
151         #then
152                 # Arm
153         #        ./adb -s "$DEVICE" shell input tap 500 500
154         #else
155                 # Disarm
156         #        ./adb -s "$DEVICE" shell input tap 500 750
157         #fi
158         # Arlo camera - record
159         #./adb -s "$DEVICE" shell input tap 515 923
160         #./adb -s "$DEVICE" shell input tap 524 883
161         # Arlo camera - sound (on/off)
162         #./adb -s "$DEVICE" shell input tap 70 850
163         # Nest thermostat mode change (heat/cool)
164         #if (( $i % 2))
165         #then
166                 # auto (heat/cool)
167         #       ./adb -s "$DEVICE" shell input tap 110 1700
168         #       ./adb -s "$DEVICE" shell input tap 110 1600
169         #else
170                 # off
171         #       ./adb -s "$DEVICE" shell input tap 110 1700
172         #       ./adb -s "$DEVICE" shell input tap 110 1700
173         #fi        
174         # Nest thermostat mode change (start/stop eco mode)
175         #./adb -s "$DEVICE" shell input tap 350 1700
176         #./adb -s "$DEVICE" shell input tap 350 1600
177         # Sengled bulb - ON/OFF
178         #./adb -s "$DEVICE" shell input tap 550 800
179         # Sengled bulb - intensity
180         #if (( $i % 2 ))
181         #then
182                 # 1%
183         #        ./adb -s "$DEVICE" shell input tap 70 1150
184         #else
185                 # 100%
186         #        ./adb -s "$DEVICE" shell input tap 1020 1150
187         #fi
188         # Rachio sprinkler - ON/OFF
189         #if (( $i % 2 ))
190         #then
191                 # ON
192         #        ./adb -s "$DEVICE" shell input tap 900 1500
193         #        ./adb -s "$DEVICE" shell input tap 300 600
194         #        ./adb -s "$DEVICE" shell input tap 800 1700
195         #        ./adb -s "$DEVICE" shell input tap 800 1700
196         #else
197                 # OFF/PAUSE
198         #        ./adb -s "$DEVICE" shell input tap 920 1650
199         #fi
200         # Rachio sprinkler - standby/active
201         #if (( $i % 2 ))
202         #then
203                 # Standby mode
204         #        ./adb -s "$DEVICE" shell input tap 700 700
205         #        ./adb -s "$DEVICE" shell input tap 700 1100
206         #else
207                 # Active mode
208         #        ./adb -s "$DEVICE" shell input tap 600 700
209         #fi
210         # Ring doorbell - ring alerts
211         #./adb -s "$DEVICE" shell input tap 1000 570
212         # Ring doorbell - motion alerts
213         #./adb -s "$DEVICE" shell input tap 1000 750
214         # Ecobee thermostat - ON/OFF
215         #if (( $i % 2 ))
216         #then
217                 # ON (Auto)
218         #        ./adb -s "$DEVICE" shell input tap 550 550
219         #else
220                 # OFF 
221         #        ./adb -s "$DEVICE" shell input tap 550 650
222         #fi
223         # Ecobee thermostat - fan ON/Auto
224         #if (( $i % 2 )) 
225         #then
226                 # ON 
227         #        ./adb -s "$DEVICE" shell input tap 900 650
228         #else
229                 # Auto
230         #        ./adb -s "$DEVICE" shell input tap 700 650
231         #fi
232         # Nest camera - ON/OFF
233         #./adb -s "$DEVICE" shell input tap 1020 320
234         # Nest camera - Audio Talk/Done
235         #./adb -s "$DEVICE" shell input tap 550 1650
236         # Nest camera - Mic ON/OFF
237         #./adb -s "$DEVICE" shell input tap 1020 630
238         # Roomba - ON/OFF
239         #if (( $i % 2 ))
240         #then
241                 # ON
242         #        ./adb -s "$DEVICE" shell input tap 550 950
243         #else
244                 # OFF
245         #        ./adb -s "$DEVICE" shell input tap 550 950
246         #       sleep 1s # need a short sleep here
247         #        ./adb -s "$DEVICE" shell input tap 550 1600
248         #       sleep 1s # need a short sleep here
249         #        ./adb -s "$DEVICE" shell input tap 550 950
250         #fi
251         # Amazon plug - ON/OFF
252         #./adb -s "$DEVICE" shell input tap 550 700
253         # Ring Alarm - Arm/Disarm
254         #if (( $i % 2 ))
255         #then
256                 # Arm (Away)
257         #        ./adb -s "$DEVICE" shell input tap 850 350
258         #else
259                 # Disarm
260         #        ./adb -s "$DEVICE" shell input tap 300 350
261         #fi
262
263         # pick a prime number > 120 seconds
264         sleep 131s
265         #sleep 53s
266 done
267 #ssh root@192.168.1.1 "kill -9 21280 21287"